From 10606b7e3bdad19a60953dbad9e1d541a1a3b805 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:53:13 +0930 Subject: tdb2: unify tdb1_delete into tdb_delete. Switch on the TDB_VERSION1 flag. Signed-off-by: Rusty Russell (Imported from CCAN commit acb26c9c3ee054c8b2141db25c9bd7be064e425c) --- lib/tdb2/test/run-tdb1-3G-file.c | 2 +- lib/tdb2/test/run-tdb1-incompatible.c | 4 ++-- lib/tdb2/test/run-tdb1-nested-transactions.c | 4 ++-- lib/tdb2/test/run-tdb1-no-lock-during-traverse.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/tdb2/test') diff --git a/lib/tdb2/test/run-tdb1-3G-file.c b/lib/tdb2/test/run-tdb1-3G-file.c index 5e0e64e815..116c655438 100644 --- a/lib/tdb2/test/run-tdb1-3G-file.c +++ b/lib/tdb2/test/run-tdb1-3G-file.c @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) ok1(tdb1_traverse(tdb, test_traverse, &orig_data) == 1); /* Delete should work. */ - ok1(tdb1_delete(tdb, key) == 0); + ok1(tdb_delete(tdb, key) == TDB_SUCCESS); ok1(tdb1_traverse(tdb, test_traverse, NULL) == 0); diff --git a/lib/tdb2/test/run-tdb1-incompatible.c b/lib/tdb2/test/run-tdb1-incompatible.c index d2e07107aa..e6b2994e20 100644 --- a/lib/tdb2/test/run-tdb1-incompatible.c +++ b/lib/tdb2/test/run-tdb1-incompatible.c @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) O_RDWR, 0600, &jhash_attr); ok1(tdb); ok1(log_count == 0); - ok1(tdb1_fetch(tdb, d, &d) == TDB_SUCCESS); + ok1(tdb_fetch(tdb, d, &d) == TDB_SUCCESS); ok1(d.dsize == 5); free(d.dptr); ok1(tdb1_check(tdb, NULL, NULL) == 0); @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) &dumbhash_attr); ok1(tdb); ok1(log_count == 0); - ok1(tdb1_fetch(tdb, d, &d) == TDB_SUCCESS); + ok1(tdb_fetch(tdb, d, &d) == TDB_SUCCESS); ok1(d.dsize == 5); free(d.dptr); ok1(tdb1_check(tdb, NULL, NULL) == 0); diff --git a/lib/tdb2/test/run-tdb1-nested-transactions.c b/lib/tdb2/test/run-tdb1-nested-transactions.c index 89e47d3fbf..645b4bc147 100644 --- a/lib/tdb2/test/run-tdb1-nested-transactions.c +++ b/lib/tdb2/test/run-tdb1-nested-transactions.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) ok1(tdb1_transaction_start(tdb) == 0); ok1(tdb1_transaction_start(tdb) == 0); - ok1(tdb1_delete(tdb, key) == 0); + ok1(tdb_delete(tdb, key) == TDB_SUCCESS); ok1(tdb1_transaction_commit(tdb) == 0); ok1(!tdb1_exists(tdb, key)); ok1(tdb1_transaction_cancel(tdb) == 0); @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) ok1(tdb1_transaction_start(tdb) == 0); ok1(tdb1_transaction_start(tdb) == 0); - ok1(tdb1_delete(tdb, key) == 0); + ok1(tdb_delete(tdb, key) == TDB_SUCCESS); ok1(tdb1_transaction_commit(tdb) == 0); ok1(!tdb1_exists(tdb, key)); ok1(tdb1_transaction_commit(tdb) == 0); diff --git a/lib/tdb2/test/run-tdb1-no-lock-during-traverse.c b/lib/tdb2/test/run-tdb1-no-lock-during-traverse.c index 94c125dcad..383b74cb87 100644 --- a/lib/tdb2/test/run-tdb1-no-lock-during-traverse.c +++ b/lib/tdb2/test/run-tdb1-no-lock-during-traverse.c @@ -40,7 +40,7 @@ static void delete_entries(struct tdb_context *tdb) key.dsize = sizeof(i); key.dptr = (void *)&i; - ok1(tdb1_delete(tdb, key) == 0); + ok1(tdb_delete(tdb, key) == TDB_SUCCESS); } } @@ -52,7 +52,7 @@ static int delete_other(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, memcpy(&i, key.dptr, 4); i = (i + 1) % NUM_ENTRIES; key.dptr = (void *)&i; - if (tdb1_delete(tdb, key) != 0) + if (tdb_delete(tdb, key) != TDB_SUCCESS) (*(int *)private_data)++; return 0; } @@ -60,7 +60,7 @@ static int delete_other(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, static int delete_self(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *private_data) { - ok1(tdb1_delete(tdb, key) == 0); + ok1(tdb_delete(tdb, key) == TDB_SUCCESS); return 0; } -- cgit