From b9f38d5dd6045219ffe999de772e84fcfb2cb9f9 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 11 May 2004 20:23:54 +0000 Subject: [PATCH] ICU-2487 Fix this test error message to be more informative X-SVN-Rev: 15254 --- icu4c/source/test/cintltst/hpmufn.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/icu4c/source/test/cintltst/hpmufn.c b/icu4c/source/test/cintltst/hpmufn.c index cd0802e6fdf..7f56d0a9598 100644 --- a/icu4c/source/test/cintltst/hpmufn.c +++ b/icu4c/source/test/cintltst/hpmufn.c @@ -42,16 +42,18 @@ addHeapMutexTest(TestNode** root) addTest(root, &TestIncDecFunctions, "tsutil/hpmufn/TestIncDecFunctions"); } +static int32_t gMutexFailures = 0; #define TEST_STATUS(status, expected) \ if (status != expected) { \ log_err("FAIL at %s:%d. Actual status = \"%s\"; Expected status = \"%s\"\n", \ -__FILE__, __LINE__, u_errorName(status), u_errorName(expected)); } + __FILE__, __LINE__, u_errorName(status), u_errorName(expected)); gMutexFailures++; } #define TEST_ASSERT(expr) \ if (!(expr)) { \ log_err("FAILED Assertion \"" #expr "\" at %s:%d.\n", __FILE__, __LINE__); \ + gMutexFailures++; \ } @@ -270,6 +272,8 @@ static void TestMutexFunctions() { const void *traceContext; int32_t traceLevel; + gMutexFailures = 0; + /* Save initial ICU state so that it can be restored later. * u_cleanup(), which is called in this test, resets ICU's state. */ @@ -350,6 +354,11 @@ static void TestMutexFunctions() { ures_close(rb); free(icuDataDir); + + if(gMutexFailures) { + log_info("Note: these failures may be caused by ICU failing to initialize/uninitialize properly.\n"); + log_verbose("Check for prior tests which may not have closed all open resources.\n"); + } }