]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-13-delete.c
tdb2: tdb_deq: inline helper for comparing two struct tdb_data
[ccan] / ccan / tdb2 / test / run-13-delete.c
index 3eaeee7a29b1ff8e3f707da522d4c6ed7ca29319..aba6fe29448c3fb3fb53d7acf3bad8ef40fc7ca4 100644 (file)
@@ -33,9 +33,7 @@ static bool store_records(struct tdb_context *tdb)
                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);
        }