/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2006, International Business Machines Corporation and
+ * Copyright (c) 1997-2007, 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"
+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 TestPosixClasses();
+ void TestFreezable();
+
+ void TestSpan();
+
+ void TestStringSpan();
+
private:
UBool toPatternAux(UChar32 start, UChar32 end);
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;
+
public:
static UnicodeString escape(const UnicodeString& s);
};