+// © 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.
********************************************************************
**********************************************************************
#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();
void TestAPI(void);
- void TestStrings(void);
+ void TestIteration(void);
- void TestStringPatterns(void);
+ void TestStrings(void);
void TestScriptSet(void);
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);
* 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);
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<uint16_t, 16> serializeBuffer;
+
public:
static UnicodeString escape(const UnicodeString& s);
};