]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-traverse.c
tdb2: clean up logging
[ccan] / ccan / tdb2 / test / run-traverse.c
index 97694a842b2ccd1522d28a8f48fb44f36c1deb8b..e6d102855a34fd68f1c72f497e3c15b3152de514 100644 (file)
@@ -5,6 +5,7 @@
 #include <ccan/tdb2/hash.c>
 #include <ccan/tdb2/check.c>
 #include <ccan/tdb2/traverse.c>
 #include <ccan/tdb2/hash.c>
 #include <ccan/tdb2/check.c>
 #include <ccan/tdb2/traverse.c>
+#include <ccan/tdb2/transaction.c>
 #include <ccan/tap/tap.h>
 #include "logging.h"
 
 #include <ccan/tap/tap.h>
 #include "logging.h"
 
@@ -119,7 +120,7 @@ int main(int argc, char *argv[])
 
        hattr.base.next = &tap_log_attr;
 
 
        hattr.base.next = &tap_log_attr;
 
-       plan_tests(sizeof(flags) / sizeof(flags[0]) * 50 + 1);
+       plan_tests(sizeof(flags) / sizeof(flags[0]) * 53 + 1);
        for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) {
                tdb = tdb_open("run-traverse.tdb", flags[i],
                               O_RDWR|O_CREAT|O_TRUNC, 0600, &hattr);
        for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) {
                tdb = tdb_open("run-traverse.tdb", flags[i],
                               O_RDWR|O_CREAT|O_TRUNC, 0600, &hattr);
@@ -181,6 +182,7 @@ int main(int argc, char *argv[])
                ok1(td.low <= NUM_RECORDS / 2);
                ok1(td.high > NUM_RECORDS / 2);
                ok1(tdb_check(tdb, NULL, NULL) == 0);
                ok1(td.low <= NUM_RECORDS / 2);
                ok1(td.high > NUM_RECORDS / 2);
                ok1(tdb_check(tdb, NULL, NULL) == 0);
+               ok1(tap_log_messages == 0);
 
                /* Growing traverse.  Expect failure on r/o traverse. */
                tgd.calls = 0;
 
                /* Growing traverse.  Expect failure on r/o traverse. */
                tgd.calls = 0;
@@ -192,6 +194,8 @@ int main(int argc, char *argv[])
                ok1(tgd.error == TDB_ERR_RDONLY);
                ok1(tgd.calls == 1);
                ok1(!tgd.mismatch);
                ok1(tgd.error == TDB_ERR_RDONLY);
                ok1(tgd.calls == 1);
                ok1(!tgd.mismatch);
+               ok1(tap_log_messages == 1);
+               tap_log_messages = 0;
                ok1(tdb_check(tdb, NULL, NULL) == 0);
 
                /* Deleting traverse.  Expect failure on r/o traverse. */
                ok1(tdb_check(tdb, NULL, NULL) == 0);
 
                /* Deleting traverse.  Expect failure on r/o traverse. */
@@ -208,6 +212,8 @@ int main(int argc, char *argv[])
                ok1(!td.mismatch);
                ok1(td.calls == 1);
                ok1(td.low == td.high);
                ok1(!td.mismatch);
                ok1(td.calls == 1);
                ok1(td.low == td.high);
+               ok1(tap_log_messages == 1);
+               tap_log_messages = 0;
                ok1(tdb_check(tdb, NULL, NULL) == 0);
 
                /* Deleting traverse (delete everything). */
                ok1(tdb_check(tdb, NULL, NULL) == 0);
 
                /* Deleting traverse (delete everything). */