test_serialize_1d Subroutine

public subroutine test_serialize_1d()

Arguments

None

Calls

proc~~test_serialize_1d~~CallsGraph proc~test_serialize_1d test_serialize_1d assertequal assertequal proc~test_serialize_1d->assertequal none~deserialize AbstractDataMessage%deserialize proc~test_serialize_1d->none~deserialize none~get_length AbstractDataMessage%get_length proc~test_serialize_1d->none~get_length none~serialize AbstractDataMessage%serialize proc~test_serialize_1d->none~serialize interface~deserialize_intrinsic deserialize_intrinsic none~deserialize->interface~deserialize_intrinsic interface~serialize_buffer_length serialize_buffer_length none~deserialize->interface~serialize_buffer_length proc~mapl_return MAPL_Return none~deserialize->proc~mapl_return none~get_length->interface~serialize_buffer_length interface~serialize_intrinsic serialize_intrinsic none~serialize->interface~serialize_intrinsic none~serialize->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Source Code

   subroutine test_serialize_1d()
      type (PrefetchDataMessage) :: msg_in, msg_out
      type (ArrayReference) :: ref

      integer, target :: n(3)
      integer, allocatable :: buffer(:)

      ref = ArrayReference(n)

      msg_in = PrefetchDataMessage(1, 3, 'foo', 'bar', ref, start=[2])
      allocate(buffer(msg_in%get_length()))
      call msg_in%serialize(buffer)
      call msg_out%deserialize(buffer)

      @assertEqual(1, msg_out%request_id)
      @assertEqual(3, msg_out%collection_id)
      @assertEqual('foo', msg_out%file_name)
      @assertEqual('bar', msg_out%var_name)
      @assertEqual([2], msg_out%start)

      
      
   end subroutine test_serialize_1d