From 0c28e38d1dd8513427cd5d2490793f0010ab14b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 3 Jan 2010 23:49:17 +0000 Subject: [PATCH] * some more work on unit testing --- libcitadel/tests/run_tests.sh | 26 ++++++++++++++++++++++++++ libcitadel/tests/stringbuf_IO_test.c | 6 ++++-- libcitadel/tests/stringbuf_test.c | 6 +++--- 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100755 libcitadel/tests/run_tests.sh diff --git a/libcitadel/tests/run_tests.sh b/libcitadel/tests/run_tests.sh new file mode 100755 index 000000000..426c3794f --- /dev/null +++ b/libcitadel/tests/run_tests.sh @@ -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 diff --git a/libcitadel/tests/stringbuf_IO_test.c b/libcitadel/tests/stringbuf_IO_test.c index 2606150dd..fea682e01 100644 --- a/libcitadel/tests/stringbuf_IO_test.c +++ b/libcitadel/tests/stringbuf_IO_test.c @@ -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; } } diff --git a/libcitadel/tests/stringbuf_test.c b/libcitadel/tests/stringbuf_test.c index 99fa2ee77..209bc98e5 100644 --- a/libcitadel/tests/stringbuf_test.c +++ b/libcitadel/tests/stringbuf_test.c @@ -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 #include @@ -25,6 +24,7 @@ #include #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(); -- 2.39.2