2 #include <ccan/failtest/failtest_override.h>
3 #include "ntdb-source.h"
4 #include "tap-interface.h"
5 #include <ccan/failtest/failtest.h>
7 #include "failtest_helper.h"
9 int main(int argc
, char *argv
[])
12 struct ntdb_context
*ntdb
;
13 int flags
[] = { NTDB_INTERNAL
,
14 NTDB_INTERNAL
|NTDB_CONVERT
,
16 NTDB_DATA key
= ntdb_mkdata("key", 3);
17 NTDB_DATA data
= ntdb_mkdata("data", 4);
19 failtest_init(argc
, argv
);
20 failtest_hook
= block_repeat_failures
;
21 failtest_exit_check
= exit_check_log
;
23 failtest_suppress
= true;
24 plan_tests(sizeof(flags
) / sizeof(flags
[0]) * 3 + 1);
25 for (i
= 0; i
< sizeof(flags
) / sizeof(flags
[0]); i
++) {
26 ntdb
= ntdb_open("run-12-check.ntdb", flags
[i
]|MAYBE_NOSYNC
,
27 O_RDWR
|O_CREAT
|O_TRUNC
, 0600, &tap_log_attr
);
29 ok1(ntdb_store(ntdb
, key
, data
, NTDB_INSERT
) == 0);
31 /* This is what we really want to test: ntdb_check(). */
32 failtest_suppress
= false;
33 if (!ok1(ntdb_check(ntdb
, NULL
, NULL
) == 0))
35 failtest_suppress
= true;
39 ok1(tap_log_messages
== 0);
40 failtest_exit(exit_status());
43 failtest_suppress
= true;
45 failtest_exit(exit_status());