libt2n: (gerd) fix client-connection-logic, finish wrappers, all tests are working...
[libt2n] / test / simplecmd.cpp
index eb4343c..42721ea 100644 (file)
@@ -162,7 +162,7 @@ class test_simplecmd : public TestFixture
                 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);
@@ -172,6 +172,7 @@ class test_simplecmd : public TestFixture
                 CPPUNIT_ASSERT_EQUAL(string("hello, testfunc() was here"),ret);
             }
         }
+        kill(pid,SIGKILL);
     }
 
     void SimpleException()
@@ -206,7 +207,7 @@ class test_simplecmd : public TestFixture
                 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);
@@ -223,6 +224,8 @@ class test_simplecmd : public TestFixture
                     { throw; }
 
                 CPPUNIT_ASSERT_EQUAL(string("throw me around"),ret);
+
+                kill(pid,SIGKILL);
             }
         }
     }
@@ -258,7 +261,7 @@ class test_simplecmd : public TestFixture
                 // 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);
@@ -266,6 +269,8 @@ class test_simplecmd : public TestFixture
                 string ret=dynamic_cast<testfunc_res*>(rc.get_result())->get_data();
 
                 CPPUNIT_ASSERT_EQUAL(string().insert(0,100*1024,'x'),ret);
+
+                kill(pid,SIGKILL);
             }
         }
     }
@@ -301,7 +306,7 @@ class test_simplecmd : public TestFixture
                 // 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);
@@ -309,6 +314,8 @@ class test_simplecmd : public TestFixture
                 string ret=dynamic_cast<testfunc_res*>(rc.get_result())->get_data();
 
                 CPPUNIT_ASSERT_EQUAL(string().insert(0,100*1024,'y')+", testfunc() was here",ret);
+
+                kill(pid,SIGKILL);
             }
         }
     }