X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Ftdb2%2Ftest%2Frun-tdb1-readonly-check.c;h=762c576f9228a68462cca4c6afdb055c0b9b0027;hb=a446f1d4d161d66bbb19ba2551cf6429a4865964;hp=6bfa0dc3f5ad4ac434c88c24c5c4b56532094a71;hpb=919937354a331bb964564a11b5a5b80403ff8db9;p=ccan diff --git a/ccan/tdb2/test/run-tdb1-readonly-check.c b/ccan/tdb2/test/run-tdb1-readonly-check.c index 6bfa0dc3..762c576f 100644 --- a/ccan/tdb2/test/run-tdb1-readonly-check.c +++ b/ccan/tdb2/test/run-tdb1-readonly-check.c @@ -4,17 +4,17 @@ #include #include #include -#include "tdb1-logging.h" +#include "logging.h" int main(int argc, char *argv[]) { - struct tdb1_context *tdb; - TDB1_DATA key, data; + struct tdb_context *tdb; + TDB_DATA key, data; plan_tests(11); - tdb = tdb1_open_ex("run-readonly-check.tdb", 1024, - TDB1_DEFAULT, - O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL); + tdb = tdb1_open("run-readonly-check.tdb", 1024, + TDB_DEFAULT, + O_CREAT|O_TRUNC|O_RDWR, 0600, &tap_log_attr); ok1(tdb); key.dsize = strlen("hi"); @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) data.dsize = strlen("world"); data.dptr = (void *)"world"; - ok1(tdb1_store(tdb, key, data, TDB1_INSERT) == 0); + ok1(tdb1_store(tdb, key, data, TDB_INSERT) == 0); ok1(tdb1_check(tdb, NULL, NULL) == 0); /* We are also allowed to do a check inside a transaction. */ @@ -30,11 +30,11 @@ int main(int argc, char *argv[]) ok1(tdb1_check(tdb, NULL, NULL) == 0); ok1(tdb1_close(tdb) == 0); - tdb = tdb1_open_ex("run-readonly-check.tdb", 1024, - TDB1_DEFAULT, O_RDONLY, 0, &taplogctx, NULL); + tdb = tdb1_open("run-readonly-check.tdb", 1024, + TDB_DEFAULT, O_RDONLY, 0, &tap_log_attr); ok1(tdb); - ok1(tdb1_store(tdb, key, data, TDB1_MODIFY) == -1); + ok1(tdb1_store(tdb, key, data, TDB_MODIFY) == -1); ok1(tdb_error(tdb) == TDB_ERR_RDONLY); ok1(tdb1_check(tdb, NULL, NULL) == 0); ok1(tdb1_close(tdb) == 0);