Linux fixes
authorteodor <teodor>
Sun, 6 Feb 2005 14:17:27 +0000 (14:17 +0000)
committerteodor <teodor>
Sun, 6 Feb 2005 14:17:27 +0000 (14:17 +0000)
Makefile
expected/hex
hextest.c
tbtree.c

index 8fbb763..25796a9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ test: all
        @[ -d results ] || mkdir results  
        @[ -d diffs ] || mkdir diffs  
        @[ -d temp ] || mkdir temp  
-       @for FILE in `ls  tests/* | sed -e 's#^tests/##'` ; do \
+       @for FILE in btree flatdb hex inf psort sfxmem ; do \
                echo -n $$FILE "        ........ " ; \
                if sh tests/$$FILE > results/$$FILE 2>results/$$FILE.errout && diff -c expected/$$FILE results/$$FILE > diffs/$$FILE ; then \
                        echo ok ; \
index bb4edf7..3333cd2 100644 (file)
@@ -1,20 +1,20 @@
-ORIG:846930886 ORIGHEX:327b23c6        xtostr:327B23C6 atox(xtostr):846930886
-ORIG:1714636915        ORIGHEX:66334873        xtostr:66334873 atox(xtostr):1714636915
-ORIG:424238335 ORIGHEX:19495cff        xtostr:19495CFF atox(xtostr):424238335
-ORIG:16807     ORIGHEX:41a7    xtostr:41A7     atox(xtostr):16807
-ORIG:282475249 ORIGHEX:10d63af1        xtostr:10D63AF1 atox(xtostr):282475249
-ORIG:1189641421        ORIGHEX:46e87ccd        xtostr:46E87CCD atox(xtostr):1189641421
-ORIG:1622650073        ORIGHEX:60b7acd9        xtostr:60B7ACD9 atox(xtostr):1622650073
-ORIG:783368690 ORIGHEX:2eb141f2        xtostr:2EB141F2 atox(xtostr):783368690
-ORIG:2044897763        ORIGHEX:79e2a9e3        xtostr:79E2A9E3 atox(xtostr):2044897763
-ORIG:984943658 ORIGHEX:3ab50c2a        xtostr:3AB50C2A atox(xtostr):984943658
-ORIG:1144108930        ORIGHEX:4431b782        xtostr:4431B782 atox(xtostr):1144108930
-ORIG:470211272 ORIGHEX:1c06dac8        xtostr:1C06DAC8 atox(xtostr):470211272
-ORIG:101027544 ORIGHEX:6058ed8 xtostr:6058ED8  atox(xtostr):101027544
-ORIG:1457850878        ORIGHEX:56e509fe        xtostr:56E509FE atox(xtostr):1457850878
-ORIG:521595368 ORIGHEX:1f16e9e8        xtostr:1F16E9E8 atox(xtostr):521595368
-ORIG:1726956429        ORIGHEX:66ef438d        xtostr:66EF438D atox(xtostr):1726956429
-ORIG:1458777923        ORIGHEX:56f32f43        xtostr:56F32F43 atox(xtostr):1458777923
-ORIG:2007237709        ORIGHEX:77a4044d        xtostr:77A4044D atox(xtostr):2007237709
-ORIG:823564440 ORIGHEX:31169898        xtostr:31169898 atox(xtostr):823564440
-ORIG:2145174067        ORIGHEX:7fdcc233        xtostr:7FDCC233 atox(xtostr):2145174067
+Iteration 0: ok
+Iteration 1: ok
+Iteration 2: ok
+Iteration 3: ok
+Iteration 4: ok
+Iteration 5: ok
+Iteration 6: ok
+Iteration 7: ok
+Iteration 8: ok
+Iteration 9: ok
+Iteration 10: ok
+Iteration 11: ok
+Iteration 12: ok
+Iteration 13: ok
+Iteration 14: ok
+Iteration 15: ok
+Iteration 16: ok
+Iteration 17: ok
+Iteration 18: ok
+Iteration 19: ok
index 6003a5b..77f9fe3 100644 (file)
--- a/hextest.c
+++ b/hextest.c
@@ -44,10 +44,12 @@ main(int argn, char *argv[]) {
                u_int32_t orig = (u_int32_t) ( (random()%2) ? random() : rand() );
                u_int32_t new = atox( xtostr(orig) );
                char buf[10];
-               printf("ORIG:%d\tORIGHEX:%x\txtostr:%s\tatox(xtostr):%d\n", orig, orig, xtostr(orig), new);
+               if ( argn>1 )
+                       printf("ORIG:%d\tORIGHEX:%x\txtostr:%s\tatox(xtostr):%d\n", orig, orig, xtostr(orig), new);
                tassert( orig==new );
                sprintf(buf,"%x", orig);
                tassert( strcmp(buf, strlower(xtostr(orig)))==0 );
+               printf("Iteration %d: ok\n", i);
        }
        
        return 0;
index f4ef453..1d0999a 100644 (file)
--- a/tbtree.c
+++ b/tbtree.c
@@ -35,6 +35,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
+#include <sys/time.h>
 
 #include "tmalloc.h"
 #include "tlog.h"