X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-record-expand.c;h=2cde873956398f80b23069bf27334ce086b06d8e;hp=53befc1d06fb4628dab04a5892cb43f589c1b5aa;hb=d9cbd7d4454ae35e4e2f6d18a9469bf26948e4b9;hpb=cb399d268c839dd75a59678268f3ba666147cc20 diff --git a/ccan/tdb2/test/run-record-expand.c b/ccan/tdb2/test/run-record-expand.c index 53befc1d..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); @@ -24,9 +26,8 @@ int main(int argc, char *argv[]) plan_tests(sizeof(flags) / sizeof(flags[0]) * (3 + (1 + (MAX_SIZE/SIZE_STEP)) * 2) + 1); for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) { - tdb = tdb_open("/tmp/run-new_database.tdb", flags[i], - O_RDWR|O_CREAT|O_TRUNC, 0600, NULL); - tdb->log = tap_log_fn; + tdb = tdb_open("run-record-expand.tdb", flags[i], + 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(); }