module test_PrefetchDataMessage use pfunit use pFIO_PrefetchDataMessageMod use pFIO_ArrayReferenceMod implicit none contains @test 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 end module test_PrefetchDataMessage