X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-open-multiple-times.c;h=f49e65d8b62231b1867c1fc21b36cbfba5e05030;hp=1f35648bb192c445da0fe49a455d95ea544991c1;hb=8a47d50d72ea62e378dc92b150c92c1317c73fa3;hpb=bb4d59ee1e914df9f8066e59a9c9a6604e581c40 diff --git a/ccan/tdb2/test/run-open-multiple-times.c b/ccan/tdb2/test/run-open-multiple-times.c index 1f35648b..f49e65d8 100644 --- a/ccan/tdb2/test/run-open-multiple-times.c +++ b/ccan/tdb2/test/run-open-multiple-times.c @@ -1,11 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include -#include +#include "tdb2-source.h" #include #include "logging.h" @@ -34,8 +27,7 @@ int main(int argc, char *argv[]) /* Store in one, fetch in the other. */ ok1(tdb_store(tdb, key, data, TDB_REPLACE) == 0); ok1(tdb_fetch(tdb2, key, &d) == TDB_SUCCESS); - ok1(d.dptr && d.dsize == data.dsize - && memcmp(d.dptr, data.dptr, d.dsize) == 0); + ok1(tdb_deq(d, data)); free(d.dptr); /* Vice versa, with delete. */ @@ -47,8 +39,7 @@ int main(int argc, char *argv[]) ok1(tdb_store(tdb2, key, data, TDB_REPLACE) == 0); ok1(tdb_fetch(tdb2, key, &d) == TDB_SUCCESS); - ok1(d.dptr && d.dsize == data.dsize - && memcmp(d.dptr, data.dptr, d.dsize) == 0); + ok1(tdb_deq(d, data)); free(d.dptr); /* Reopen */ @@ -75,8 +66,7 @@ int main(int argc, char *argv[]) ok1(tdb_close(tdb2) == 0); ok1(tdb_fetch(tdb, key, &d) == TDB_SUCCESS); - ok1(d.dptr && d.dsize == data.dsize - && memcmp(d.dptr, data.dptr, d.dsize) == 0); + ok1(tdb_deq(d, data)); free(d.dptr); ok1(tdb_close(tdb) == 0); ok1(tap_log_messages == 4);