[complement-svn] SF.net SVN: complement: [1622] trunk/complement/explore/test/sockios
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2007-07-18 09:42:27
|
Revision: 1622 http://svn.sourceforge.net/complement/?rev=1622&view=rev Author: complement Date: 2007-07-18 02:42:23 -0700 (Wed, 18 Jul 2007) Log Message: ----------- check of correct understanding ip expressed as string added to existent test; separate test removed Modified Paths: -------------- trunk/complement/explore/test/sockios/ConnectionProcessor.cc trunk/complement/explore/test/sockios/sockios_test_suite.cc Modified: trunk/complement/explore/test/sockios/ConnectionProcessor.cc =================================================================== --- trunk/complement/explore/test/sockios/ConnectionProcessor.cc 2007-07-18 09:27:10 UTC (rev 1621) +++ trunk/complement/explore/test/sockios/ConnectionProcessor.cc 2007-07-18 09:42:23 UTC (rev 1622) @@ -116,6 +116,22 @@ // sock.close(); // no needs, that will done in sock destructor } + { + std::sockstream sock( "127.0.0.1", ::port ); + string srv_line; + + sock << ::message << endl; + + EXAM_CHECK( sock.good() ); + + // sock.clear(); + getline( sock, srv_line ); + + EXAM_CHECK( sock.good() ); + + EXAM_CHECK( srv_line == ::message_rsp ); + } + srv.close(); // close server, so we don't wait server termination on next line srv.wait(); // Wait for server stop to serve clients connections #else Modified: trunk/complement/explore/test/sockios/sockios_test_suite.cc =================================================================== --- trunk/complement/explore/test/sockios/sockios_test_suite.cc 2007-07-18 09:27:10 UTC (rev 1621) +++ trunk/complement/explore/test/sockios/sockios_test_suite.cc 2007-07-18 09:42:23 UTC (rev 1622) @@ -29,47 +29,6 @@ using namespace std; -int EXAM_IMPL(test_client_server_poll_local_ack) -{ -#ifndef __FIT_NO_POLL - try { - // server listen localhost (127.0.0.1), but not listen ext interface: - sockmgr_stream_MP<ConnectionProcessor> srv( 0x7f000001, port ); // start server - - { - EXAM_MESSAGE( "Client start" ); - - std::sockstream sock( "127.0.0.1", ::port ); - string srv_line; - - sock << ::message << endl; - - EXAM_CHECK( sock.good() ); - - // sock.clear(); - getline( sock, srv_line ); - - EXAM_CHECK( sock.good() ); - - EXAM_CHECK( srv_line == ::message_rsp ); - - EXAM_MESSAGE( "Client close connection (client's end of life)" ); - // sock.close(); // no needs, that will done in sock destructor - } - - srv.close(); // close server, so we don't wait server termination on next line - srv.wait(); // Wait for server stop to serve clients connections - } - catch ( std::domain_error& err ) { - EXAM_ERROR( "host not found by name" ); - } -#else - EXAM_ERROR( "poll-based sockmgr not implemented on this platform" ); -#endif - - return EXAM_RESULT; -} - int generator_1() { static int i = 0; @@ -210,7 +169,6 @@ t.add( &trivial_sockios_test::listen_iface, trivial_test, "listen_iface", tc[0] ); - t.add( test_client_server_poll_local_ack, "test_client_server_poll_local_ack" ); t.add( test_mass_processing_poll, "test_mass_processing_poll" ); t.add( srv_close_connection_test, "srv_close_connection_test" ); t.add( test_shared_socket, "test_shared_socket" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |