From fbc2dbbb41e1ed5fe1ca778c24fef81f480a2322 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 24 Sep 2005 03:29:50 +0000 Subject: r10463: consider it an error if tdbtorture produces any log messages (This used to be commit d9ee0e8b59ee52ed1e41865cffe97e32b504e7e7) --- source4/lib/tdb/tools/tdbtorture.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/tdb/tools/tdbtorture.c b/source4/lib/tdb/tools/tdbtorture.c index 591fdab2f7..3fc395ba98 100644 --- a/source4/lib/tdb/tools/tdbtorture.c +++ b/source4/lib/tdb/tools/tdbtorture.c @@ -50,6 +50,7 @@ static struct tdb_context *db; static int in_transaction; +static int log_count; #ifdef PRINTF_ATTRIBUTE static void tdb_log(struct tdb_context *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4); @@ -58,6 +59,8 @@ static void tdb_log(struct tdb_context *tdb, int level, const char *format, ...) { va_list ap; + log_count++; + va_start(ap, format); vfprintf(stdout, format, ap); va_end(ap); @@ -304,7 +307,13 @@ static void usage(void) exit(1); } } - printf("OK\n"); + if (log_count == 0) { + printf("OK\n"); + } + } + + if (log_count != 0) { + exit(1); } return 0; -- cgit