X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..e4f10fab0c078f399c9deef476d9c9b73b47dff8:/icuSources/test/intltest/convtest.h diff --git a/icuSources/test/intltest/convtest.h b/icuSources/test/intltest/convtest.h index 8fbde250..b4f07b54 100644 --- a/icuSources/test/intltest/convtest.h +++ b/icuSources/test/intltest/convtest.h @@ -1,20 +1,20 @@ /* -******************************************************************************* -* -* Copyright (C) 2003-2006, International Business Machines -* Corporation and others. All Rights Reserved. -* -******************************************************************************* -* file name: convtest.h -* encoding: US-ASCII -* tab size: 8 (not used) -* indentation:4 -* -* created on: 2003jul15 -* created by: Markus W. Scherer -* -* Test file for data-driven conversion tests. -*/ + ******************************************************************************* + * + * Copyright (C) 2003-2007, International Business Machines + * Corporation and others. All Rights Reserved. + * + ******************************************************************************* + * file name: convtest.h + * encoding: US-ASCII + * tab size: 8 (not used) + * indentation:4 + * + * created on: 2003jul15 + * created by: Markus W. Scherer + * + * Test file for data-driven conversion tests. + */ #ifndef __CONVTEST_H__ #define __CONVTEST_H__ @@ -27,18 +27,25 @@ #include "intltest.h" struct ConversionCase { + /* setup */ int32_t caseNr; const char *charset, *cbopt, *name; UChar subString[16]; char subchar[8]; int8_t setSub; + /* input and expected output */ const uint8_t *bytes; int32_t bytesLength; const UChar *unicode; int32_t unicodeLength; const int32_t *offsets; + /* UTF-8 version of unicode[unicodeLength] */ + const char *utf8; + int32_t utf8Length; + + /* options */ UBool finalFlush; UBool fallbacks; UErrorCode outErrorCode; @@ -46,6 +53,7 @@ struct ConversionCase { const UChar *invalidUChars; int32_t invalidLength; + /* actual output */ uint8_t resultBytes[200]; UChar resultUnicode[200]; int32_t resultOffsets[200]; @@ -56,7 +64,7 @@ struct ConversionCase { class ConversionTest : public IntlTest { public: - ConversionTest() {} + ConversionTest(); virtual ~ConversionTest(); void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0); @@ -64,6 +72,7 @@ public: void TestToUnicode(); void TestFromUnicode(); void TestGetUnicodeSet(); + void TestGetUnicodeSet2(); private: UBool @@ -86,6 +95,9 @@ private: UConverter * cnv_open(const char *name, UErrorCode &errorCode); + + /* for testing direct UTF-8 conversion */ + UConverter *utf8Cnv; }; #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */