subroutine test_handle_PrefetchData() type (ServerThread) :: s character(len=:), allocatable :: expected type (ArrayReference) :: reference_a, reference_u, reference_v type (MockSocketLog), target :: log type (MockSocket) :: client_socket real(kind=REAL32), target :: a, u(NX,NY), v(NX,NY) type (MockServer) :: mock_server integer :: i reference_a = ArrayReference(a) reference_u = ArrayReference(u) reference_v = ArrayReference(v) client_socket = MockSocket(log) call client_socket%add_message(AddExtCollectionMessage('foo')) call client_socket%add_message(PrefetchDataMessage(1, 1, 'fake_data.nc4', 'a', reference_a)) call client_socket%add_message(PrefetchDataMessage(2, 1, 'fake_data.nc4', 'u', reference_u, start=[1,1])) call client_socket%add_message(PrefetchDataMessage(3, 1, 'fake_data.nc4', 'v', reference_v, start=[1,1])) call client_socket%add_message(PrefetchDoneMessage()) call client_socket%add_message(TerminateMessage()) mock_server = MockServer() call s%init(client_socket, mock_server) call s%set_rank(1) do i = 1,6 call s%run() enddo expected = "" expected = expected // "receive<AddExtCollection('foo')>" expected = expected // " :: send<Id(001)>" expected = expected // " :: receive<PrefetchData('a')>" expected = expected // " :: send<Dummy>" expected = expected // " :: receive<PrefetchData('u')>" expected = expected // " :: send<Dummy>" expected = expected // " :: receive<PrefetchData('v')>" expected = expected // " :: send<Dummy>" expected = expected // " :: receive<Done_prefetch>" expected = expected // " :: put()" expected = expected // " :: put()" expected = expected // " :: put()" expected = expected // " :: wait()" expected = expected // " :: wait()" expected = expected // " :: wait()" expected = expected // " :: receive<Terminate>" @assertEqual(expected, log%log) @assertEqual(A_EXPECTED, log%values_a) @assertEqual(U_EXPECTED, log%values_u) @assertEqual(V_EXPECTED, log%values_v) end subroutine test_handle_PrefetchData