1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
4 * Copyright (c) 1997-2016, International Business Machines Corporation and
5 * others. All Rights Reserved.
6 ********************************************************************/
8 #include "unicode/ustring.h"
9 #include "unicode/uchar.h"
10 #include "unicode/uniset.h"
11 #include "unicode/putil.h"
12 #include "unicode/uscript.h"
15 #include "patternprops.h"
16 #include "normalizer2impl.h"
20 static const char *ignorePropNames
[]={
33 UnicodeTest::UnicodeTest()
35 UErrorCode errorCode
=U_ZERO_ERROR
;
36 unknownPropertyNames
=new U_NAMESPACE_QUALIFIER
Hashtable(errorCode
);
37 if(U_FAILURE(errorCode
)) {
38 delete unknownPropertyNames
;
39 unknownPropertyNames
=NULL
;
41 // Ignore some property names altogether.
42 for(int32_t i
=0; i
<UPRV_LENGTHOF(ignorePropNames
); ++i
) {
43 unknownPropertyNames
->puti(UnicodeString(ignorePropNames
[i
], -1, US_INV
), 1, errorCode
);
47 UnicodeTest::~UnicodeTest()
49 delete unknownPropertyNames
;
52 void UnicodeTest::runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* /*par*/ )
55 logln("TestSuite UnicodeTest: ");
58 TESTCASE_AUTO(TestAdditionalProperties
);
59 TESTCASE_AUTO(TestBinaryValues
);
60 TESTCASE_AUTO(TestConsistency
);
61 TESTCASE_AUTO(TestPatternProperties
);
62 TESTCASE_AUTO(TestScriptMetadata
);
63 TESTCASE_AUTO(TestBidiPairedBracketType
);
64 TESTCASE_AUTO(TestEmojiProperties
);
65 TESTCASE_AUTO(TestDefaultScriptExtensions
);
66 TESTCASE_AUTO(TestInvalidCodePointFolding
);
70 //====================================================
71 // private data used by the tests
72 //====================================================
74 // test DerivedCoreProperties.txt -------------------------------------------
76 // copied from genprops.c
78 getTokenIndex(const char *const tokens
[], int32_t countTokens
, const char *s
) {
82 s
=u_skipWhitespace(s
);
83 for(i
=0; i
<countTokens
; ++i
) {
92 z
=u_skipWhitespace(s
+j
);
93 if(*z
==';' || *z
==0) {
105 static const char *const
106 derivedPropsNames
[]={
115 "Default_Ignorable_Code_Point",
116 "Full_Composition_Exclusion",
118 "Grapheme_Link", /* Unicode 5 moves this property here from PropList.txt */
122 "Changes_When_Lowercased",
123 "Changes_When_Uppercased",
124 "Changes_When_Titlecased",
125 "Changes_When_Casefolded",
126 "Changes_When_Casemapped",
127 "Changes_When_NFKC_Casefolded"
130 static const UProperty
131 derivedPropsIndex
[]={
140 UCHAR_DEFAULT_IGNORABLE_CODE_POINT
,
141 UCHAR_FULL_COMPOSITION_EXCLUSION
,
142 UCHAR_GRAPHEME_EXTEND
,
146 UCHAR_CASE_IGNORABLE
,
147 UCHAR_CHANGES_WHEN_LOWERCASED
,
148 UCHAR_CHANGES_WHEN_UPPERCASED
,
149 UCHAR_CHANGES_WHEN_TITLECASED
,
150 UCHAR_CHANGES_WHEN_CASEFOLDED
,
151 UCHAR_CHANGES_WHEN_CASEMAPPED
,
152 UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED
155 static int32_t numErrors
[UPRV_LENGTHOF(derivedPropsIndex
)]={ 0 };
157 enum { MAX_ERRORS
=50 };
159 U_CFUNC
void U_CALLCONV
160 derivedPropsLineFn(void *context
,
161 char *fields
[][2], int32_t /* fieldCount */,
162 UErrorCode
*pErrorCode
)
164 UnicodeTest
*me
=(UnicodeTest
*)context
;
168 u_parseCodePointRange(fields
[0][0], &start
, &end
, pErrorCode
);
169 if(U_FAILURE(*pErrorCode
)) {
170 me
->errln("UnicodeTest: syntax error in DerivedCoreProperties.txt or DerivedNormalizationProps.txt field 0 at %s\n", fields
[0][0]);
174 /* parse derived binary property name, ignore unknown names */
175 i
=getTokenIndex(derivedPropsNames
, UPRV_LENGTHOF(derivedPropsNames
), fields
[1][0]);
177 UnicodeString
propName(fields
[1][0], (int32_t)(fields
[1][1]-fields
[1][0]));
179 if(me
->unknownPropertyNames
->find(propName
)==NULL
) {
180 UErrorCode errorCode
=U_ZERO_ERROR
;
181 me
->unknownPropertyNames
->puti(propName
, 1, errorCode
);
182 me
->errln("UnicodeTest warning: unknown property name '%s' in DerivedCoreProperties.txt or DerivedNormalizationProps.txt\n", fields
[1][0]);
187 me
->derivedProps
[i
].add(start
, end
);
190 void UnicodeTest::TestAdditionalProperties() {
191 #if !UCONFIG_NO_NORMALIZATION
192 // test DerivedCoreProperties.txt and DerivedNormalizationProps.txt
193 if(UPRV_LENGTHOF(derivedProps
)<UPRV_LENGTHOF(derivedPropsNames
)) {
194 errln("error: UnicodeTest::derivedProps[] too short, need at least %d UnicodeSets\n",
195 UPRV_LENGTHOF(derivedPropsNames
));
198 if(UPRV_LENGTHOF(derivedPropsIndex
)!=UPRV_LENGTHOF(derivedPropsNames
)) {
199 errln("error in ucdtest.cpp: UPRV_LENGTHOF(derivedPropsIndex)!=UPRV_LENGTHOF(derivedPropsNames)\n");
204 if(getUnidataPath(path
) == NULL
) {
205 errln("unable to find path to source/data/unidata/");
208 char *basename
=strchr(path
, 0);
209 strcpy(basename
, "DerivedCoreProperties.txt");
212 UErrorCode errorCode
=U_ZERO_ERROR
;
213 u_parseDelimitedFile(path
, ';', fields
, 2, derivedPropsLineFn
, this, &errorCode
);
214 if(U_FAILURE(errorCode
)) {
215 errln("error parsing DerivedCoreProperties.txt: %s\n", u_errorName(errorCode
));
219 strcpy(basename
, "DerivedNormalizationProps.txt");
220 u_parseDelimitedFile(path
, ';', fields
, 2, derivedPropsLineFn
, this, &errorCode
);
221 if(U_FAILURE(errorCode
)) {
222 errln("error parsing DerivedNormalizationProps.txt: %s\n", u_errorName(errorCode
));
226 // now we have all derived core properties in the UnicodeSets
227 // run them all through the API
228 int32_t rangeCount
, range
;
232 // test all TRUE properties
233 for(i
=0; i
<UPRV_LENGTHOF(derivedPropsNames
); ++i
) {
234 rangeCount
=derivedProps
[i
].getRangeCount();
235 for(range
=0; range
<rangeCount
&& numErrors
[i
]<MAX_ERRORS
; ++range
) {
236 start
=derivedProps
[i
].getRangeStart(range
);
237 end
=derivedProps
[i
].getRangeEnd(range
);
238 for(; start
<=end
; ++start
) {
239 if(!u_hasBinaryProperty(start
, derivedPropsIndex
[i
])) {
240 dataerrln("UnicodeTest error: u_hasBinaryProperty(U+%04lx, %s)==FALSE is wrong", start
, derivedPropsNames
[i
]);
241 if(++numErrors
[i
]>=MAX_ERRORS
) {
242 dataerrln("Too many errors, moving to the next test");
250 // invert all properties
251 for(i
=0; i
<UPRV_LENGTHOF(derivedPropsNames
); ++i
) {
252 derivedProps
[i
].complement();
255 // test all FALSE properties
256 for(i
=0; i
<UPRV_LENGTHOF(derivedPropsNames
); ++i
) {
257 rangeCount
=derivedProps
[i
].getRangeCount();
258 for(range
=0; range
<rangeCount
&& numErrors
[i
]<MAX_ERRORS
; ++range
) {
259 start
=derivedProps
[i
].getRangeStart(range
);
260 end
=derivedProps
[i
].getRangeEnd(range
);
261 for(; start
<=end
; ++start
) {
262 if(u_hasBinaryProperty(start
, derivedPropsIndex
[i
])) {
263 errln("UnicodeTest error: u_hasBinaryProperty(U+%04lx, %s)==TRUE is wrong\n", start
, derivedPropsNames
[i
]);
264 if(++numErrors
[i
]>=MAX_ERRORS
) {
265 errln("Too many errors, moving to the next test");
272 #endif /* !UCONFIG_NO_NORMALIZATION */
275 void UnicodeTest::TestBinaryValues() {
277 * Unicode 5.1 explicitly defines binary property value aliases.
278 * Verify that they are all recognized.
280 UErrorCode errorCode
=U_ZERO_ERROR
;
281 UnicodeSet
alpha(UNICODE_STRING_SIMPLE("[:Alphabetic:]"), errorCode
);
282 if(U_FAILURE(errorCode
)) {
283 dataerrln("UnicodeSet([:Alphabetic:]) failed - %s", u_errorName(errorCode
));
287 static const char *const falseValues
[]={ "N", "No", "F", "False" };
288 static const char *const trueValues
[]={ "Y", "Yes", "T", "True" };
290 for(i
=0; i
<UPRV_LENGTHOF(falseValues
); ++i
) {
291 UnicodeString pattern
=UNICODE_STRING_SIMPLE("[:Alphabetic=:]");
292 pattern
.insert(pattern
.length()-2, UnicodeString(falseValues
[i
], -1, US_INV
));
293 errorCode
=U_ZERO_ERROR
;
294 UnicodeSet
set(pattern
, errorCode
);
295 if(U_FAILURE(errorCode
)) {
296 errln("UnicodeSet([:Alphabetic=%s:]) failed - %s\n", falseValues
[i
], u_errorName(errorCode
));
301 errln("UnicodeSet([:Alphabetic=%s:]).complement()!=UnicodeSet([:Alphabetic:])\n", falseValues
[i
]);
304 for(i
=0; i
<UPRV_LENGTHOF(trueValues
); ++i
) {
305 UnicodeString pattern
=UNICODE_STRING_SIMPLE("[:Alphabetic=:]");
306 pattern
.insert(pattern
.length()-2, UnicodeString(trueValues
[i
], -1, US_INV
));
307 errorCode
=U_ZERO_ERROR
;
308 UnicodeSet
set(pattern
, errorCode
);
309 if(U_FAILURE(errorCode
)) {
310 errln("UnicodeSet([:Alphabetic=%s:]) failed - %s\n", trueValues
[i
], u_errorName(errorCode
));
314 errln("UnicodeSet([:Alphabetic=%s:])!=UnicodeSet([:Alphabetic:])\n", trueValues
[i
]);
319 void UnicodeTest::TestConsistency() {
320 #if !UCONFIG_NO_NORMALIZATION
322 * Test for an example that getCanonStartSet() delivers
323 * all characters that compose from the input one,
324 * even in multiple steps.
325 * For example, the set for "I" (0049) should contain both
326 * I-diaeresis (00CF) and I-diaeresis-acute (1E2E).
327 * In general, the set for the middle such character should be a subset
328 * of the set for the first.
330 IcuTestErrorCode
errorCode(*this, "TestConsistency");
331 const Normalizer2
*nfd
=Normalizer2::getNFDInstance(errorCode
);
332 const Normalizer2Impl
*nfcImpl
=Normalizer2Factory::getNFCImpl(errorCode
);
333 if(!nfcImpl
->ensureCanonIterData(errorCode
) || errorCode
.isFailure()) {
334 dataerrln("Normalizer2::getInstance(NFD) or Normalizer2Factory::getNFCImpl() failed - %s\n",
335 errorCode
.errorName());
340 UnicodeSet set1
, set2
;
341 if (nfcImpl
->getCanonStartSet(0x49, set1
)) {
342 /* enumerate all characters that are plausible to be latin letters */
343 for(UChar start
=0xa0; start
<0x2000; ++start
) {
344 UnicodeString decomp
=nfd
->normalize(UnicodeString(start
), errorCode
);
345 if(decomp
.length()>1 && decomp
[0]==0x49) {
351 errln("[canon start set of 0049] != [all c with canon decomp with 0049]");
353 // This was available in cucdtst.c but the test had to move to intltest
354 // because the new internal normalization functions are in C++.
355 //compareUSets(set1, set2,
356 // "[canon start set of 0049]", "[all c with canon decomp with 0049]",
359 errln("NFC.getCanonStartSet() returned FALSE");
365 * Test various implementations of Pattern_Syntax & Pattern_White_Space.
367 void UnicodeTest::TestPatternProperties() {
368 IcuTestErrorCode
errorCode(*this, "TestPatternProperties()");
370 UnicodeSet
syn_prop(UNICODE_STRING_SIMPLE("[:Pattern_Syntax:]"), errorCode
);
372 "[!-/\\:-@\\[-\\^`\\{-~"
373 "\\u00A1-\\u00A7\\u00A9\\u00AB\\u00AC\\u00AE\\u00B0\\u00B1\\u00B6\\u00BB\\u00BF\\u00D7\\u00F7"
374 "\\u2010-\\u2027\\u2030-\\u203E\\u2041-\\u2053\\u2055-\\u205E\\u2190-\\u245F\\u2500-\\u2775"
375 "\\u2794-\\u2BFF\\u2E00-\\u2E7F\\u3001-\\u3003\\u3008-\\u3020\\u3030\\uFD3E\\uFD3F\\uFE45\\uFE46]", errorCode
);
377 UnicodeSet
ws_prop(UNICODE_STRING_SIMPLE("[:Pattern_White_Space:]"), errorCode
);
378 UnicodeSet
ws_list(UNICODE_STRING_SIMPLE("[\\u0009-\\u000D\\ \\u0085\\u200E\\u200F\\u2028\\u2029]"), errorCode
);
379 UnicodeSet syn_ws_pp
;
380 UnicodeSet
syn_ws_prop(syn_prop
);
381 syn_ws_prop
.addAll(ws_prop
);
382 for(UChar32 c
=0; c
<=0xffff; ++c
) {
383 if(PatternProps::isSyntax(c
)) {
386 if(PatternProps::isWhiteSpace(c
)) {
389 if(PatternProps::isSyntaxOrWhiteSpace(c
)) {
393 compareUSets(syn_pp
, syn_prop
,
394 "PatternProps.isSyntax()", "[:Pattern_Syntax:]", TRUE
);
395 compareUSets(syn_pp
, syn_list
,
396 "PatternProps.isSyntax()", "[Pattern_Syntax ranges]", TRUE
);
397 compareUSets(ws_pp
, ws_prop
,
398 "PatternProps.isWhiteSpace()", "[:Pattern_White_Space:]", TRUE
);
399 compareUSets(ws_pp
, ws_list
,
400 "PatternProps.isWhiteSpace()", "[Pattern_White_Space ranges]", TRUE
);
401 compareUSets(syn_ws_pp
, syn_ws_prop
,
402 "PatternProps.isSyntaxOrWhiteSpace()",
403 "[[:Pattern_Syntax:][:Pattern_White_Space:]]", TRUE
);
406 // So far only minimal port of Java & cucdtst.c compareUSets().
408 UnicodeTest::compareUSets(const UnicodeSet
&a
, const UnicodeSet
&b
,
409 const char *a_name
, const char *b_name
,
412 if(!same
&& diffIsError
) {
413 errln("Sets are different: %s vs. %s\n", a_name
, b_name
);
421 * Maps a special script code to the most common script of its encoded characters.
423 UScriptCode
getCharScript(UScriptCode script
) {
425 case USCRIPT_HAN_WITH_BOPOMOFO
:
426 case USCRIPT_SIMPLIFIED_HAN
:
427 case USCRIPT_TRADITIONAL_HAN
:
429 case USCRIPT_JAPANESE
:
430 return USCRIPT_HIRAGANA
;
433 return USCRIPT_HANGUL
;
434 case USCRIPT_SYMBOLS_EMOJI
:
435 return USCRIPT_SYMBOLS
;
443 void UnicodeTest::TestScriptMetadata() {
444 IcuTestErrorCode
errorCode(*this, "TestScriptMetadata()");
445 UnicodeSet
rtl("[[:bc=R:][:bc=AL:]-[:Cn:]-[:sc=Common:]]", errorCode
);
446 // So far, sample characters are uppercase.
447 // Georgian is special.
448 UnicodeSet
cased("[[:Lu:]-[:sc=Common:]-[:sc=Geor:]]", errorCode
);
449 for(int32_t sci
= 0; sci
< USCRIPT_CODE_LIMIT
; ++sci
) {
450 UScriptCode sc
= (UScriptCode
)sci
;
451 // Run the test with -v to see which script has failures:
452 // .../intltest$ make && ./intltest utility/UnicodeTest/TestScriptMetadata -v | grep -C 6 FAIL
453 logln(uscript_getShortName(sc
));
454 UScriptUsage usage
= uscript_getUsage(sc
);
455 UnicodeString sample
= uscript_getSampleUnicodeString(sc
);
456 UnicodeSet scriptSet
;
457 scriptSet
.applyIntPropertyValue(UCHAR_SCRIPT
, sc
, errorCode
);
458 if(usage
== USCRIPT_USAGE_NOT_ENCODED
) {
459 assertTrue("not encoded, no sample", sample
.isEmpty());
460 assertFalse("not encoded, not RTL", uscript_isRightToLeft(sc
));
461 assertFalse("not encoded, not LB letters", uscript_breaksBetweenLetters(sc
));
462 assertFalse("not encoded, not cased", uscript_isCased(sc
));
463 assertTrue("not encoded, no characters", scriptSet
.isEmpty());
465 assertFalse("encoded, has a sample character", sample
.isEmpty());
466 UChar32 firstChar
= sample
.char32At(0);
467 UScriptCode charScript
= getCharScript(sc
);
468 assertEquals("script(sample(script))",
469 (int32_t)charScript
, (int32_t)uscript_getScript(firstChar
, errorCode
));
470 assertEquals("RTL vs. set", (UBool
)rtl
.contains(firstChar
), (UBool
)uscript_isRightToLeft(sc
));
471 assertEquals("cased vs. set", (UBool
)cased
.contains(firstChar
), (UBool
)uscript_isCased(sc
));
472 assertEquals("encoded, has characters", (UBool
)(sc
== charScript
), (UBool
)(!scriptSet
.isEmpty()));
473 if(uscript_isRightToLeft(sc
)) {
474 rtl
.removeAll(scriptSet
);
476 if(uscript_isCased(sc
)) {
477 cased
.removeAll(scriptSet
);
481 UnicodeString pattern
;
482 assertEquals("no remaining RTL characters",
483 UnicodeString("[]"), rtl
.toPattern(pattern
));
484 assertEquals("no remaining cased characters",
485 UnicodeString("[]"), cased
.toPattern(pattern
));
487 assertTrue("Hani breaks between letters", uscript_breaksBetweenLetters(USCRIPT_HAN
));
488 assertTrue("Thai breaks between letters", uscript_breaksBetweenLetters(USCRIPT_THAI
));
489 assertFalse("Latn does not break between letters", uscript_breaksBetweenLetters(USCRIPT_LATIN
));
492 void UnicodeTest::TestBidiPairedBracketType() {
493 // BidiBrackets-6.3.0.txt says:
495 // The set of code points listed in this file was originally derived
496 // using the character properties General_Category (gc), Bidi_Class (bc),
497 // Bidi_Mirrored (Bidi_M), and Bidi_Mirroring_Glyph (bmg), as follows:
498 // two characters, A and B, form a pair if A has gc=Ps and B has gc=Pe,
499 // both have bc=ON and Bidi_M=Y, and bmg of A is B. Bidi_Paired_Bracket
500 // maps A to B and vice versa, and their Bidi_Paired_Bracket_Type
501 // property values are Open and Close, respectively.
502 IcuTestErrorCode
errorCode(*this, "TestBidiPairedBracketType()");
503 UnicodeSet
bpt("[:^bpt=n:]", errorCode
);
504 assertTrue("bpt!=None is not empty", !bpt
.isEmpty());
505 // The following should always be true.
506 UnicodeSet
mirrored("[:Bidi_M:]", errorCode
);
507 UnicodeSet
other_neutral("[:bc=ON:]", errorCode
);
508 assertTrue("bpt!=None is a subset of Bidi_M", mirrored
.containsAll(bpt
));
509 assertTrue("bpt!=None is a subset of bc=ON", other_neutral
.containsAll(bpt
));
510 // The following are true at least initially in Unicode 6.3.
511 UnicodeSet
bpt_open("[:bpt=o:]", errorCode
);
512 UnicodeSet
bpt_close("[:bpt=c:]", errorCode
);
513 UnicodeSet
ps("[:Ps:]", errorCode
);
514 UnicodeSet
pe("[:Pe:]", errorCode
);
515 assertTrue("bpt=Open is a subset of Ps", ps
.containsAll(bpt_open
));
516 assertTrue("bpt=Close is a subset of Pe", pe
.containsAll(bpt_close
));
519 void UnicodeTest::TestEmojiProperties() {
520 assertFalse("space is not Emoji", u_hasBinaryProperty(0x20, UCHAR_EMOJI
));
521 assertTrue("shooting star is Emoji", u_hasBinaryProperty(0x1F320, UCHAR_EMOJI
));
522 IcuTestErrorCode
errorCode(*this, "TestEmojiProperties()");
523 UnicodeSet
emoji("[:Emoji:]", errorCode
);
524 assertTrue("lots of Emoji", emoji
.size() > 700);
526 assertTrue("shooting star is Emoji_Presentation",
527 u_hasBinaryProperty(0x1F320, UCHAR_EMOJI_PRESENTATION
));
528 assertTrue("Fitzpatrick 6 is Emoji_Modifier",
529 u_hasBinaryProperty(0x1F3FF, UCHAR_EMOJI_MODIFIER
));
530 assertTrue("happy person is Emoji_Modifier_Base",
531 u_hasBinaryProperty(0x1F64B, UCHAR_EMOJI_MODIFIER_BASE
));
532 assertTrue("asterisk is Emoji_Component",
533 u_hasBinaryProperty(0x2A, UCHAR_EMOJI_COMPONENT
));
534 assertTrue("copyright is Extended_Pictographic",
535 u_hasBinaryProperty(0xA9, UCHAR_EXTENDED_PICTOGRAPHIC
));
536 #if U_PLATFORM_IS_DARWIN_BASED
537 assertTrue("TAG char is Emoji_Component",
538 u_hasBinaryProperty(0xE0061, UCHAR_EMOJI_COMPONENT
)); // Apple addition
539 assertTrue("ZWJ char is Emoji_Component",
540 u_hasBinaryProperty(0x200D, UCHAR_EMOJI_COMPONENT
)); // Apple addition
544 void UnicodeTest::TestDefaultScriptExtensions() {
545 // Block 3000..303F CJK Symbols and Punctuation defaults to scx=Bopo Hang Hani Hira Kana Yiii
546 // but some of its characters revert to scx=<script> which is usually Common.
547 IcuTestErrorCode
errorCode(*this, "TestDefaultScriptExtensions()");
549 scx
[0] = USCRIPT_INVALID_CODE
;
550 assertEquals("U+3000 num scx", 1, // IDEOGRAPHIC SPACE
551 uscript_getScriptExtensions(0x3000, scx
, UPRV_LENGTHOF(scx
), errorCode
));
552 assertEquals("U+3000 num scx[0]", USCRIPT_COMMON
, scx
[0]);
553 scx
[0] = USCRIPT_INVALID_CODE
;
554 assertEquals("U+3012 num scx", 1, // POSTAL MARK
555 uscript_getScriptExtensions(0x3012, scx
, UPRV_LENGTHOF(scx
), errorCode
));
556 assertEquals("U+3012 num scx[0]", USCRIPT_COMMON
, scx
[0]);
559 void UnicodeTest::TestInvalidCodePointFolding(void) {
560 // Test behavior when an invalid code point is passed to u_foldCase
561 static const UChar32 invalidCodePoints
[] = {
562 0xD800, // lead surrogate
563 0xDFFF, // trail surrogate
564 0xFDD0, // noncharacter
565 0xFFFF, // noncharacter
566 0x110000, // out of range
569 for (int32_t i
=0; i
<UPRV_LENGTHOF(invalidCodePoints
); ++i
) {
570 UChar32 cp
= invalidCodePoints
[i
];
571 assertEquals("Invalid code points should be echoed back",
572 cp
, u_foldCase(cp
, U_FOLD_CASE_DEFAULT
));
573 assertEquals("Invalid code points should be echoed back",
574 cp
, u_foldCase(cp
, U_FOLD_CASE_EXCLUDE_SPECIAL_I
));