# HG changeset patch # User Mike Becker # Date 1445864985 -3600 # Node ID fa8b745be7b5ced8971ea88e926874b732e87994 # Parent c766c423dee69e531d69d2adc30aee735685cd0a added important test case to sstrsplit and fixed bug with consecutively occurring delimiters + fixed build system not linking test binary with newest library build diff -r c766c423dee6 -r fa8b745be7b5 Makefile --- a/Makefile Thu Oct 22 11:35:40 2015 +0200 +++ b/Makefile Mon Oct 26 14:09:45 2015 +0100 @@ -49,16 +49,16 @@ ucx-debug: FORCE cd ucx; $(MAKE) CONF=$(CONF) debug -test: FORCE ucx +test: ucx cd test; $(MAKE) CONF=$(CONF) -test-debug: FORCE ucx-debug +test-debug: ucx-debug cd test; $(MAKE) CONF=$(CONF) debug -run: FORCE test +run: test ./build/release/test/ucxtest$(APP_EXT) -run-debug: FORCE test-debug +run-debug: test-debug ./build/debug/test/ucxtest$(APP_EXT) debug: ucx-debug test-debug diff -r c766c423dee6 -r fa8b745be7b5 test/Makefile --- a/test/Makefile Thu Oct 22 11:35:40 2015 +0200 +++ b/test/Makefile Mon Oct 26 14:09:45 2015 +0100 @@ -47,7 +47,7 @@ all: ../build/release/test ../build/release/test/ucxtest$(APP_EXT) debug: ../build/debug/test ../build/debug/test/ucxtest$(APP_EXT) -../build/release/test/ucxtest$(APP_EXT): $(OBJ) +../build/release/test/ucxtest$(APP_EXT): FORCE $(OBJ) $(LD) $(LDFLAGS) -o ../build/release/test/ucxtest$(APP_EXT) \ $(OBJ) ../build/release/libucx$(LIB_EXT) @@ -57,7 +57,7 @@ ../build/release/test: $(MKDIR) $(MKDIRFLAGS) ../build/release/test -../build/debug/test/ucxtest$(APP_EXT): $(OBJ_D) +../build/debug/test/ucxtest$(APP_EXT): FORCE $(OBJ_D) $(LD) $(LDFLAGS) -o ../build/debug/test/ucxtest$(APP_EXT) \ $(OBJ_D) ../build/debug/libucx$(LIB_EXT) @@ -66,3 +66,7 @@ ../build/debug/test: $(MKDIR) $(MKDIRFLAGS) ../build/debug/test + +# force rebuild of test binary (library might have been changed) +FORCE: + diff -r c766c423dee6 -r fa8b745be7b5 test/string_tests.c --- a/test/string_tests.c Thu Oct 22 11:35:40 2015 +0200 +++ b/test/string_tests.c Mon Oct 26 14:09:45 2015 +0100 @@ -293,6 +293,19 @@ free(list[i].ptr); } free(list); + + /* double encounter delimiter (ded) */ + n = 0; + list = sstrsplit(test, S("is,"), &n); + UCX_TEST_ASSERT(n == 3, "ded, list length must be 3"); + UCX_TEST_ASSERT(strcmp(list[0].ptr, "th") == 0, "ded, item 0 mismatch"); + UCX_TEST_ASSERT(list[1].length == 0, "ded, item 1 not empty!"); + UCX_TEST_ASSERT(strcmp(list[2].ptr, "a,csv,string") == 0, + "ded, item 2 mismatch"); + for(int i=0;i