summaryrefslogtreecommitdiff
path: root/lib/tdb2/test/run-001-fls.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-06-18 22:30:26 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-19 05:38:06 +0200
commit16cc345d4f84367e70e133200f7aa335c2aae8c6 (patch)
tree955a33c25c19f3127e24ba6b0e108da6b1f7f804 /lib/tdb2/test/run-001-fls.c
parent76758b9767fad45ff144bbfef3ab84bca5d4650e (diff)
downloadsamba-16cc345d4f84367e70e133200f7aa335c2aae8c6.tar.gz
samba-16cc345d4f84367e70e133200f7aa335c2aae8c6.tar.bz2
samba-16cc345d4f84367e70e133200f7aa335c2aae8c6.zip
TDB2: Goodbye TDB2, Hello NTDB.
This renames everything from tdb2 to ntdb: importantly, we no longer use the tdb_ namespace, so you can link against both ntdb and tdb if you want to. This also enables building of standalone ntdb by the autobuild script. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb2/test/run-001-fls.c')
-rw-r--r--lib/tdb2/test/run-001-fls.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/tdb2/test/run-001-fls.c b/lib/tdb2/test/run-001-fls.c
deleted file mode 100644
index 792adbf655..0000000000
--- a/lib/tdb2/test/run-001-fls.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "tdb2-source.h"
-#include "tap-interface.h"
-
-static unsigned int dumb_fls(uint64_t num)
-{
- int i;
-
- for (i = 63; i >= 0; i--) {
- if (num & (1ULL << i))
- break;
- }
- return i + 1;
-}
-
-int main(int argc, char *argv[])
-{
- unsigned int i, j;
-
- plan_tests(64 * 64 + 2);
-
- ok1(fls64(0) == 0);
- ok1(dumb_fls(0) == 0);
-
- for (i = 0; i < 64; i++) {
- for (j = 0; j < 64; j++) {
- uint64_t val = (1ULL << i) | (1ULL << j);
- ok(fls64(val) == dumb_fls(val),
- "%llu -> %u should be %u", (long long)val,
- fls64(val), dumb_fls(val));
- }
- }
- return exit_status();
-}