X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-15-append.c;h=e11289e99b8493723f0c4a641b34bd15a2fdd829;hb=74b0109ebd2a30d57d19ae9a56f16c0f3b3637eb;hp=d24816586790ca7de87522ba5051c10a001d3098;hpb=b21004624683be5bf1d8f75e3b5be4e9618049ee;p=ccan diff --git a/ccan/tdb2/test/run-15-append.c b/ccan/tdb2/test/run-15-append.c index d2481658..e11289e9 100644 --- a/ccan/tdb2/test/run-15-append.c +++ b/ccan/tdb2/test/run-15-append.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -68,7 +69,8 @@ int main(int argc, char *argv[]) moves++; oldoff = newoff; } - ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0); + ok1(!tdb->file || (tdb->file->allrecord_lock.count == 0 + && tdb->file->num_lockrecs == 0)); /* We should increase by 50% each time... */ ok(moves <= ilog64(j / SIZE_STEP)*2, "Moved %u times", moves); tdb_close(tdb); @@ -99,7 +101,8 @@ int main(int argc, char *argv[]) moves++; oldoff = newoff; } - ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0); + ok1(!tdb->file || (tdb->file->allrecord_lock.count == 0 + && tdb->file->num_lockrecs == 0)); /* We should increase by 50% each time... */ ok(moves <= ilog64(j / SIZE_STEP)*2, "Moved %u times", moves); tdb_close(tdb); @@ -121,7 +124,8 @@ int main(int argc, char *argv[]) ok1(data.dsize == MAX_SIZE); ok1(memcmp(data.dptr, buffer, data.dsize) == 0); free(data.dptr); - ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0); + ok1(!tdb->file || (tdb->file->allrecord_lock.count == 0 + && tdb->file->num_lockrecs == 0)); tdb_close(tdb); }