X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..f59164e3d128c7675a4d3934206346a3384e53a5:/icuSources/tools/ctestfw/unicode/testlog.h diff --git a/icuSources/tools/ctestfw/unicode/testlog.h b/icuSources/tools/ctestfw/unicode/testlog.h index f8544423..6a6e0678 100644 --- a/icuSources/tools/ctestfw/unicode/testlog.h +++ b/icuSources/tools/ctestfw/unicode/testlog.h @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 2004-2008, International Business Machines Corporation and + * Copyright (c) 2004-2010, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -11,6 +11,7 @@ #ifndef U_TESTFW_TESTLOG #define U_TESTFW_TESTLOG +#include "unicode/errorcode.h" #include "unicode/unistr.h" #include "unicode/testtype.h" @@ -22,9 +23,24 @@ class T_CTEST_EXPORT_API TestLog { public: virtual ~TestLog(); virtual void errln( const UnicodeString &message ) = 0; + virtual void logln( const UnicodeString &message ) = 0; virtual void dataerrln( const UnicodeString &message ) = 0; virtual const char* getTestDataPath(UErrorCode& err) = 0; }; +class T_CTEST_EXPORT_API IcuTestErrorCode : public ErrorCode { +public: + IcuTestErrorCode(TestLog &callingTestClass, const char *callingTestName) : + testClass(callingTestClass), testName(callingTestName) {} + virtual ~IcuTestErrorCode(); + // Returns TRUE if isFailure(). + UBool logIfFailureAndReset(const char *fmt, ...); + UBool logDataIfFailureAndReset(const char *fmt, ...); +protected: + virtual void handleFailure() const; +private: + TestLog &testClass; + const char *const testName; +}; #endif