1 #include "tdb2-source.h"
2 #include <ccan/tap/tap.h>
6 static void log_fn(struct tdb_context *tdb, enum tdb_log_level level,
7 enum TDB_ERROR ecode, const char *message, void *priv)
9 unsigned int *count = priv;
10 if (strstr(message, "spinlocks"))
14 /* The code should barf on TDBs created with rwlocks. */
15 int main(int argc, char *argv[])
17 struct tdb_context *tdb;
18 unsigned int log_count;
19 union tdb_attribute log_attr;
21 log_attr.base.attr = TDB_ATTRIBUTE_LOG;
22 log_attr.base.next = NULL;
23 log_attr.log.fn = log_fn;
24 log_attr.log.data = &log_count;
28 /* We should fail to open rwlock-using tdbs of either endian. */
30 tdb = tdb_open("test/rwlock-le.tdb1", TDB_VERSION1, O_RDWR, 0,
36 tdb = tdb_open("test/rwlock-be.tdb1", TDB_VERSION1, O_RDWR, 0,