* some more work on unit testing
authorWilfried Göesgens <willi@citadel.org>
Sun, 3 Jan 2010 23:49:17 +0000 (23:49 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 3 Jan 2010 23:49:17 +0000 (23:49 +0000)
libcitadel/tests/run_tests.sh [new file with mode: 0755]
libcitadel/tests/stringbuf_IO_test.c
libcitadel/tests/stringbuf_test.c

diff --git a/libcitadel/tests/run_tests.sh b/libcitadel/tests/run_tests.sh
new file mode 100755 (executable)
index 0000000..426c379
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+
+#./stringbuf_IO_test -p 6666 -i 0.0.0.0 -s 2 -l 50
+
+
+./stringbuf_IO_test -p 6666 -i 0.0.0.0 -s2 -b55    &
+cat posttest_blob.txt |nc 127.0.0.1 6666
+
+./stringbuf_IO_test -p 6666 -i 0.0.0.0 -s2 -b482    &
+cat posttest_headers.txt |nc 127.0.0.1 6666
+
+./stringbuf_IO_test -p 6666 -i 0.0.0.0 -s2 -b537    &
+cat posttest.txt |nc 127.0.0.1 6666
+
+
+./stringbuf_IO_test -p 6666 -i 0.0.0.0 -s2 -n1    &
+cat posttest_blob.txt |nc 127.0.0.1 6666
+
+./stringbuf_IO_test -p 6666 -i 0.0.0.0 -s2 -n13    &
+cat posttest_headers.txt |nc 127.0.0.1 6666
+
+./stringbuf_IO_test -p 6666 -i 0.0.0.0 -s2 -n14    &
+cat posttest.txt |nc 127.0.0.1 6666
+
+posttest.txt
index 2606150dd137390c6a4e7fc24bd74db5a2f6d21b..fea682e01910e2a0660b5f6bc79407190c049ea8 100644 (file)
@@ -453,10 +453,12 @@ int main(int argc, char* argv[])
                        // else run the simple http test
                        break;
                case 't':
-                       timeout = atoi(optarg);
+                       if (optarg != NULL)
+                               timeout = atoi(optarg);
                        break;
                case 's':
-                       selres = atoi(optarg);
+                       if (optarg != NULL)
+                               selres = atoi(optarg);
                        break;
                }
        }
index 99fa2ee77918f1162d1de1a0a9f14690764a9dec..209bc98e503923cb83a7412ac93ba66d2e13f696 100644 (file)
@@ -17,7 +17,6 @@
  *  License along with this library; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define SHOW_ME_VAPPEND_PRINTF
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -25,6 +24,7 @@
 #include <stdarg.h>
 
 #include "stringbuf_test.h"
+#define SHOW_ME_VAPPEND_PRINTF
 #include "../lib/libcitadel.h"
 
 int Quiet = 0;
@@ -585,7 +585,7 @@ Some samples from the original...
 
 
 
-static void AddStrBufSimlpeTests(void)
+static void AddStrBufSimpleTests(void)
 {
        CU_pSuite pGroup = NULL;
        CU_pTest pTest = NULL;
@@ -638,7 +638,7 @@ int main(int argc, char* argv[])
        }
        
        Run = CU_TRUE ;
-       AddStrBufSimlpeTests();
+       AddStrBufSimpleTests();
        
        if (CU_TRUE == Run) {
                //CU_console_run_tests();