X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Fhello.cpp;h=a7a885dc9d5b75e7326ec45a2c965fca82418d23;hp=d53a3126d166f5c8ffb973bdf7968e74ea8a4963;hb=a63e08b83794273da3840e0b8bf15bf0085fe3c4;hpb=307b5e74c506b609d5c407be0943f45255ab5122 diff --git a/test/hello.cpp b/test/hello.cpp index d53a312..a7a885d 100644 --- a/test/hello.cpp +++ b/test/hello.cpp @@ -42,50 +42,13 @@ 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; -// 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); } -}; - -class test_helloFixture : public KillChildOnShutdownFixture -{ -protected: - void send_hello(string hello_string, socket_server* ss, int conn_id) - { - server_connection *sc=ss->get_connection(conn_id); - sc->write(hello_string); - } - - void send_raw_socket(string hello_string, socket_server* ss, int conn_id) - { - socket_server_connection *ssc=dynamic_cast(ss->get_connection(conn_id)); - - // this is an evil hack to get access to real_write, don't ever do this in an app!!! - real_write_connection *rwc=(real_write_connection*)ssc; - rwc->real_write(hello_string); - } - -public: - test_helloFixture() - { - } - - ~test_helloFixture() - { - } -}; -BOOST_FIXTURE_TEST_SUITE(test_hello, test_helloFixture) +BOOST_FIXTURE_TEST_SUITE(test_hello, KillChildOnShutdownFixture) BOOST_AUTO_TEST_CASE(HelloOk) {