]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-21-parse_record.c
tdb2: Make tdb1 share tdb_store flags, struct tdb_data and TDB_MAGIC_FOOD.
[ccan] / ccan / tdb2 / test / run-21-parse_record.c
index b6601d0108bbff98b7578c1c2888385ae1dfd28f..6f95ff70ac2118be5497b425743b0571c120b161 100644 (file)
@@ -1,19 +1,10 @@
-#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>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
 #include <ccan/tap/tap.h>
 #include "logging.h"
 
 static enum TDB_ERROR parse(TDB_DATA key, TDB_DATA data, TDB_DATA *expected)
 {
-       if (data.dsize != expected->dsize)
-               return TDB_ERR_EINVAL;
-       if (memcmp(data.dptr, expected->dptr, data.dsize) != 0)
+       if (!tdb_deq(data, *expected))
                return TDB_ERR_EINVAL;
        return TDB_SUCCESS;
 }