s3:smb2_write: pass fsp->fnum to init_strict_lock_struct()
[Samba/gebeck_regimport.git] / lib / tdb2 / test / run-tdb1-oldhash.c
blob629ff50634f313836e88890fc6b360009321f5a3
1 #include "tdb2-source.h"
2 #include "tap-interface.h"
3 #include <stdlib.h>
4 #include "logging.h"
6 int main(int argc, char *argv[])
8 struct tdb_context *tdb;
9 union tdb_attribute incompat_hash_attr;
11 incompat_hash_attr.base.attr = TDB_ATTRIBUTE_HASH;
12 incompat_hash_attr.base.next = &tap_log_attr;
13 incompat_hash_attr.hash.fn = tdb1_incompatible_hash;
15 plan_tests(8);
17 /* Old format (with zeroes in the hash magic fields) should
18 * open with any hash (since we don't know what hash they used). */
19 tdb = tdb_open("test/old-nohash-le.tdb1", TDB_VERSION1, O_RDWR, 0,
20 &tap_log_attr);
21 ok1(tdb);
22 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);
23 tdb_close(tdb);
25 tdb = tdb_open("test/old-nohash-be.tdb1", TDB_VERSION1, O_RDWR, 0,
26 &tap_log_attr);
27 ok1(tdb);
28 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);
29 tdb_close(tdb);
31 tdb = tdb_open("test/old-nohash-le.tdb1", TDB_VERSION1, O_RDWR, 0,
32 &incompat_hash_attr);
33 ok1(tdb);
34 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);
35 tdb_close(tdb);
37 tdb = tdb_open("test/old-nohash-be.tdb1", TDB_VERSION1, O_RDWR, 0,
38 &incompat_hash_attr);
39 ok1(tdb);
40 ok1(tdb_check(tdb, NULL, NULL) == TDB_SUCCESS);
41 tdb_close(tdb);
43 return exit_status();