#include "test_fixtures.hxx"
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
using namespace std;
using namespace libt2n;
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)
{
usleep(200000);
}
}
-
-public:
- test_timeoutFixture()
- {
- }
-
- ~test_timeoutFixture()
- {
- }
};
BOOST_FIXTURE_TEST_SUITE(test_timeout, test_timeoutFixture)
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("timeout exceeded"),errormsg);
}
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("timeout exceeded"),errormsg);
}
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("write() returned Broken pipe"),errormsg);
}
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("write() returned Broken pipe"),errormsg);
}