]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-record-expand.c
tdb2: test: fix run-57-die-during-transaction.c to be more efficient.
[ccan] / ccan / tdb2 / test / run-record-expand.c
index 809b8d7730b20beec5b3f0970f395adaef936c42..2cde873956398f80b23069bf27334ce086b06d8e 100644 (file)
@@ -1,9 +1,4 @@
-#include <ccan/tdb2/tdb.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 "tdb2-source.h"
 #include <ccan/tap/tap.h>
 #include "logging.h"
 
@@ -16,8 +11,13 @@ int main(int argc, char *argv[])
        struct tdb_context *tdb;
        int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP,
                        TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT, 
-                       TDB_NOMMAP|TDB_CONVERT };
-       struct tdb_data key = { (unsigned char *)"key", 3 };
+                       TDB_NOMMAP|TDB_CONVERT,
+                       TDB_INTERNAL|TDB_VERSION1, TDB_VERSION1,
+                       TDB_NOMMAP|TDB_VERSION1,
+                       TDB_INTERNAL|TDB_CONVERT|TDB_VERSION1,
+                       TDB_CONVERT|TDB_VERSION1,
+                       TDB_NOMMAP|TDB_CONVERT|TDB_VERSION1 };
+       struct tdb_data key = tdb_mkdata("key", 3);
        struct tdb_data data;
 
        data.dptr = malloc(MAX_SIZE);
@@ -45,5 +45,7 @@ int main(int argc, char *argv[])
                tdb_close(tdb);
        }
        ok1(tap_log_messages == 0);
+       free(data.dptr);
+
        return exit_status();
 }