X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-03-coalesce.c;fp=ccan%2Ftdb2%2Ftest%2Frun-03-coalesce.c;h=cecd7eb2c250359db9c0dd8727e340cc8b6dbdac;hb=6b999f4511e8458bd79eddc2951ab91511d23fa8;hp=0b544f8c1f758f286b0e7a5fd90862e7e47d94a8;hpb=48241893712414cf3d3992a7dbe3d119925559ff;p=ccan diff --git a/ccan/tdb2/test/run-03-coalesce.c b/ccan/tdb2/test/run-03-coalesce.c index 0b544f8c..cecd7eb2 100644 --- a/ccan/tdb2/test/run-03-coalesce.c +++ b/ccan/tdb2/test/run-03-coalesce.c @@ -91,7 +91,8 @@ int main(int argc, char *argv[]) b_off = bucket_off(tdb->ftable_off, size_to_bucket(1024)); /* Lock and coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); - ok1(coalesce(tdb, layout->elem[1].base.off, b_off, 1024) == 1); + ok1(coalesce(tdb, layout->elem[1].base.off, b_off, 1024) + == 1024 + sizeof(struct tdb_used_record) + 2048); ok1(tdb->file->allrecord_lock.count == 0 && tdb->file->num_lockrecs == 0); ok1(free_record_length(tdb, layout->elem[1].base.off) == 1024 + sizeof(struct tdb_used_record) + 2048); @@ -114,7 +115,8 @@ int main(int argc, char *argv[]) b_off = bucket_off(tdb->ftable_off, size_to_bucket(1024)); /* Lock and coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); - ok1(coalesce(tdb, layout->elem[1].base.off, b_off, 1024) == 1); + ok1(coalesce(tdb, layout->elem[1].base.off, b_off, 1024) + == 1024 + sizeof(struct tdb_used_record) + 512); ok1(tdb->file->allrecord_lock.count == 0 && tdb->file->num_lockrecs == 0); ok1(free_record_length(tdb, layout->elem[1].base.off) == 1024 + sizeof(struct tdb_used_record) + 512); @@ -138,7 +140,9 @@ int main(int argc, char *argv[]) b_off = bucket_off(tdb->ftable_off, size_to_bucket(1024)); /* Lock and coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); - ok1(coalesce(tdb, layout->elem[1].base.off, b_off, 1024) == 1); + ok1(coalesce(tdb, layout->elem[1].base.off, b_off, 1024) == + 1024 + sizeof(struct tdb_used_record) + 512 + + sizeof(struct tdb_used_record) + 256); ok1(tdb->file->allrecord_lock.count == 0 && tdb->file->num_lockrecs == 0); ok1(free_record_length(tdb, layout->elem[1].base.off)