X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-30-exhaust-before-expand.c;h=6ab81f859d1f8affe4e77aa59ca6263c8681e5e9;hb=f5087965ebdb24618ca59854b7a819e21c9fdf78;hp=e2e27295edd48f04ab59c13c98cff1ab4a406e65;hpb=d70577b6aff24ccf6815896509dabb8c9ac07904;p=ccan diff --git a/ccan/tdb2/test/run-30-exhaust-before-expand.c b/ccan/tdb2/test/run-30-exhaust-before-expand.c index e2e27295..6ab81f85 100644 --- a/ccan/tdb2/test/run-30-exhaust-before-expand.c +++ b/ccan/tdb2/test/run-30-exhaust-before-expand.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include "logging.h" @@ -33,7 +34,7 @@ int main(int argc, char *argv[]) TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT, TDB_NOMMAP|TDB_CONVERT }; - plan_tests(sizeof(flags) / sizeof(flags[0]) * 7 + 1); + plan_tests(sizeof(flags) / sizeof(flags[0]) * 9 + 1); for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) { TDB_DATA k; @@ -50,8 +51,11 @@ int main(int argc, char *argv[]) continue; ok1(empty_freelist(tdb)); + /* Need some hash lock for expand. */ + ok1(tdb_lock_hashes(tdb, 0, 1, F_WRLCK, TDB_LOCK_WAIT) == 0); /* Create some free space. */ ok1(tdb_expand(tdb, 1) == 0); + ok1(tdb_unlock_hashes(tdb, 0, 1, F_WRLCK) == 0); ok1(tdb_check(tdb, NULL, NULL) == 0); ok1(!empty_freelist(tdb));