X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Ftimeout.cpp;h=936cc6ab2a8e3ffc19a9b7df50049c14ca99d5f0;hp=3434c0b44e7dc31b67c2fa4aec16eefcd258fc3e;hb=cf902cadb87cc6f75ae92c2dc64742555dd4f0f0;hpb=307b5e74c506b609d5c407be0943f45255ab5122 diff --git a/test/timeout.cpp b/test/timeout.cpp index 3434c0b..936cc6a 100644 --- a/test/timeout.cpp +++ b/test/timeout.cpp @@ -49,9 +49,7 @@ on this file might be covered by the GNU General Public License. #include "test_fixtures.hxx" -#ifdef HAVE_CONFIG_H #include -#endif using namespace std; using namespace libt2n; @@ -127,33 +125,18 @@ class testfunc2_cmd : public libt2n::command BOOST_CLASS_EXPORT(testfunc2_cmd) BOOST_CLASS_EXPORT(testfunc2_res) -// this is an evil hack to get access to real_write, don't ever do this in an app!!! -class real_write_connection: public socket_server_connection -{ - public: - void real_write(const std::string& data) - { socket_write(data); } -}; - -// this is an evil hack to get access to real_write, don't ever do this in an app!!! -class real_write_client_connection: public socket_client_connection -{ - public: - void real_write(const std::string& data) - { socket_write(data); } -}; - - class test_timeoutFixture : public KillChildOnShutdownFixture { protected: typedef uint32_t packet_size_indicator; - void send_hello(string hello_string, socket_server* ss, unsigned int conn_id) + // this is an evil hack to get access to real_write, don't ever do this in an app!!! + class real_write_client_connection: public socket_client_connection { - server_connection *sc=ss->get_connection(conn_id); - sc->write(hello_string); - } + public: + void real_write(const std::string& data) + { socket_write(data); } + }; void send_slow_raw_socket(string data, socket_server* ss, unsigned int conn_id) { @@ -171,15 +154,6 @@ protected: usleep(200000); } } - -public: - test_timeoutFixture() - { - } - - ~test_timeoutFixture() - { - } }; BOOST_FIXTURE_TEST_SUITE(test_timeout, test_timeoutFixture) @@ -394,8 +368,6 @@ BOOST_AUTO_TEST_CASE(CommandTimeout) } catch(t2n_transfer_error &e) { errormsg=e.what(); } - catch(...) - { throw; } BOOST_CHECK_EQUAL(string("timeout exceeded"),errormsg); } @@ -473,8 +445,6 @@ BOOST_AUTO_TEST_CASE(CommandSlowResponse) } catch(t2n_transfer_error &e) { errormsg=e.what(); } - catch(...) - { throw; } BOOST_CHECK_EQUAL(string("timeout exceeded"),errormsg); } @@ -530,8 +500,6 @@ BOOST_AUTO_TEST_CASE(DisconnectOnWrite) } catch(t2n_transfer_error &e) { errormsg=e.what(); } - catch(...) - { throw; } BOOST_CHECK_EQUAL(string("write() returned Broken pipe"),errormsg); } @@ -593,8 +561,6 @@ BOOST_AUTO_TEST_CASE(WriteTwice) } catch(t2n_transfer_error &e) { errormsg=e.what(); } - catch(...) - { throw; } BOOST_CHECK_EQUAL(string("write() returned Broken pipe"),errormsg); }