intl/icu/source/tools/ctestfw/unicode/testlog.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /********************************************************************
     2  * COPYRIGHT: 
     3  * Copyright (c) 2004-2010, International Business Machines Corporation and
     4  * others. All Rights Reserved.
     5  ********************************************************************/
     7 /* Created by grhoten 03/17/2004 */
     9 /* Base class for data driven tests */
    11 #ifndef U_TESTFW_TESTLOG
    12 #define U_TESTFW_TESTLOG
    14 #include "unicode/errorcode.h"
    15 #include "unicode/unistr.h"
    16 #include "unicode/testtype.h"
    18 /** Facilitates internal logging of data driven test service 
    19  *  It would be interesting to develop this into a full      
    20  *  fledged control system as in Java.                       
    21  */
    22 class T_CTEST_EXPORT_API TestLog {
    23 public:
    24     virtual ~TestLog();
    25     virtual void errln( const UnicodeString &message ) = 0;
    26     virtual void logln( const UnicodeString &message ) = 0;
    27     virtual void dataerrln( const UnicodeString &message ) = 0;
    28     virtual const char* getTestDataPath(UErrorCode& err) = 0;
    29 };
    31 class T_CTEST_EXPORT_API IcuTestErrorCode : public ErrorCode {
    32 public:
    33     IcuTestErrorCode(TestLog &callingTestClass, const char *callingTestName) :
    34         testClass(callingTestClass), testName(callingTestName) {}
    35     virtual ~IcuTestErrorCode();
    36     // Returns TRUE if isFailure().
    37     UBool logIfFailureAndReset(const char *fmt, ...);
    38     UBool logDataIfFailureAndReset(const char *fmt, ...);
    39 protected:
    40     virtual void handleFailure() const;
    41 private:
    42     TestLog &testClass;
    43     const char *const testName;
    44 };
    46 #endif

mercurial