From bf3ccf4f1b6001e73409ced6bcb0a6584c95f6be Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Fri, 21 Jul 2000 23:28:41 +0000 Subject: [PATCH] ICU-311 attempt to count only real errors, not each printf-style piece of each output line X-SVN-Rev: 2019 --- icu4c/source/tools/ctestfw/ctest.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/icu4c/source/tools/ctestfw/ctest.c b/icu4c/source/tools/ctestfw/ctest.c index 67cd1d5686..fc7626ab84 100644 --- a/icu4c/source/tools/ctestfw/ctest.c +++ b/icu4c/source/tools/ctestfw/ctest.c @@ -357,16 +357,20 @@ const TestNode* getTest(const TestNode* root, const char* name) void log_err(const char* pattern, ...) { va_list ap; + if(strchr(pattern, '\n') != NULL) { + /* + * Count errors only if there is a line feed in the pattern + * so that we do not exaggerate our error count. + */ + ++ERROR_COUNT; + } if( ERR_MSG == FALSE){ - ERROR_COUNT++; return; } va_start(ap, pattern); fprintf(stdout, "%-*s", INDENT_LEVEL," " ); vfprintf(stderr, pattern, ap); va_end(ap); - - ERROR_COUNT++; } void log_info(const char* pattern, ...)