libt2n: (gerd) make sure no exception is thrown in command_client constructor, fix...
[libt2n] / test / cmdgroup.cpp
index 32f8c6d..314e28d 100644 (file)
@@ -167,19 +167,23 @@ class test_cmdgroup : public TestFixture
 
     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 GroupOk()
     {
-        pid_t pid;
-
-        switch(pid=fork())
+        switch(child_pid=fork())
         {
             case -1:
             {
@@ -220,9 +224,7 @@ class test_cmdgroup : public TestFixture
 
     void WrongGroup()
     {
-        pid_t pid;
-
-        switch(pid=fork())
+        switch(child_pid=fork())
         {
             case -1:
             {