X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-30-exhaust-before-expand.c;h=db391e7e59c4b391358366633eb7f6f76e533db0;hp=ed7c66dde92fff47c314b5c56b4830babd4387eb;hb=0b93bd102aad6b61f1e569fb12aabc6352a1d7cd;hpb=efdf0f2d8f34b4c01c82c558b350ec36c7329b1e diff --git a/ccan/tdb2/test/run-30-exhaust-before-expand.c b/ccan/tdb2/test/run-30-exhaust-before-expand.c index ed7c66dd..db391e7e 100644 --- a/ccan/tdb2/test/run-30-exhaust-before-expand.c +++ b/ccan/tdb2/test/run-30-exhaust-before-expand.c @@ -1,11 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include -#include +#include "tdb2-source.h" #include #include #include "logging.h" @@ -16,7 +9,7 @@ static bool empty_freetable(struct tdb_context *tdb) unsigned int i; /* Now, free table should be completely exhausted in zone 0 */ - if (tdb_read_convert(tdb, tdb->ftable_off, &ftab, sizeof(ftab)) != 0) + if (tdb_read_convert(tdb, tdb->tdb2.ftable_off, &ftab, sizeof(ftab)) != 0) abort(); for (i = 0; i < sizeof(ftab.buckets)/sizeof(ftab.buckets[0]); i++) { @@ -60,9 +53,9 @@ int main(int argc, char *argv[]) ok1(tdb_check(tdb, NULL, NULL) == 0); ok1(!empty_freetable(tdb)); - size = tdb->map_size; + size = tdb->file->map_size; /* Insert minimal-length records until we expand. */ - for (j = 0; tdb->map_size == size; j++) { + for (j = 0; tdb->file->map_size == size; j++) { was_empty = empty_freetable(tdb); if (tdb_store(tdb, k, k, TDB_INSERT) != 0) err(1, "Failed to store record %i", j);