]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-record-expand.c
tdb2: add write flag to tdb_direct
[ccan] / ccan / tdb2 / test / run-record-expand.c
index 918833d9037f239a70f2b9c85fe3c072d87a55f6..27d58ff36ab4d35cb955f5cec516728031052e68 100644 (file)
@@ -2,7 +2,9 @@
 #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 <ccan/tap/tap.h>
 #include "logging.h"
 
@@ -13,8 +15,9 @@ int main(int argc, char *argv[])
 {
        unsigned int i;
        struct tdb_context *tdb;
-       int flags[] = { TDB_INTERNAL, TDB_DEFAULT,
-                       TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT };
+       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 };
        struct tdb_data data;
 
@@ -25,8 +28,7 @@ int main(int argc, char *argv[])
                   * (3 + (1 + (MAX_SIZE/SIZE_STEP)) * 2) + 1);
        for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) {
                tdb = tdb_open("run-record-expand.tdb", flags[i],
-                              O_RDWR|O_CREAT|O_TRUNC, 0600, NULL);
-               tdb->log = tap_log_fn;
+                              O_RDWR|O_CREAT|O_TRUNC, 0600, &tap_log_attr);
                ok1(tdb);
                if (!tdb)
                        continue;