dovecot: Added test_out_reason()

dovecot at dovecot.org dovecot at dovecot.org
Sat Dec 29 04:15:01 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/3fe934d0843a
changeset: 7047:3fe934d0843a
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Dec 29 01:02:28 2007 +0200
description:
Added test_out_reason()

diffstat:

2 files changed, 11 insertions(+), 2 deletions(-)
src/tests/test-common.c |   12 ++++++++++--
src/tests/test-common.h |    1 +

diffs (43 lines):

diff -r e74a1d1dca07 -r 3fe934d0843a src/tests/test-common.c
--- a/src/tests/test-common.c	Fri Dec 28 20:04:43 2007 +0200
+++ b/src/tests/test-common.c	Sat Dec 29 01:02:28 2007 +0200
@@ -39,6 +39,11 @@ void test_istream_set_size(struct istrea
 
 void test_out(const char *name, bool success)
 {
+	test_out_reason(name, success, NULL);
+}
+
+void test_out_reason(const char *name, bool success, const char *reason)
+{
 	int i;
 
 	fputs(name, stdout);
@@ -47,11 +52,14 @@ void test_out(const char *name, bool suc
 		putchar('.');
 	fputs(" : ", stdout);
 	if (success)
-		puts("ok");
+		fputs("ok", stdout);
 	else {
-		puts("FAILED");
+		fputs("FAILED", stdout);
 		failure_count++;
 	}
+	if (reason != NULL && *reason != '\0')
+		printf(": %s", reason);
+	putchar('\n');
 	total_count++;
 }
 
diff -r e74a1d1dca07 -r 3fe934d0843a src/tests/test-common.h
--- a/src/tests/test-common.h	Fri Dec 28 20:04:43 2007 +0200
+++ b/src/tests/test-common.h	Sat Dec 29 01:02:28 2007 +0200
@@ -5,6 +5,7 @@ void test_istream_set_size(struct istrea
 void test_istream_set_size(struct istream *input, uoff_t size);
 
 void test_out(const char *name, bool success);
+void test_out_reason(const char *name, bool success, const char *reason);
 
 void test_init(void);
 int test_deinit(void);


More information about the dovecot-cvs mailing list