X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/test/intltest/usettest.h?ds=sidebyside diff --git a/icuSources/test/intltest/usettest.h b/icuSources/test/intltest/usettest.h index 04b6ca3d..e79a9e8e 100644 --- a/icuSources/test/intltest/usettest.h +++ b/icuSources/test/intltest/usettest.h @@ -1,7 +1,9 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2003, International Business Machines Corporation and + * Copyright (c) 1997-2015, International Business Machines Corporation and * others. All Rights Reserved. ******************************************************************** ********************************************************************** @@ -16,16 +18,22 @@ #include "unicode/unistr.h" #include "unicode/uniset.h" +#include "unicode/ucnv_err.h" #include "intltest.h" +#include "cmemory.h" + +class UnicodeSetWithStrings; /** * UnicodeSet test */ class UnicodeSetTest: public IntlTest { +public: + UnicodeSetTest(); + ~UnicodeSetTest(); - void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par=NULL); - private: + void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par=NULL); void Testj2268(); @@ -47,9 +55,9 @@ private: void TestAPI(void); - void TestStrings(void); + void TestIteration(void); - void TestStringPatterns(void); + void TestStrings(void); void TestScriptSet(void); @@ -70,6 +78,23 @@ private: void TestInvalidCodePoint(void); + void TestSymbolTable(void); + + void TestSurrogate(); + + void TestPosixClasses(); + + void TestFreezable(); + + void TestSpan(); + + void TestStringSpan(); + + void TestUCAUnsafeBackwards(); + void TestIntOverflow(); + void TestUnusedCcc(); + void TestDeepPattern(); + private: UBool toPatternAux(UChar32 start, UChar32 end); @@ -119,6 +144,8 @@ private: * get the same thing back */ void checkRoundTrip(const UnicodeSet& s); + + void checkSerializeRoundTrip(const UnicodeSet& s, UErrorCode &ec); void copyWithIterator(UnicodeSet& t, const UnicodeSet& s, UBool withRange); @@ -146,6 +173,28 @@ private: const UnicodeSet& set, UChar32 start, UChar32 end); void doAssert(UBool, const char*); + + void testSpan(const UnicodeSetWithStrings *sets[4], const void *s, int32_t length, UBool isUTF16, + uint32_t whichSpans, + int32_t expectLimits[], int32_t &expectCount, + const char *testName, int32_t index); + void testSpan(const UnicodeSetWithStrings *sets[4], const void *s, int32_t length, UBool isUTF16, + uint32_t whichSpans, + const char *testName, int32_t index); + void testSpanBothUTFs(const UnicodeSetWithStrings *sets[4], + const UChar *s16, int32_t length16, + uint32_t whichSpans, + const char *testName, int32_t index); + void testSpanContents(const UnicodeSetWithStrings *sets[4], uint32_t whichSpans, const char *testName); + void testSpanUTF16String(const UnicodeSetWithStrings *sets[4], uint32_t whichSpans, const char *testName); + void testSpanUTF8String(const UnicodeSetWithStrings *sets[4], uint32_t whichSpans, const char *testName); + + UConverter *openUTF8Converter(); + + UConverter *utf8Cnv; + + MaybeStackArray serializeBuffer; + public: static UnicodeString escape(const UnicodeString& s); };