1 #define _XOPEN_SOURCE 500
2 #include <ccan/tdb/tdb.h>
3 #include <ccan/tdb/io.c>
4 #include <ccan/tdb/tdb.c>
5 #include <ccan/tdb/lock.c>
6 #include <ccan/tdb/freelist.c>
7 #include <ccan/tdb/traverse.c>
8 #include <ccan/tdb/transaction.c>
9 #include <ccan/tdb/error.c>
10 #include <ccan/tdb/open.c>
11 #include <ccan/tdb/check.c>
12 #include <ccan/tdb/hash.c>
13 #include <ccan/tap/tap.h>
18 int main(int argc, char *argv[])
20 struct tdb_context *tdb;
24 /* Old format (with zeroes in the hash magic fields) should
25 * open with any hash (since we don't know what hash they used). */
26 tdb = tdb_open_ex("test/old-nohash-le.tdb", 0, 0, O_RDWR, 0,
29 ok1(tdb_check(tdb, NULL, NULL) == 0);
32 tdb = tdb_open_ex("test/old-nohash-be.tdb", 0, 0, O_RDWR, 0,
35 ok1(tdb_check(tdb, NULL, NULL) == 0);
38 tdb = tdb_open_ex("test/old-nohash-le.tdb", 0, 0, O_RDWR, 0,
39 &taplogctx, tdb_jenkins_hash);
41 ok1(tdb_check(tdb, NULL, NULL) == 0);
44 tdb = tdb_open_ex("test/old-nohash-be.tdb", 0, 0, O_RDWR, 0,
45 &taplogctx, tdb_jenkins_hash);
47 ok1(tdb_check(tdb, NULL, NULL) == 0);