CPPUNIT_TEST_SUITE_END();
+ pid_t child_pid;
+
public:
void setUp()
- {
-}
+ { }
void tearDown()
- { }
+ {
+ // make sure the server-child is dead before the next test runs
+ kill(child_pid,SIGKILL);
+ sleep(1);
+ }
void SimpleCmd()
{
- pid_t pid;
-
- switch(pid=fork())
+ switch(child_pid=fork())
{
case -1:
{
sleep(1);
socket_client_connection sc("./socket");
sc.set_logging(&cerr,debug);
- command_client cc(sc);
+ command_client cc(&sc);
result_container rc;
cc.send_command(new testfunc_cmd("hello"),rc);
void SimpleException()
{
- pid_t pid;
-
- switch(pid=fork())
+ switch(child_pid=fork())
{
case -1:
{
sleep(1);
socket_client_connection sc("./socket");
sc.set_logging(&cerr,debug);
- command_client cc(sc);
+ command_client cc(&sc);
result_container rc;
cc.send_command(new testfunc_cmd("throw"),rc);
void BigReturn()
{
- pid_t pid;
-
- switch(pid=fork())
+ switch(child_pid=fork())
{
case -1:
{
// wait till server is up
sleep(1);
socket_client_connection sc("./socket");
- command_client cc(sc);
+ command_client cc(&sc);
result_container rc;
cc.send_command(new testfunc_cmd("big"),rc);
void BigParameter()
{
- pid_t pid;
-
- switch(pid=fork())
+ switch(child_pid=fork())
{
case -1:
{
socket_server ss("./socket");
command_server cs(ss);
- // max 10 sec
- for (int i=0; i < 10; i++)
+ // max 60 sec - we need atleast 28 handle calls to transfer the buffer
+ for (int i=0; i < 60; i++) {
cs.handle(1000000);
+ }
// don't call atexit and stuff
_exit(0);
// wait till server is up
sleep(1);
socket_client_connection sc("./socket");
- command_client cc(sc);
+ command_client cc(&sc);
result_container rc;
cc.send_command(new testfunc_cmd(string().insert(0,100*1024,'y')),rc);