dovecot-2.2: lib-test: flush test-assert failure messages

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 15 11:40:23 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/b5608c537daa
changeset: 18851:b5608c537daa
user:      Phil Carmody <phil at dovecot.fi>
date:      Mon Jun 15 14:31:19 2015 +0300
description:
lib-test: flush test-assert failure messages
Diagnostic output to stderr may overtake these stdout logs if the streams
are combined by the shell or on the console. fflush() might help realign
them.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib-test/test-common.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r 2ab0c5855548 -r b5608c537daa src/lib-test/test-common.c
--- a/src/lib-test/test-common.c	Mon Jun 15 14:25:07 2015 +0300
+++ b/src/lib-test/test-common.c	Mon Jun 15 14:31:19 2015 +0300
@@ -165,12 +165,14 @@
 void test_assert_failed(const char *code, const char *file, unsigned int line)
 {
 	printf("%s:%u: Assert failed: %s\n", file, line, code);
+	fflush(stdout);
 	test_success = FALSE;
 }
 
 void test_assert_failed_idx(const char *code, const char *file, unsigned int line, long long i)
 {
 	printf("%s:%u: Assert(#%lld) failed: %s\n", file, line, i, code);
+	fflush(stdout);
 	test_success = FALSE;
 }
 
@@ -250,6 +252,7 @@
 	if (reason != NULL && *reason != '\0')
 		printf(": %s", reason);
 	putchar('\n');
+	fflush(stdout);
 	total_count++;
 }
 


More information about the dovecot-cvs mailing list