]> git.ozlabs.org Git - ccan/blob - ccan/tdb2/test/logging.h
tdb2: tdb_append implemented, beef up tests.
[ccan] / ccan / tdb2 / test / logging.h
1 #ifndef TDB2_TEST_LOGGING_H
2 #define TDB2_TEST_LOGGING_H
3 #include <ccan/tdb2/tdb2.h>
4 #include <stdbool.h>
5 #include <string.h>
6
7 extern unsigned tap_log_messages;
8
9 extern union tdb_attribute tap_log_attr;
10
11 void tap_log_fn(struct tdb_context *tdb,
12                 enum tdb_debug_level level, void *priv,
13                 const char *fmt, ...);
14
15 static inline bool data_equal(struct tdb_data a, struct tdb_data b)
16 {
17         if (a.dsize != b.dsize)
18                 return false;
19         return memcmp(a.dptr, b.dptr, a.dsize) == 0;
20 }
21 #endif /* TDB2_TEST_LOGGING_H */