summaryrefslogtreecommitdiff
path: root/sds.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-01-19 13:38:47 +0100
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-01-19 13:41:31 +0100
commit5962a2de17b274a9313e87f33fbc7ba17d1dbd83 (patch)
tree0a04b9df99cc19537c0bacddea2ac25c2f837376 /sds.c
parent7aa5fa102eec898c5768342d93858650ce5563b8 (diff)
Add testhelp.h inline in sds.c
Diffstat (limited to 'sds.c')
-rw-r--r--sds.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sds.c b/sds.c
index 4b0b254..f05b107 100644
--- a/sds.c
+++ b/sds.c
@@ -502,7 +502,20 @@ err:
#ifdef SDS_TEST_MAIN
#include <stdio.h>
-#include "testhelp.h"
+
+int __failed_tests = 0;
+int __test_num = 0;
+#define test_cond(descr,_c) do { \
+ __test_num++; printf("%d - %s: ", __test_num, descr); \
+ if(_c) printf("PASSED\n"); else {printf("FAILED\n"); __failed_tests++;} \
+} while(0);
+#define test_report() do { \
+ printf("%d tests, %d passed, %d failed\n", __test_num, \
+ __test_num-__failed_tests, __failed_tests); \
+ if (__failed_tests) { \
+ printf("=== WARNING === We have failed tests here...\n"); \
+ } \
+} while(0);
int main(void) {
{