tdb2: unify tdb1_traverse into tdb_traverse
[ccan] / ccan / tdb2 / test / run-tdb1-no-lock-during-traverse.c
index 383b74cb87d59965b5ec194aa6cedac8a6a01c6d..71404c2d7507077fb32d382d27f8e9315a6d2190 100644 (file)
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
        hsize.base.next = &tap_log_attr;
        hsize.tdb1_hashsize.hsize = 1024;
 
-       plan_tests(41);
+       plan_tests(43);
        tdb = tdb_open("run-no-lock-during-traverse.tdb1",
                       TDB_VERSION1, O_CREAT|O_TRUNC|O_RDWR,
                       0600, &hsize);
@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
        ok1(locking_errors1 == 0);
        ok1(tdb1_lockall(tdb) == 0);
        ok1(locking_errors1 == 0);
-       tdb1_traverse(tdb, delete_other, &errors);
+       ok1(tdb_traverse(tdb, delete_other, &errors) >= 0);
        ok1(errors == 0);
        ok1(locking_errors1 == 0);
        ok1(tdb1_unlockall(tdb) == 0);
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
        ok1(locking_errors1 == 0);
        ok1(tdb1_lockall(tdb) == 0);
        ok1(locking_errors1 == 0);
-       tdb1_traverse(tdb, delete_self, NULL);
+       ok1(tdb_traverse(tdb, delete_self, NULL) == NUM_ENTRIES);
        ok1(locking_errors1 == 0);
        ok1(tdb1_unlockall(tdb) == 0);