summaryrefslogtreecommitdiff
path: root/lib/tdb2/test
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:25:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:25:13 +0930
commite9fe56cdf3285295642db09b70b673d865551b4a (patch)
treebc00886b2db21d69584acab4056d0be0ff8940a5 /lib/tdb2/test
parent9660546a18cc9af508e6e594349d869bdcefafb2 (diff)
downloadsamba-e9fe56cdf3285295642db09b70b673d865551b4a.tar.gz
samba-e9fe56cdf3285295642db09b70b673d865551b4a.tar.bz2
samba-e9fe56cdf3285295642db09b70b673d865551b4a.zip
tdb2: Remove unused tdb1 functions.
We're going to use TDB2's API, so some TDB1 APIs are obviously unnecessary. We also get rid of USE_RIGHT_MERGES and TRACE code. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit b929638e3cfe629285af3ecd0813e03eaeaa1133)
Diffstat (limited to 'lib/tdb2/test')
-rw-r--r--lib/tdb2/test/run-tdb1-incompatible.c2
-rw-r--r--lib/tdb2/test/run-tdb1-nested-traverse.c10
-rw-r--r--lib/tdb2/test/run-tdb1-rwlock-check.c2
-rw-r--r--lib/tdb2/test/run-tdb1-traverse-in-transaction.c10
-rw-r--r--lib/tdb2/test/run-tdb1-wronghash-fail.c2
-rw-r--r--lib/tdb2/test/tdb1-external-agent.c2
-rw-r--r--lib/tdb2/test/tdb2-source.h1
7 files changed, 14 insertions, 15 deletions
diff --git a/lib/tdb2/test/run-tdb1-incompatible.c b/lib/tdb2/test/run-tdb1-incompatible.c
index ed3181a9b5..5a4a61af33 100644
--- a/lib/tdb2/test/run-tdb1-incompatible.c
+++ b/lib/tdb2/test/run-tdb1-incompatible.c
@@ -10,7 +10,7 @@ static unsigned int tdb1_dumb_hash(TDB1_DATA *key)
static void log_fn(struct tdb1_context *tdb, enum tdb1_debug_level level, const char *fmt, ...)
{
- unsigned int *count = tdb1_get_logging_private(tdb);
+ unsigned int *count = tdb->log.log_private;
if (strstr(fmt, "hash"))
(*count)++;
}
diff --git a/lib/tdb2/test/run-tdb1-nested-traverse.c b/lib/tdb2/test/run-tdb1-nested-traverse.c
index b6f6ac63d9..9a17b56019 100644
--- a/lib/tdb2/test/run-tdb1-nested-traverse.c
+++ b/lib/tdb2/test/run-tdb1-nested-traverse.c
@@ -36,12 +36,12 @@ static int traverse1(struct tdb1_context *tdb, TDB1_DATA key, TDB1_DATA data,
{
ok1(correct_key(key));
ok1(correct_data(data));
- ok1(external_agent_operation1(agent, TRANSACTION_START, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
== WOULD_HAVE_BLOCKED);
tdb1_traverse(tdb, traverse2, NULL);
/* That should *not* release the transaction lock! */
- ok1(external_agent_operation1(agent, TRANSACTION_START, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
== WOULD_HAVE_BLOCKED);
return 0;
}
@@ -60,10 +60,10 @@ int main(int argc, char *argv[])
O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
ok1(tdb);
- ok1(external_agent_operation1(agent, OPEN, tdb1_name(tdb)) == SUCCESS);
- ok1(external_agent_operation1(agent, TRANSACTION_START, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, OPEN, tdb->name) == SUCCESS);
+ ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
== SUCCESS);
- ok1(external_agent_operation1(agent, TRANSACTION_COMMIT, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, TRANSACTION_COMMIT, tdb->name)
== SUCCESS);
key.dsize = strlen("hi");
diff --git a/lib/tdb2/test/run-tdb1-rwlock-check.c b/lib/tdb2/test/run-tdb1-rwlock-check.c
index 5d438d3883..f40a6fe13e 100644
--- a/lib/tdb2/test/run-tdb1-rwlock-check.c
+++ b/lib/tdb2/test/run-tdb1-rwlock-check.c
@@ -5,7 +5,7 @@
static void log_fn(struct tdb1_context *tdb, enum tdb1_debug_level level, const char *fmt, ...)
{
- unsigned int *count = tdb1_get_logging_private(tdb);
+ unsigned int *count = tdb->log.log_private;
if (strstr(fmt, "spinlocks"))
(*count)++;
}
diff --git a/lib/tdb2/test/run-tdb1-traverse-in-transaction.c b/lib/tdb2/test/run-tdb1-traverse-in-transaction.c
index eb925be20c..9cb70686fe 100644
--- a/lib/tdb2/test/run-tdb1-traverse-in-transaction.c
+++ b/lib/tdb2/test/run-tdb1-traverse-in-transaction.c
@@ -54,24 +54,24 @@ int main(int argc, char *argv[])
ok1(tdb1_store(tdb, key, data, TDB1_INSERT) == 0);
- ok1(external_agent_operation1(agent, OPEN, tdb1_name(tdb)) == SUCCESS);
+ ok1(external_agent_operation1(agent, OPEN, tdb->name) == SUCCESS);
ok1(tdb1_transaction_start(tdb) == 0);
- ok1(external_agent_operation1(agent, TRANSACTION_START, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
== WOULD_HAVE_BLOCKED);
tdb1_traverse(tdb, traverse, NULL);
/* That should *not* release the transaction lock! */
- ok1(external_agent_operation1(agent, TRANSACTION_START, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
== WOULD_HAVE_BLOCKED);
tdb1_traverse_read(tdb, traverse, NULL);
/* That should *not* release the transaction lock! */
- ok1(external_agent_operation1(agent, TRANSACTION_START, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
== WOULD_HAVE_BLOCKED);
ok1(tdb1_transaction_commit(tdb) == 0);
/* Now we should be fine. */
- ok1(external_agent_operation1(agent, TRANSACTION_START, tdb1_name(tdb))
+ ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
== SUCCESS);
tdb1_close(tdb);
diff --git a/lib/tdb2/test/run-tdb1-wronghash-fail.c b/lib/tdb2/test/run-tdb1-wronghash-fail.c
index 5a7e311a9c..15047677a2 100644
--- a/lib/tdb2/test/run-tdb1-wronghash-fail.c
+++ b/lib/tdb2/test/run-tdb1-wronghash-fail.c
@@ -5,7 +5,7 @@
static void log_fn(struct tdb1_context *tdb, enum tdb1_debug_level level, const char *fmt, ...)
{
- unsigned int *count = tdb1_get_logging_private(tdb);
+ unsigned int *count = tdb->log.log_private;
if (strstr(fmt, "hash"))
(*count)++;
}
diff --git a/lib/tdb2/test/tdb1-external-agent.c b/lib/tdb2/test/tdb1-external-agent.c
index 3f73ae3aaf..da9d709468 100644
--- a/lib/tdb2/test/tdb1-external-agent.c
+++ b/lib/tdb2/test/tdb1-external-agent.c
@@ -36,7 +36,7 @@ static enum agent_return do_operation(enum operation op, const char *name)
switch (op) {
case OPEN:
if (tdb) {
- diag("Already have tdb %s open", tdb1_name(tdb));
+ diag("Already have tdb %s open", tdb->name);
return OTHER_FAILURE;
}
tdb = tdb1_open_ex(name, 0, TDB1_DEFAULT, O_RDWR, 0,
diff --git a/lib/tdb2/test/tdb2-source.h b/lib/tdb2/test/tdb2-source.h
index f289aeb009..28ab35135c 100644
--- a/lib/tdb2/test/tdb2-source.h
+++ b/lib/tdb2/test/tdb2-source.h
@@ -10,7 +10,6 @@
#include <ccan/tdb2/transaction.c>
#include <ccan/tdb2/traverse.c>
#include <ccan/tdb2/tdb1_check.c>
-#include <ccan/tdb2/tdb1_error.c>
#include <ccan/tdb2/tdb1_freelist.c>
#include <ccan/tdb2/tdb1_hash.c>
#include <ccan/tdb2/tdb1_io.c>