X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-record-expand.c;h=2cde873956398f80b23069bf27334ce086b06d8e;hp=918833d9037f239a70f2b9c85fe3c072d87a55f6;hb=d9cbd7d4454ae35e4e2f6d18a9469bf26948e4b9;hpb=b3804e47471640f1f8c15f5013a78bdbeb12f69d diff --git a/ccan/tdb2/test/run-record-expand.c b/ccan/tdb2/test/run-record-expand.c index 918833d9..2cde8739 100644 --- a/ccan/tdb2/test/run-record-expand.c +++ b/ccan/tdb2/test/run-record-expand.c @@ -1,8 +1,4 @@ -#include -#include -#include -#include -#include +#include "tdb2-source.h" #include #include "logging.h" @@ -13,9 +9,15 @@ 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 }; - struct tdb_data key = { (unsigned char *)"key", 3 }; + int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP, + TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT, + 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); @@ -25,8 +27,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; @@ -44,5 +45,7 @@ int main(int argc, char *argv[]) tdb_close(tdb); } ok1(tap_log_messages == 0); + free(data.dptr); + return exit_status(); }