]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-57-die-during-transaction.c
tdb2: test: import tdb1's tests.
[ccan] / ccan / tdb2 / test / run-57-die-during-transaction.c
index 54dcdca66b5e771899acb1ae33a6f403e543afe8..e622395537afb8b85429fd7894ea5bb5021389d3 100644 (file)
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <ccan/tdb2/private.h>
 #include <unistd.h>
 #include "lock-tracking.h"
 #include <ccan/tap/tap.h>
@@ -58,14 +58,8 @@ static void free_all(void)
 #define malloc malloc_noleak
 #define free free_noleak
 
-#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"
+
 #undef malloc
 #undef free
 #undef write
@@ -208,8 +202,7 @@ reset:
        }
 
        /* Put key for agent to fetch. */
-       key.dsize = strlen(KEY_STRING);
-       key.dptr = (void *)KEY_STRING;
+       key = tdb_mkdata(KEY_STRING, strlen(KEY_STRING));
        if (tdb_store(tdb, key, key, TDB_INSERT) != 0)
                return false;