]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-15-append.c
tdb2: update documentation
[ccan] / ccan / tdb2 / test / run-15-append.c
index 51d4ddef2d3692934a52d25fc2def3e3fb958f40..fe7a24e0eb402767891a7705d58b9c0a0a2113c8 100644 (file)
@@ -4,6 +4,7 @@
 #include <ccan/tdb2/io.c>
 #include <ccan/tdb2/hash.c>
 #include <ccan/tdb2/check.c>
+#include <ccan/tdb2/transaction.c>
 #include <ccan/tap/tap.h>
 #include <ccan/ilog/ilog.h>
 #include "logging.h"
@@ -67,7 +68,7 @@ int main(int argc, char *argv[])
                                moves++;
                        oldoff = newoff;
                }
-               ok1(!tdb_has_locks(tdb));
+               ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0);
                /* We should increase by 50% each time... */
                ok(moves <= ilog64(j / SIZE_STEP)*2, "Moved %u times", moves);
                tdb_close(tdb);
@@ -98,7 +99,7 @@ int main(int argc, char *argv[])
                                moves++;
                        oldoff = newoff;
                }
-               ok1(!tdb_has_locks(tdb));
+               ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0);
                /* We should increase by 50% each time... */
                ok(moves <= ilog64(j / SIZE_STEP)*2, "Moved %u times", moves);
                tdb_close(tdb);
@@ -120,7 +121,7 @@ int main(int argc, char *argv[])
                ok1(data.dsize == MAX_SIZE);
                ok1(memcmp(data.dptr, buffer, data.dsize) == 0);
                free(data.dptr);
-               ok1(!tdb_has_locks(tdb));
+               ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0);
                tdb_close(tdb);
        }