X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..151279e3792e85d0417b499c229886b3af724f55:/icuSources/test/intltest/testidna.h diff --git a/icuSources/test/intltest/testidna.h b/icuSources/test/intltest/testidna.h index 3bfe8070..58567df5 100644 --- a/icuSources/test/intltest/testidna.h +++ b/icuSources/test/intltest/testidna.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * - * Copyright (C) 2003, International Business Machines + * Copyright (C) 2003-2006, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -21,18 +21,18 @@ #if !UCONFIG_NO_IDNA && !UCONFIG_NO_TRANSLITERATION -#include "sprpimpl.h" #include "intltest.h" #include "unicode/parseerr.h" +#include "unicode/uidna.h" U_CDECL_BEGIN typedef int32_t -(*TestFunc) ( const UChar *src, int32_t srcLength, +(U_EXPORT2 *TestFunc) ( const UChar *src, int32_t srcLength, UChar *dest, int32_t destCapacity, int32_t options, UParseError *parseError, UErrorCode *status); typedef int32_t -(*CompareFunc) (const UChar *s1, int32_t s1Len, +(U_EXPORT2 *CompareFunc) (const UChar *s1, int32_t s1Len, const UChar *s2, int32_t s2Len, int32_t options, UErrorCode *status); @@ -65,7 +65,9 @@ public: void TestIDNAMonkeyTest(); void TestConformance(); static NamePrepTransform* getInstance(UErrorCode& status); - static NamePrepTransform* prep; + static NamePrepTransform* gPrep; + virtual ~TestIDNA(); + private: void testToASCII(const char* testName, TestFunc func); void testToUnicode(const char* testName, TestFunc func); @@ -74,22 +76,21 @@ private: void testCompare(const char* testName, CompareFunc func); void testChaining(const char* toASCIIName, TestFunc toASCII, const char* toUnicodeName, TestFunc toUnicode); - + void debug(const UChar* src, int32_t srcLength, int32_t options); // main testing functions void testAPI(const UChar *src, const UChar *expected, const char *testName, UBool useSTD3ASCIIRules, UErrorCode expectedStatus, - UBool doCompare, UBool testUnassigned, TestFunc func); + UBool doCompare, UBool testUnassigned, TestFunc func, UBool testSTD3ASCIIRules=TRUE); void testCompare(const UChar* s1, int32_t s1Len, const UChar* s2, int32_t s2Len, const char* testName, CompareFunc func, UBool isEqual); - void testErrorCases(const char* toASCIIName, TestFunc toASCII, - const char* IDNToASCIIName, TestFunc IDNToASCII, + void testErrorCases(const char* IDNToASCIIName, TestFunc IDNToASCII, const char* IDNToUnicodeName, TestFunc IDNToUnicode); - void testChaining(UChar* src,int32_t numIterations,const char* testName, + void testChaining(const UChar* src,int32_t numIterations,const char* testName, UBool useSTD3ASCIIRules, UBool caseInsensitive, TestFunc func); void testRootLabelSeparator(const char* testName, CompareFunc func, @@ -97,6 +98,11 @@ private: const char* IDNToUnicodeName, TestFunc IDNToUnicode); void testCompareReferenceImpl(const UChar* src, int32_t srcLen); + + UnicodeString testCompareReferenceImpl(UnicodeString& src, + TestFunc refIDNA, const char* refIDNAName, + TestFunc uIDNA, const char* uIDNAName, + int32_t options); void testConformance(const char* toASCIIName, TestFunc toASCII, const char* IDNToASCIIName, TestFunc IDNToASCII,