X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-tdb1-corrupt.c;h=f87afd8a6ab7ff210d6963fc4003d98a55145dfd;hp=833e9c1ee1a743ee8f7d63ebdbe0f59d5a976e90;hb=c8c3b3568677e8b0105f84e4ab068c580faf4591;hpb=a446f1d4d161d66bbb19ba2551cf6429a4865964 diff --git a/ccan/tdb2/test/run-tdb1-corrupt.c b/ccan/tdb2/test/run-tdb1-corrupt.c index 833e9c1e..f87afd8a 100644 --- a/ccan/tdb2/test/run-tdb1-corrupt.c +++ b/ccan/tdb2/test/run-tdb1-corrupt.c @@ -94,25 +94,30 @@ static void check_test(struct tdb_context *tdb) int main(int argc, char *argv[]) { struct tdb_context *tdb; + union tdb_attribute hsize; + + hsize.base.attr = TDB_ATTRIBUTE_TDB1_HASHSIZE; + hsize.base.next = &tap_log_attr; + hsize.tdb1_hashsize.hsize = 2; plan_tests(4); /* This should use mmap. */ - tdb = tdb1_open("run-corrupt.tdb", 2, TDB_DEFAULT, - O_CREAT|O_TRUNC|O_RDWR, 0600, &tap_log_attr); + tdb = tdb_open("run-corrupt.tdb1", TDB_VERSION1, + O_CREAT|O_TRUNC|O_RDWR, 0600, &hsize); if (!tdb) abort(); check_test(tdb); - tdb1_close(tdb); + tdb_close(tdb); /* This should not. */ - tdb = tdb1_open("run-corrupt.tdb", 2, TDB_NOMMAP, - O_CREAT|O_TRUNC|O_RDWR, 0600, &tap_log_attr); + tdb = tdb_open("run-corrupt.tdb1", TDB_VERSION1|TDB_NOMMAP, + O_CREAT|O_TRUNC|O_RDWR, 0600, &hsize); if (!tdb) abort(); check_test(tdb); - tdb1_close(tdb); + tdb_close(tdb); return exit_status(); }