#include <ccan/tdb2/tdb.c>
+#include <ccan/tdb2/open.c>
#include <ccan/tdb2/free.c>
#include <ccan/tdb2/lock.c>
#include <ccan/tdb2/io.c>
if (tdb_store(tdb, key, data, TDB_REPLACE) != 0)
return false;
tdb_fetch(tdb, key, &d);
- if (d.dsize != data.dsize)
- return false;
- if (memcmp(d.dptr, data.dptr, d.dsize) != 0)
+ if (!tdb_deq(d, data))
return false;
free(d.dptr);
}
/* Check mixed bitpattern. */
test_val(tdb, 0x123456789ABCDEF0ULL);
- ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0);
+ ok1(!tdb->file || (tdb->file->allrecord_lock.count == 0
+ && tdb->file->num_lockrecs == 0));
tdb_close(tdb);
/* Deleting these entries in the db gave problems. */