X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-firstkey-nextkey.c;h=d07745f9f0a1d7a0799daa14f8ddb9d39d18e22c;hp=222d1b539b305636b0cea0680130485cba050373;hb=5eaf46e9a0d38c371b50d5dd3a433fc721c1c4dc;hpb=bee60dd0ffe0b1b5821061b4384000c4246f2051 diff --git a/ccan/tdb2/test/run-firstkey-nextkey.c b/ccan/tdb2/test/run-firstkey-nextkey.c index 222d1b53..d07745f9 100644 --- a/ccan/tdb2/test/run-firstkey-nextkey.c +++ b/ccan/tdb2/test/run-firstkey-nextkey.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "logging.h" @@ -44,15 +45,21 @@ int main(int argc, char *argv[]) struct trav_data td; TDB_DATA k, k2; struct tdb_context *tdb; + union tdb_attribute seed_attr; + int flags[] = { TDB_INTERNAL, TDB_DEFAULT, TDB_NOMMAP, TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT, TDB_NOMMAP|TDB_CONVERT }; + seed_attr.base.attr = TDB_ATTRIBUTE_SEED; + seed_attr.base.next = &tap_log_attr; + seed_attr.seed.seed = 6334326220117065685ULL; + plan_tests(sizeof(flags) / sizeof(flags[0]) * (NUM_RECORDS*4 + (NUM_RECORDS-1)*2 + 20) + 1); for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) { tdb = tdb_open("run-traverse.tdb", flags[i], - O_RDWR|O_CREAT|O_TRUNC, 0600, &tap_log_attr); + O_RDWR|O_CREAT|O_TRUNC, 0600, &seed_attr); ok1(tdb); if (!tdb) continue; @@ -119,7 +126,7 @@ int main(int argc, char *argv[]) k = k2; } - /* But arbitary orderings should work too. */ + /* But arbitrary orderings should work too. */ for (j = td.calls-1; j > 0; j--) { k.dptr = (unsigned char *)&td.records[j-1]; k.dsize = sizeof(td.records[j-1]);