]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-12-store.c
tdb2: rework transaction.c internal functions to return enum TDB_ERROR.
[ccan] / ccan / tdb2 / test / run-12-store.c
index fd53a92b9fedceec23ac6f548c3606193fdd40e2..dc32d91cde5a6d918527ca8a71fa562878b57cf8 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 "logging.h"
 
@@ -49,8 +50,11 @@ int main(int argc, char *argv[])
                /* We seemed to lose some keys.
                 * Insert and check they're in there! */
                for (j = 0; j < 500; j++) {
+                       struct tdb_data d;
                        ok1(tdb_store(tdb, key, data, TDB_REPLACE) == 0);
-                       ok1(equal(tdb_fetch(tdb, key), data));
+                       d = tdb_fetch(tdb, key);
+                       ok1(equal(d, data));
+                       free(d.dptr);
                }
                tdb_close(tdb);
        }