1 #include "tdb2-source.h"
2 #include <ccan/tap/tap.h>
7 int main(int argc, char *argv[])
9 struct tdb_context *tdb;
10 union tdb_attribute incompat_hash_attr;
12 incompat_hash_attr.base.attr = TDB_ATTRIBUTE_HASH;
13 incompat_hash_attr.base.next = &tap_log_attr;
14 incompat_hash_attr.hash.fn = tdb1_incompatible_hash;
18 /* Old format (with zeroes in the hash magic fields) should
19 * open with any hash (since we don't know what hash they used). */
20 tdb = tdb_open("test/old-nohash-le.tdb1", TDB_VERSION1, O_RDWR, 0,
23 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);
26 tdb = tdb_open("test/old-nohash-be.tdb1", TDB_VERSION1, O_RDWR, 0,
29 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);
32 tdb = tdb_open("test/old-nohash-le.tdb1", TDB_VERSION1, O_RDWR, 0,
35 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);
38 tdb = tdb_open("test/old-nohash-be.tdb1", TDB_VERSION1, O_RDWR, 0,
41 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);