From 59b75ef945fc063b6cbfb0bb99500971bd0d94a4 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 13 Jul 2008 09:41:22 +0200 Subject: [PATCH] Libucw: Test for arraysort.h Modified existing benchmark to return 1 as return code on failure. Added a .t file to run from `make tests'. --- lib/Makefile | 3 ++- lib/asort-test.c | 7 ++++++- lib/asort-test.t | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 lib/asort-test.t diff --git a/lib/Makefile b/lib/Makefile index 49b6872f..d838ab5e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -97,7 +97,7 @@ $(o)/lib/trie-test: $(o)/lib/trie-test.o $(LIBUCW) TESTS+=$(addprefix $(o)/lib/,regex.test unicode.test hash-test.test mempool.test stkstring.test \ slists.test kmp-test.test bbuf.test getopt.test fastbuf.test ff-unicode.test eltpool.test \ - fb-socket.test trie-test.test string.test sha1.test) + fb-socket.test trie-test.test string.test sha1.test asort-test.test) $(o)/lib/regex.test: $(o)/lib/regex-t $(o)/lib/unicode.test: $(o)/lib/unicode-t @@ -116,6 +116,7 @@ $(o)/lib/fb-socket.test: $(o)/lib/fb-socket-t $(o)/lib/string.test: $(o)/lib/str-hex-t $(o)/lib/str-esc-t $(o)/lib/sha1.test: $(o)/lib/sha1-t $(o)/lib/sha1-hmac-t $(o)/lib/trie-test.test: $(o)/lib/trie-test +$(o)/lib/asort-test.test: $(o)/lib/asort-test ifdef CONFIG_UCW_THREADS TESTS+=$(addprefix $(o)/lib/,asio.test) diff --git a/lib/asort-test.c b/lib/asort-test.c index 9c6abd47..8662e7a3 100644 --- a/lib/asort-test.c +++ b/lib/asort-test.c @@ -38,12 +38,17 @@ static void generate(void) #endif } +int errors = 0; + static void check(void) { uns i; for (i=0; i