From c1633486ae67bac7b37536a5caa9c5e5eaa75472 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Fri, 13 May 2016 01:26:12 +0000 Subject: [PATCH] ICU-12537 RBBI monkey test, improve error checking in test setup. X-SVN-Rev: 38736 --- icu4c/source/test/intltest/rbbimonkeytest.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/icu4c/source/test/intltest/rbbimonkeytest.cpp b/icu4c/source/test/intltest/rbbimonkeytest.cpp index 90246aac223..9c662c949c5 100644 --- a/icu4c/source/test/intltest/rbbimonkeytest.cpp +++ b/icu4c/source/test/intltest/rbbimonkeytest.cpp @@ -904,22 +904,27 @@ void RBBIMonkeyTest::testMonkey() { for (i=0; tests[i] != NULL; ++i) { logln("beginning testing of %s", tests[i]); RBBIMonkeyImpl *test = new RBBIMonkeyImpl(status); + if (U_FAILURE(status)) { + errln("%s:%d: error %s while starting test %s.", __FILE__, __LINE__, u_errorName(status), tests[i]); + break; + } test->fDumpExpansions = dumpExpansions; test->fVerbose = verbose; test->fRandomGenerator.seed((uint32_t)seed); test->fLoopCount = loopCount; test->setup(tests[i], status); + if (U_FAILURE(status)) { + errln("%s:%d: error %s while starting test %s.", __FILE__, __LINE__, u_errorName(status), tests[i]); + break; + } test->startTest(); startedTests.addElement(test, status); if (U_FAILURE(status)) { + errln("%s:%d: error %s while starting test %s.", __FILE__, __LINE__, u_errorName(status), tests[i]); break; } } - if (U_FAILURE(status)) { - dataerrln("%s:%d: error %s while starting test %s.", __FILE__, __LINE__, u_errorName(status), tests[i]); - } - for (i=0; i(startedTests.elementAt(i)); test->join(); -- 2.40.0