X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-01-new_database.c;h=2d1cfc837768e62c2546119e81c4c9c3a9da05c4;hp=75f2da13e1b808026117cf8da99cae45bfcb6569;hb=2b5cb9bd6be4e61870ba7a400d1a9d91c5933371;hpb=1a24a8708494668c07e5c02284bfc2ef3b09603b diff --git a/ccan/tdb2/test/run-01-new_database.c b/ccan/tdb2/test/run-01-new_database.c index 75f2da13..2d1cfc83 100644 --- a/ccan/tdb2/test/run-01-new_database.c +++ b/ccan/tdb2/test/run-01-new_database.c @@ -1,10 +1,15 @@ +#include #include #include #include #include +#include +#include #include #include +#include #include "logging.h" +#include "failtest_helper.h" int main(int argc, char *argv[]) { @@ -14,16 +19,23 @@ int main(int argc, char *argv[]) TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT, TDB_NOMMAP|TDB_CONVERT }; - plan_tests(sizeof(flags) / sizeof(flags[0]) * 2 + 1); + failtest_init(argc, argv); + failtest_hook = block_repeat_failures; + failtest_exit_check = exit_check_log; + plan_tests(sizeof(flags) / sizeof(flags[0]) * 3); for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) { tdb = tdb_open("run-new_database.tdb", flags[i], O_RDWR|O_CREAT|O_TRUNC, 0600, &tap_log_attr); - ok1(tdb); + if (!ok1(tdb)) + failtest_exit(exit_status()); if (tdb) { - ok1(tdb_check(tdb, NULL, NULL) == 0); + bool ok = ok1(tdb_check(tdb, NULL, NULL) == 0); tdb_close(tdb); + if (!ok) + failtest_exit(exit_status()); } + if (!ok1(tap_log_messages == 0)) + break; } - ok1(tap_log_messages == 0); - return exit_status(); + failtest_exit(exit_status()); }