X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Filog%2Ftest%2Frun.c;h=bda59f920a33e115958eeff8b91a6a6a8d2eb966;hb=97648992fdd50535fe276261368c179df993202b;hp=2aeee1ce763a1cf9db59646a8c35f8eaad982cca;hpb=2037a903729fea95d76ad7baa7c1e2cd3ce38f04;p=ccan diff --git a/ccan/ilog/test/run.c b/ccan/ilog/test/run.c index 2aeee1ce..bda59f92 100644 --- a/ccan/ilog/test/run.c +++ b/ccan/ilog/test/run.c @@ -1,7 +1,7 @@ -#include "ilog/ilog.h" -#include "ilog/ilog.c" +#include +#include #include -#include "tap/tap.h" +#include /*Dead simple (but slow) versions to compare against.*/ @@ -20,12 +20,10 @@ static int test_ilog64(uint64_t _v){ #define NTRIALS (64) int main(int _argc,const char *_argv[]){ - int nmatches; int i; int j; /*This is how many tests you plan to run.*/ - plan_tests(2); - nmatches=0; + plan_tests(33 * NTRIALS * 3 + 65 * NTRIALS * 3); for(i=0;i<=32;i++){ uint32_t v; /*Test each bit in turn (and 0).*/ @@ -33,26 +31,15 @@ int main(int _argc,const char *_argv[]){ for(j=0;j>((33-i)>>1)>>((32-i)>>1); } } - ok1(nmatches==3*(32+1)*NTRIALS); - nmatches=0; + for(i=0;i<=64;i++){ uint64_t v; /*Test each bit in turn (and 0).*/ @@ -60,27 +47,14 @@ int main(int _argc,const char *_argv[]){ for(j=0;j>((65-i)>>1)>>((64-i)>>1)); } } - ok1(nmatches==3*(64+1)*NTRIALS); return exit_status(); }