]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/logging.h
tdb2: more tests, hash collision fixes, attribute support.
[ccan] / ccan / tdb2 / test / logging.h
index c7a5f112a26d1b0bad99ea706e8122bf7fd94dc2..510cfb88562024cf20cdd3f3c7431056e586619c 100644 (file)
@@ -1,10 +1,21 @@
 #ifndef TDB2_TEST_LOGGING_H
 #define TDB2_TEST_LOGGING_H
 #include <ccan/tdb2/tdb2.h>
-unsigned tap_log_messages;
+#include <stdbool.h>
+#include <string.h>
+
+extern unsigned tap_log_messages;
+
+extern union tdb_attribute tap_log_attr;
 
 void tap_log_fn(struct tdb_context *tdb,
                enum tdb_debug_level level, void *priv,
                const char *fmt, ...);
 
+static inline bool data_equal(struct tdb_data a, struct tdb_data b)
+{
+       if (a.dsize != b.dsize)
+               return false;
+       return memcmp(a.dptr, b.dptr, a.dsize) == 0;
+}
 #endif /* TDB2_TEST_LOGGING_H */