test_return_on_terminate_b Subroutine

public subroutine test_return_on_terminate_b()

Arguments

None

Calls

proc~~test_return_on_terminate_b~~CallsGraph proc~test_return_on_terminate_b test_return_on_terminate_b assertequal assertequal proc~test_return_on_terminate_b->assertequal none~add_message MockSocket%add_message proc~test_return_on_terminate_b->none~add_message none~init~3 ServerThread%init proc~test_return_on_terminate_b->none~init~3 none~run~2 ServerThread%run proc~test_return_on_terminate_b->none~run~2 none~set_rank ServerThread%set_rank proc~test_return_on_terminate_b->none~set_rank none~push_back~76 MessageVector%push_back none~add_message->none~push_back~76 none~set_connection BaseThread%set_connection none~init~3->none~set_connection proc~mapl_return MAPL_Return none~init~3->proc~mapl_return proc~mapl_verify MAPL_Verify none~init~3->proc~mapl_verify none~dispatch AbstractMessage%dispatch none~run~2->none~dispatch none~get_connection BaseThread%get_connection none~run~2->none~get_connection none~start~83 DistributedProfiler%start none~run~2->none~start~83 none~run~2->proc~mapl_return none~run~2->proc~mapl_verify receive receive none~run~2->receive none~dispatch->proc~mapl_return none~dispatch->proc~mapl_verify handle handle none~dispatch->handle none~get_connection->proc~mapl_return interface~mapl_assert MAPL_Assert none~get_connection->interface~mapl_assert none~capacity~451 MessageVector%capacity none~push_back~76->none~capacity~451 none~resize~152 MessageVector%resize none~push_back~76->none~resize~152 none~set_connection->proc~mapl_return none~start_self~2 StubProfiler%start_self none~start~83->none~start_self~2 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 proc~mapl_verify->proc~mapl_throw_exception none~resize_32~53 MessageVector%resize_32 none~resize~152->none~resize_32~53 none~start_self~2->proc~mapl_return

Source Code

   subroutine test_return_on_terminate_b()
      type (ServerThread), target :: s

      type (MockSocketLog), target :: log
      type (MockSocket) :: client_socket
      type (MockServer), target :: mock_server
      integer :: i

      client_socket = MockSocket(log)
      call client_socket%add_message(DoneMessage())
      call client_socket%add_message(TerminateMessage())
      mock_server = MockServer()
      call s%init(client_socket, mock_server)
      call s%set_rank(1)

      do i = 1, 3 ! NOT 2. when done is issued, need one more run to receive terminate
         call s%run()
      enddo
      @assertEqual("receive<Done> :: receive<Terminate>", log%log)

   end subroutine test_return_on_terminate_b