librpc: Shorten dcerpc_binding_handle_call a bit
[Samba/gebeck_regimport.git] / lib / tdb / test / run-oldhash.c
blob535336cb473c1a891e081bd23553f1f466a800c7
1 #include "../common/tdb_private.h"
2 #include "../common/io.c"
3 #include "../common/tdb.c"
4 #include "../common/lock.c"
5 #include "../common/freelist.c"
6 #include "../common/traverse.c"
7 #include "../common/transaction.c"
8 #include "../common/error.c"
9 #include "../common/open.c"
10 #include "../common/check.c"
11 #include "../common/hash.c"
12 #include "tap-interface.h"
13 #include <stdlib.h>
14 #include "logging.h"
16 int main(int argc, char *argv[])
18 struct tdb_context *tdb;
20 plan_tests(8);
22 /* Old format (with zeroes in the hash magic fields) should
23 * open with any hash (since we don't know what hash they used). */
24 tdb = tdb_open_ex("test/old-nohash-le.tdb", 0, 0, O_RDWR, 0,
25 &taplogctx, NULL);
26 ok1(tdb);
27 ok1(tdb_check(tdb, NULL, NULL) == 0);
28 tdb_close(tdb);
30 tdb = tdb_open_ex("test/old-nohash-be.tdb", 0, 0, O_RDWR, 0,
31 &taplogctx, NULL);
32 ok1(tdb);
33 ok1(tdb_check(tdb, NULL, NULL) == 0);
34 tdb_close(tdb);
36 tdb = tdb_open_ex("test/old-nohash-le.tdb", 0, 0, O_RDWR, 0,
37 &taplogctx, tdb_jenkins_hash);
38 ok1(tdb);
39 ok1(tdb_check(tdb, NULL, NULL) == 0);
40 tdb_close(tdb);
42 tdb = tdb_open_ex("test/old-nohash-be.tdb", 0, 0, O_RDWR, 0,
43 &taplogctx, tdb_jenkins_hash);
44 ok1(tdb);
45 ok1(tdb_check(tdb, NULL, NULL) == 0);
46 tdb_close(tdb);
48 return exit_status();