X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Flogging.h;h=85b417d355282106ca5dca306521f180d1879481;hb=a0ac303da08672d4cfe5629b794b2651e1e98399;hp=c7a5f112a26d1b0bad99ea706e8122bf7fd94dc2;hpb=06e0037d97f5e1d83667ec40627cef862f3b7b85;p=ccan diff --git a/ccan/tdb2/test/logging.h b/ccan/tdb2/test/logging.h index c7a5f112..85b417d3 100644 --- a/ccan/tdb2/test/logging.h +++ b/ccan/tdb2/test/logging.h @@ -1,10 +1,22 @@ #ifndef TDB2_TEST_LOGGING_H #define TDB2_TEST_LOGGING_H #include -unsigned tap_log_messages; +#include +#include + +extern bool suppress_logging; +extern const char *log_prefix; +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 */