1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
6 * Copyright (C) 2002-2016, International Business Machines
7 * Corporation and others. All Rights Reserved.
9 *******************************************************************************
10 * file name: cstrcase.c
12 * tab size: 8 (not used)
15 * created on: 2002feb21
16 * created by: Markus W. Scherer
18 * Test file for string casing C API functions.
22 #include "unicode/utypes.h"
23 #include "unicode/uchar.h"
24 #include "unicode/ustring.h"
25 #include "unicode/uloc.h"
26 #include "unicode/ubrk.h"
27 #include "unicode/ucasemap.h"
30 #include "ucasemap_imp.h"
33 /* test string case mapping functions --------------------------------------- */
39 beforeLower
[]= { 0x61, 0x42, 0x49, 0x3a3, 0xdf, 0x3a3, 0x2f, 0xd93f, 0xdfff },
40 lowerRoot
[]= { 0x61, 0x62, 0x69, 0x3c3, 0xdf, 0x3c2, 0x2f, 0xd93f, 0xdfff },
41 lowerTurkish
[]={ 0x61, 0x62, 0x131, 0x3c3, 0xdf, 0x3c2, 0x2f, 0xd93f, 0xdfff };
47 /* lowercase with root locale and separate buffers */
49 errorCode
=U_ZERO_ERROR
;
50 length
=u_strToLower(buffer
, UPRV_LENGTHOF(buffer
),
51 beforeLower
, UPRV_LENGTHOF(beforeLower
),
54 if( U_FAILURE(errorCode
) ||
55 length
!=(UPRV_LENGTHOF(lowerRoot
)) ||
56 uprv_memcmp(lowerRoot
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
59 log_err("error in u_strToLower(root locale)=%ld error=%s string matches: %s\t\nlowerRoot=%s\t\nbuffer=%s\n",
61 u_errorName(errorCode
),
62 uprv_memcmp(lowerRoot
, buffer
, length
*U_SIZEOF_UCHAR
)==0 &&
63 buffer
[length
]==0 ? "yes" : "no",
64 aescstrdup(lowerRoot
,-1),
65 aescstrdup(buffer
,-1));
68 /* lowercase with turkish locale and in the same buffer */
69 uprv_memcpy(buffer
, beforeLower
, sizeof(beforeLower
));
70 buffer
[UPRV_LENGTHOF(beforeLower
)]=0;
71 errorCode
=U_ZERO_ERROR
;
72 length
=u_strToLower(buffer
, UPRV_LENGTHOF(buffer
),
73 buffer
, -1, /* implicit srcLength */
76 if( U_FAILURE(errorCode
) ||
77 length
!=(UPRV_LENGTHOF(lowerTurkish
)) ||
78 uprv_memcmp(lowerTurkish
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
81 log_err("error in u_strToLower(turkish locale)=%ld error=%s string matches: %s\n",
83 u_errorName(errorCode
),
84 uprv_memcmp(lowerTurkish
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
87 /* test preflighting */
88 buffer
[0]=buffer
[2]=0xabcd;
89 errorCode
=U_ZERO_ERROR
;
90 length
=u_strToLower(buffer
, 2, /* set destCapacity=2 */
91 beforeLower
, UPRV_LENGTHOF(beforeLower
),
94 if( errorCode
!=U_BUFFER_OVERFLOW_ERROR
||
95 length
!=(UPRV_LENGTHOF(lowerRoot
)) ||
96 uprv_memcmp(lowerRoot
, buffer
, 2*U_SIZEOF_UCHAR
)!=0 ||
99 log_err("error in u_strToLower(root locale preflighting)=%ld error=%s string matches: %s\n",
101 u_errorName(errorCode
),
102 uprv_memcmp(lowerRoot
, buffer
, 2*U_SIZEOF_UCHAR
)==0 && buffer
[2]==0xabcd ? "yes" : "no");
105 /* test error handling */
106 errorCode
=U_ZERO_ERROR
;
107 length
=u_strToLower(NULL
, UPRV_LENGTHOF(buffer
),
108 beforeLower
, UPRV_LENGTHOF(beforeLower
),
111 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
) {
112 log_err("error in u_strToLower(root locale dest=NULL)=%ld error=%s\n",
114 u_errorName(errorCode
));
118 errorCode
=U_ZERO_ERROR
;
119 length
=u_strToLower(buffer
, -1,
120 beforeLower
, UPRV_LENGTHOF(beforeLower
),
123 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
126 log_err("error in u_strToLower(root locale destCapacity=-1)=%ld error=%s buffer[0]==0x%lx\n",
128 u_errorName(errorCode
),
134 TestCaseUpper(void) {
137 beforeUpper
[]= { 0x61, 0x42, 0x69, 0x3c2, 0xdf, 0x3c3, 0x2f, 0xfb03, 0xd93f, 0xdfff },
138 upperRoot
[]= { 0x41, 0x42, 0x49, 0x3a3, 0x53, 0x53, 0x3a3, 0x2f, 0x46, 0x46, 0x49, 0xd93f, 0xdfff },
139 upperTurkish
[]={ 0x41, 0x42, 0x130, 0x3a3, 0x53, 0x53, 0x3a3, 0x2f, 0x46, 0x46, 0x49, 0xd93f, 0xdfff };
143 UErrorCode errorCode
;
145 /* uppercase with root locale and in the same buffer */
146 uprv_memcpy(buffer
, beforeUpper
, sizeof(beforeUpper
));
147 errorCode
=U_ZERO_ERROR
;
148 length
=u_strToUpper(buffer
, UPRV_LENGTHOF(buffer
),
149 buffer
, UPRV_LENGTHOF(beforeUpper
),
152 if( U_FAILURE(errorCode
) ||
153 length
!=(UPRV_LENGTHOF(upperRoot
)) ||
154 uprv_memcmp(upperRoot
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
157 log_err("error in u_strToUpper(root locale)=%ld error=%s string matches: %s\n",
159 u_errorName(errorCode
),
160 uprv_memcmp(upperRoot
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
163 /* uppercase with turkish locale and separate buffers */
165 errorCode
=U_ZERO_ERROR
;
166 length
=u_strToUpper(buffer
, UPRV_LENGTHOF(buffer
),
167 beforeUpper
, UPRV_LENGTHOF(beforeUpper
),
170 if( U_FAILURE(errorCode
) ||
171 length
!=(UPRV_LENGTHOF(upperTurkish
)) ||
172 uprv_memcmp(upperTurkish
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
175 log_err("error in u_strToUpper(turkish locale)=%ld error=%s string matches: %s\n",
177 u_errorName(errorCode
),
178 uprv_memcmp(upperTurkish
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
181 /* test preflighting */
182 errorCode
=U_ZERO_ERROR
;
183 length
=u_strToUpper(NULL
, 0,
184 beforeUpper
, UPRV_LENGTHOF(beforeUpper
),
187 if( errorCode
!=U_BUFFER_OVERFLOW_ERROR
||
188 length
!=(UPRV_LENGTHOF(upperTurkish
))
190 log_err("error in u_strToUpper(turkish locale pure preflighting)=%ld error=%s\n",
192 u_errorName(errorCode
));
195 /* test error handling */
197 errorCode
=U_ZERO_ERROR
;
198 length
=u_strToUpper(buffer
, UPRV_LENGTHOF(buffer
),
199 NULL
, UPRV_LENGTHOF(beforeUpper
),
202 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
205 log_err("error in u_strToUpper(turkish locale src=NULL)=%ld error=%s buffer[0]==0x%lx\n",
207 u_errorName(errorCode
),
212 errorCode
=U_ZERO_ERROR
;
213 length
=u_strToUpper(buffer
, UPRV_LENGTHOF(buffer
),
217 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
220 log_err("error in u_strToUpper(turkish locale srcLength=-2)=%ld error=%s buffer[0]==0x%lx\n",
222 u_errorName(errorCode
),
227 #if !UCONFIG_NO_BREAK_ITERATION
230 TestCaseTitle(void) {
233 beforeTitle
[]= { 0x61, 0x42, 0x20, 0x69, 0x3c2, 0x20, 0xdf, 0x3c3, 0x2f, 0xfb03, 0xd93f, 0xdfff },
234 titleWord
[]= { 0x41, 0x62, 0x20, 0x49, 0x3c2, 0x20, 0x53, 0x73, 0x3c3, 0x2f, 0x46, 0x66, 0x69, 0xd93f, 0xdfff },
235 titleChar
[]= { 0x41, 0x42, 0x20, 0x49, 0x3a3, 0x20, 0x53, 0x73, 0x3a3, 0x2f, 0x46, 0x66, 0x69, 0xd93f, 0xdfff };
238 UBreakIterator
*titleIterChars
;
240 UErrorCode errorCode
;
242 errorCode
=U_ZERO_ERROR
;
243 titleIterChars
=ubrk_open(UBRK_CHARACTER
, "", beforeTitle
, UPRV_LENGTHOF(beforeTitle
), &errorCode
);
244 if(U_FAILURE(errorCode
)) {
245 log_err_status(errorCode
, "error: ubrk_open(UBRK_CHARACTER)->%s\n", u_errorName(errorCode
));
249 /* titlecase with standard break iterator and in the same buffer */
250 uprv_memcpy(buffer
, beforeTitle
, sizeof(beforeTitle
));
251 errorCode
=U_ZERO_ERROR
;
252 length
=u_strToTitle(buffer
, UPRV_LENGTHOF(buffer
),
253 buffer
, UPRV_LENGTHOF(beforeTitle
),
256 if( U_FAILURE(errorCode
) ||
257 length
!=(UPRV_LENGTHOF(titleWord
)) ||
258 uprv_memcmp(titleWord
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
261 log_err("error in u_strToTitle(standard iterator)=%ld error=%s string matches: %s\n",
263 u_errorName(errorCode
),
264 uprv_memcmp(titleWord
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
267 /* titlecase with UBRK_CHARACTERS and separate buffers */
269 errorCode
=U_ZERO_ERROR
;
270 length
=u_strToTitle(buffer
, UPRV_LENGTHOF(buffer
),
271 beforeTitle
, UPRV_LENGTHOF(beforeTitle
),
274 if( U_FAILURE(errorCode
) ||
275 length
!=(UPRV_LENGTHOF(titleChar
)) ||
276 uprv_memcmp(titleChar
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
279 log_err("error in u_strToTitle(UBRK_CHARACTERS)=%ld error=%s string matches: %s\n",
281 u_errorName(errorCode
),
282 uprv_memcmp(titleChar
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
285 /* test preflighting */
286 errorCode
=U_ZERO_ERROR
;
287 length
=u_strToTitle(NULL
, 0,
288 beforeTitle
, UPRV_LENGTHOF(beforeTitle
),
291 if( errorCode
!=U_BUFFER_OVERFLOW_ERROR
||
292 length
!=(UPRV_LENGTHOF(titleChar
))
294 log_err("error in u_strToTitle(UBRK_CHARACTERS pure preflighting)=%ld error=%s\n",
296 u_errorName(errorCode
));
299 /* test error handling */
301 errorCode
=U_ZERO_ERROR
;
302 length
=u_strToTitle(buffer
, UPRV_LENGTHOF(buffer
),
303 NULL
, UPRV_LENGTHOF(beforeTitle
),
306 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
309 log_err("error in u_strToTitle(UBRK_CHARACTERS src=NULL)=%ld error=%s buffer[0]==0x%lx\n",
311 u_errorName(errorCode
),
316 errorCode
=U_ZERO_ERROR
;
317 length
=u_strToTitle(buffer
, UPRV_LENGTHOF(buffer
),
321 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
324 log_err("error in u_strToTitle(UBRK_CHARACTERS srcLength=-2)=%ld error=%s buffer[0]==0x%lx\n",
326 u_errorName(errorCode
),
330 ubrk_close(titleIterChars
);
334 TestCaseDutchTitle(void) {
337 beforeTitle
[]= { 0x69, 0x6A, 0x73, 0x73, 0x45, 0x6c, 0x20, 0x69, 0x67, 0x6c, 0x4f, 0x6f , 0x20 , 0x49, 0x4A, 0x53, 0x53, 0x45, 0x4C },
338 titleRoot
[]= { 0x49, 0x6A, 0x73, 0x73, 0x65, 0x6c, 0x20, 0x49, 0x67, 0x6c, 0x6f, 0x6f , 0x20 , 0x49, 0x6A, 0x73, 0x73, 0x65, 0x6C },
339 titleDutch
[]= { 0x49, 0x4A, 0x73, 0x73, 0x65, 0x6c, 0x20, 0x49, 0x67, 0x6c, 0x6f, 0x6f , 0x20 , 0x49, 0x4A, 0x73, 0x73, 0x65, 0x6C };
342 UBreakIterator
*titleIterWord
;
344 UErrorCode errorCode
;
346 errorCode
=U_ZERO_ERROR
;
347 titleIterWord
=ubrk_open(UBRK_WORD
, "", beforeTitle
, UPRV_LENGTHOF(beforeTitle
), &errorCode
);
348 if(U_FAILURE(errorCode
)) {
349 log_err_status(errorCode
, "error: ubrk_open(UBRK_WORD)->%s\n", u_errorName(errorCode
));
353 /* titlecase with default locale */
355 errorCode
=U_ZERO_ERROR
;
356 length
=u_strToTitle(buffer
, UPRV_LENGTHOF(buffer
),
357 beforeTitle
, UPRV_LENGTHOF(beforeTitle
),
360 if( U_FAILURE(errorCode
) ||
361 length
!=(UPRV_LENGTHOF(titleRoot
)) ||
362 uprv_memcmp(titleRoot
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
366 u_UCharsToChars(buffer
,charsOut
,sizeof(charsOut
));
367 log_err("error in u_strToTitle(UBRK_CHARACTERS)=%ld error=%s root locale string matches: %s\noutput buffer is {%s}\n",
369 u_errorName(errorCode
),
370 uprv_memcmp(titleRoot
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no", charsOut
);
372 /* titlecase with Dutch locale */
374 errorCode
=U_ZERO_ERROR
;
375 length
=u_strToTitle(buffer
, UPRV_LENGTHOF(buffer
),
376 beforeTitle
, UPRV_LENGTHOF(beforeTitle
),
379 if( U_FAILURE(errorCode
) ||
380 length
!=(UPRV_LENGTHOF(titleDutch
)) ||
381 uprv_memcmp(titleDutch
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
385 u_UCharsToChars(buffer
,charsOut
,sizeof(charsOut
));
386 log_err("error in u_strToTitle(UBRK_CHARACTERS)=%ld error=%s dutch locale string matches: %s\noutput buffer is {%s}\n",
388 u_errorName(errorCode
),
389 uprv_memcmp(titleDutch
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no", charsOut
);
392 ubrk_close(titleIterWord
);
397 /* test case folding and case-insensitive string compare -------------------- */
400 TestCaseFolding(void) {
402 * CaseFolding.txt says about i and its cousins:
403 * 0049; C; 0069; # LATIN CAPITAL LETTER I
404 * 0049; T; 0131; # LATIN CAPITAL LETTER I
406 * 0130; F; 0069 0307; # LATIN CAPITAL LETTER I WITH DOT ABOVE
407 * 0130; T; 0069; # LATIN CAPITAL LETTER I WITH DOT ABOVE
409 * See CaseFolding.txt and the Unicode Standard for how to apply the case foldings.
413 /* input, default, exclude special i */
419 0xfb03, 0xfb03, 0xfb03,
420 0x1040e,0x10436,0x10436,
421 0x5ffff,0x5ffff,0x5ffff
425 mixed
[]= { 0x61, 0x42, 0x130, 0x49, 0x131, 0x3d0, 0xdf, 0xfb03, 0xd93f, 0xdfff },
426 foldedDefault
[]= { 0x61, 0x62, 0x69, 0x307, 0x69, 0x131, 0x3b2, 0x73, 0x73, 0x66, 0x66, 0x69, 0xd93f, 0xdfff },
427 foldedExcludeSpecialI
[]={ 0x61, 0x62, 0x69, 0x131, 0x131, 0x3b2, 0x73, 0x73, 0x66, 0x66, 0x69, 0xd93f, 0xdfff };
429 UVersionInfo unicodeVersion
={ 0, 0, 17, 89 }, unicode_3_1
={ 3, 1, 0, 0 };
436 UErrorCode errorCode
;
439 /* if unicodeVersion()>=3.1 then test exclude-special-i cases as well */
440 u_getUnicodeVersion(unicodeVersion
);
441 isUnicode_3_1
= uprv_memcmp(unicodeVersion
, unicode_3_1
, 4)>=0;
443 /* test simple case folding */
445 for(i
=0; i
<sizeof(simple
)/12; p
+=3, ++i
) {
446 if(u_foldCase(p
[0], U_FOLD_CASE_DEFAULT
)!=p
[1]) {
447 log_err("error: u_foldCase(0x%04lx, default)=0x%04lx instead of 0x%04lx\n",
448 p
[0], u_foldCase(p
[0], U_FOLD_CASE_DEFAULT
), p
[1]);
452 if(isUnicode_3_1
&& u_foldCase(p
[0], U_FOLD_CASE_EXCLUDE_SPECIAL_I
)!=p
[2]) {
453 log_err("error: u_foldCase(0x%04lx, exclude special i)=0x%04lx instead of 0x%04lx\n",
454 p
[0], u_foldCase(p
[0], U_FOLD_CASE_EXCLUDE_SPECIAL_I
), p
[2]);
459 /* test full string case folding with default option and separate buffers */
461 errorCode
=U_ZERO_ERROR
;
462 length
=u_strFoldCase(buffer
, UPRV_LENGTHOF(buffer
),
463 mixed
, UPRV_LENGTHOF(mixed
),
466 if( U_FAILURE(errorCode
) ||
467 length
!=(UPRV_LENGTHOF(foldedDefault
)) ||
468 uprv_memcmp(foldedDefault
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
471 log_err("error in u_strFoldCase(default)=%ld error=%s string matches: %s\n",
473 u_errorName(errorCode
),
474 uprv_memcmp(foldedDefault
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
477 /* exclude special i */
480 errorCode
=U_ZERO_ERROR
;
481 length
=u_strFoldCase(buffer
, UPRV_LENGTHOF(buffer
),
482 mixed
, UPRV_LENGTHOF(mixed
),
483 U_FOLD_CASE_EXCLUDE_SPECIAL_I
,
485 if( U_FAILURE(errorCode
) ||
486 length
!=(UPRV_LENGTHOF(foldedExcludeSpecialI
)) ||
487 uprv_memcmp(foldedExcludeSpecialI
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
490 log_err("error in u_strFoldCase(exclude special i)=%ld error=%s string matches: %s\n",
492 u_errorName(errorCode
),
493 uprv_memcmp(foldedExcludeSpecialI
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
497 /* test full string case folding with default option and in the same buffer */
498 uprv_memcpy(buffer
, mixed
, sizeof(mixed
));
499 buffer
[UPRV_LENGTHOF(mixed
)]=0;
500 errorCode
=U_ZERO_ERROR
;
501 length
=u_strFoldCase(buffer
, UPRV_LENGTHOF(buffer
),
502 buffer
, -1, /* implicit srcLength */
505 if( U_FAILURE(errorCode
) ||
506 length
!=(UPRV_LENGTHOF(foldedDefault
)) ||
507 uprv_memcmp(foldedDefault
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
510 log_err("error in u_strFoldCase(default same buffer)=%ld error=%s string matches: %s\n",
512 u_errorName(errorCode
),
513 uprv_memcmp(foldedDefault
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
516 /* test full string case folding, exclude special i, in the same buffer */
518 uprv_memcpy(buffer
, mixed
, sizeof(mixed
));
519 errorCode
=U_ZERO_ERROR
;
520 length
=u_strFoldCase(buffer
, UPRV_LENGTHOF(buffer
),
521 buffer
, UPRV_LENGTHOF(mixed
),
522 U_FOLD_CASE_EXCLUDE_SPECIAL_I
,
524 if( U_FAILURE(errorCode
) ||
525 length
!=UPRV_LENGTHOF(foldedExcludeSpecialI
) ||
526 uprv_memcmp(foldedExcludeSpecialI
, buffer
, length
*U_SIZEOF_UCHAR
)!=0 ||
529 log_err("error in u_strFoldCase(exclude special i same buffer)=%ld error=%s string matches: %s\n",
531 u_errorName(errorCode
),
532 uprv_memcmp(foldedExcludeSpecialI
, buffer
, length
*U_SIZEOF_UCHAR
)==0 && buffer
[length
]==0 ? "yes" : "no");
536 /* test preflighting */
537 buffer
[0]=buffer
[2]=0xabcd;
538 errorCode
=U_ZERO_ERROR
;
539 length
=u_strFoldCase(buffer
, 2, /* set destCapacity=2 */
540 mixed
, UPRV_LENGTHOF(mixed
),
543 if( errorCode
!=U_BUFFER_OVERFLOW_ERROR
||
544 length
!=UPRV_LENGTHOF(foldedDefault
) ||
545 uprv_memcmp(foldedDefault
, buffer
, 2*U_SIZEOF_UCHAR
)!=0 ||
548 log_err("error in u_strFoldCase(default preflighting)=%ld error=%s string matches: %s\n",
550 u_errorName(errorCode
),
551 uprv_memcmp(foldedDefault
, buffer
, 2*U_SIZEOF_UCHAR
)==0 && buffer
[2]==0xabcd ? "yes" : "no");
554 errorCode
=U_ZERO_ERROR
;
555 length
=u_strFoldCase(NULL
, 0,
556 mixed
, UPRV_LENGTHOF(mixed
),
559 if( errorCode
!=U_BUFFER_OVERFLOW_ERROR
||
560 length
!=UPRV_LENGTHOF(foldedDefault
)
562 log_err("error in u_strFoldCase(default pure preflighting)=%ld error=%s\n",
564 u_errorName(errorCode
));
567 /* test error handling */
568 errorCode
=U_ZERO_ERROR
;
569 length
=u_strFoldCase(NULL
, UPRV_LENGTHOF(buffer
),
570 mixed
, UPRV_LENGTHOF(mixed
),
573 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
) {
574 log_err("error in u_strFoldCase(default dest=NULL)=%ld error=%s\n",
576 u_errorName(errorCode
));
580 errorCode
=U_ZERO_ERROR
;
581 length
=u_strFoldCase(buffer
, -1,
582 mixed
, UPRV_LENGTHOF(mixed
),
585 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
588 log_err("error in u_strFoldCase(default destCapacity=-1)=%ld error=%s buffer[0]==0x%lx\n",
590 u_errorName(errorCode
),
595 errorCode
=U_ZERO_ERROR
;
596 length
=u_strFoldCase(buffer
, UPRV_LENGTHOF(buffer
),
597 NULL
, UPRV_LENGTHOF(mixed
),
598 U_FOLD_CASE_EXCLUDE_SPECIAL_I
,
600 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
603 log_err("error in u_strFoldCase(exclude special i src=NULL)=%ld error=%s buffer[0]==0x%lx\n",
605 u_errorName(errorCode
),
610 errorCode
=U_ZERO_ERROR
;
611 length
=u_strFoldCase(buffer
, UPRV_LENGTHOF(buffer
),
613 U_FOLD_CASE_EXCLUDE_SPECIAL_I
,
615 if( errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
||
618 log_err("error in u_strFoldCase(exclude special i srcLength=-2)=%ld error=%s buffer[0]==0x%lx\n",
620 u_errorName(errorCode
),
626 TestCaseCompare(void) {
629 mixed
[]= { 0x61, 0x42, 0x131, 0x3a3, 0xdf, 0xfb03, 0xd93f, 0xdfff, 0 },
630 otherDefault
[]= { 0x41, 0x62, 0x131, 0x3c3, 0x73, 0x53, 0x46, 0x66, 0x49, 0xd93f, 0xdfff, 0 },
631 otherExcludeSpecialI
[]={ 0x41, 0x62, 0x131, 0x3c3, 0x53, 0x73, 0x66, 0x46, 0x69, 0xd93f, 0xdfff, 0 },
632 different
[]= { 0x41, 0x62, 0x131, 0x3c3, 0x73, 0x53, 0x46, 0x66, 0x49, 0xd93f, 0xdffd, 0 };
634 UVersionInfo unicodeVersion
={ 0, 0, 17, 89 }, unicode_3_1
={ 3, 1, 0, 0 };
636 int32_t result
, lenMixed
, lenOtherDefault
, lenOtherExcludeSpecialI
, lenDifferent
;
637 UErrorCode errorCode
;
640 errorCode
=U_ZERO_ERROR
;
642 lenMixed
=u_strlen(mixed
);
643 lenOtherDefault
=u_strlen(otherDefault
);
644 (void)lenOtherDefault
; /* Suppress set but not used warning. */
645 lenOtherExcludeSpecialI
=u_strlen(otherExcludeSpecialI
);
646 lenDifferent
=u_strlen(different
);
648 /* if unicodeVersion()>=3.1 then test exclude-special-i cases as well */
649 u_getUnicodeVersion(unicodeVersion
);
650 isUnicode_3_1
= uprv_memcmp(unicodeVersion
, unicode_3_1
, 4)>=0;
651 (void)isUnicode_3_1
; /* Suppress set but not used warning. */
653 /* test u_strcasecmp() */
654 result
=u_strcasecmp(mixed
, otherDefault
, U_FOLD_CASE_DEFAULT
);
656 log_err("error: u_strcasecmp(mixed, other, default)=%ld instead of 0\n", result
);
658 result
=u_strCaseCompare(mixed
, -1, otherDefault
, -1, U_FOLD_CASE_DEFAULT
, &errorCode
);
660 log_err("error: u_strCaseCompare(mixed, other, default)=%ld instead of 0\n", result
);
663 /* test u_strcasecmp() - exclude special i */
664 result
=u_strcasecmp(mixed
, otherExcludeSpecialI
, U_FOLD_CASE_EXCLUDE_SPECIAL_I
);
666 log_err("error: u_strcasecmp(mixed, other, exclude special i)=%ld instead of 0\n", result
);
668 result
=u_strCaseCompare(mixed
, lenMixed
, otherExcludeSpecialI
, lenOtherExcludeSpecialI
, U_FOLD_CASE_EXCLUDE_SPECIAL_I
, &errorCode
);
670 log_err("error: u_strCaseCompare(mixed, other, exclude special i)=%ld instead of 0\n", result
);
673 /* test u_strcasecmp() */
674 result
=u_strcasecmp(mixed
, different
, U_FOLD_CASE_DEFAULT
);
676 log_err("error: u_strcasecmp(mixed, different, default)=%ld instead of positive\n", result
);
678 result
=u_strCaseCompare(mixed
, -1, different
, lenDifferent
, U_FOLD_CASE_DEFAULT
, &errorCode
);
680 log_err("error: u_strCaseCompare(mixed, different, default)=%ld instead of positive\n", result
);
683 /* test u_strncasecmp() - stop before the sharp s (U+00df) */
684 result
=u_strncasecmp(mixed
, different
, 4, U_FOLD_CASE_DEFAULT
);
686 log_err("error: u_strncasecmp(mixed, different, 4, default)=%ld instead of 0\n", result
);
688 result
=u_strCaseCompare(mixed
, 4, different
, 4, U_FOLD_CASE_DEFAULT
, &errorCode
);
690 log_err("error: u_strCaseCompare(mixed, 4, different, 4, default)=%ld instead of 0\n", result
);
693 /* test u_strncasecmp() - stop in the middle of the sharp s (U+00df) */
694 result
=u_strncasecmp(mixed
, different
, 5, U_FOLD_CASE_DEFAULT
);
696 log_err("error: u_strncasecmp(mixed, different, 5, default)=%ld instead of positive\n", result
);
698 result
=u_strCaseCompare(mixed
, 5, different
, 5, U_FOLD_CASE_DEFAULT
, &errorCode
);
700 log_err("error: u_strCaseCompare(mixed, 5, different, 5, default)=%ld instead of positive\n", result
);
703 /* test u_memcasecmp() - stop before the sharp s (U+00df) */
704 result
=u_memcasecmp(mixed
, different
, 4, U_FOLD_CASE_DEFAULT
);
706 log_err("error: u_memcasecmp(mixed, different, 4, default)=%ld instead of 0\n", result
);
709 /* test u_memcasecmp() - stop in the middle of the sharp s (U+00df) */
710 result
=u_memcasecmp(mixed
, different
, 5, U_FOLD_CASE_DEFAULT
);
712 log_err("error: u_memcasecmp(mixed, different, 5, default)=%ld instead of positive\n", result
);
716 /* test UCaseMap ------------------------------------------------------------ */
719 * API test for UCaseMap;
720 * test cases for actual case mappings using UCaseMap see
721 * intltest utility/UnicodeStringTest/StringCaseTest/TestCasing
726 aBc
[] ={ 0x61, 0x42, 0x63, 0 },
727 abc
[] ={ 0x61, 0x62, 0x63, 0 },
728 ABCg
[]={ 0x41, 0x42, 0x43, 0x67, 0 },
729 defg
[]={ 0x64, 0x65, 0x66, 0x67, 0 };
736 UErrorCode errorCode
;
738 errorCode
=U_ZERO_ERROR
;
739 csm
=ucasemap_open("tur", 0xa5, &errorCode
);
740 if(U_FAILURE(errorCode
)) {
741 log_err("ucasemap_open(\"tur\") failed - %s\n", u_errorName(errorCode
));
744 locale
=ucasemap_getLocale(csm
);
745 if(0!=strcmp(locale
, "tr")) {
746 log_err("ucasemap_getLocale(ucasemap_open(\"tur\"))==%s!=\"tr\"\n", locale
);
748 /* overly long locale IDs may get truncated to their language code to avoid unnecessary allocation */
749 ucasemap_setLocale(csm
, "I-kLInGOn-the-quick-brown-fox-jumps-over-the-lazy-dog", &errorCode
);
750 locale
=ucasemap_getLocale(csm
);
751 // "I-kLInGOn-the-quick-brown-fox-jumps-over-the-lazy-dog" is canonicalized
752 // into "tlh-the-quick-brown-fox-jumps-over-the-lazy-dog"
753 // and "the" will be treated as an extlang which replaces "tlh".
754 if(0!=strncmp(locale
, "the", 3)) {
755 log_err("ucasemap_getLocale(ucasemap_setLocale(\"I-kLInGOn-the-quick-br...\"))==%s\n"
756 " does not start with \"the\"\n", locale
);
759 errorCode
=U_ZERO_ERROR
;
760 options
=ucasemap_getOptions(csm
);
762 log_err("ucasemap_getOptions(ucasemap_open(0xa5))==0x%lx!=0xa5\n", (long)options
);
764 ucasemap_setOptions(csm
, 0x333333, &errorCode
);
765 options
=ucasemap_getOptions(csm
);
766 if(options
!=0x333333) {
767 log_err("ucasemap_getOptions(ucasemap_setOptions(0x333333))==0x%lx!=0x333333\n", (long)options
);
770 /* test case mapping API; not all permutations necessary due to shared implementation code */
772 /* NUL terminated source */
773 errorCode
=U_ZERO_ERROR
;
774 length
=ucasemap_utf8ToLower(csm
, utf8Out
, (int32_t)sizeof(utf8Out
), aBc
, -1, &errorCode
);
775 if(U_FAILURE(errorCode
) || length
!=3 || 0!=strcmp(abc
, utf8Out
)) {
776 log_err("ucasemap_utf8ToLower(aBc\\0) failed\n");
779 /* incoming failure code */
780 errorCode
=U_PARSE_ERROR
;
781 strcpy(utf8Out
, defg
);
782 length
=ucasemap_utf8ToLower(csm
, utf8Out
, (int32_t)sizeof(utf8Out
), aBc
, -1, &errorCode
);
783 if(errorCode
!=U_PARSE_ERROR
|| 0!=strcmp(defg
, utf8Out
)) {
784 log_err("ucasemap_utf8ToLower(failure) failed\n");
787 /* overlapping input & output */
788 errorCode
=U_ZERO_ERROR
;
789 strcpy(utf8Out
, aBc
);
790 length
=ucasemap_utf8ToUpper(csm
, utf8Out
, 2, utf8Out
+1, 2, &errorCode
);
791 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
|| 0!=strcmp(aBc
, utf8Out
)) {
792 log_err("ucasemap_utf8ToUpper(overlap 1) failed\n");
795 /* overlap in the other direction */
796 errorCode
=U_ZERO_ERROR
;
797 strcpy(utf8Out
, aBc
);
798 length
=ucasemap_utf8ToUpper(csm
, utf8Out
+1, 2, utf8Out
, 2, &errorCode
);
799 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
|| 0!=strcmp(aBc
, utf8Out
)) {
800 log_err("ucasemap_utf8ToUpper(overlap 2) failed\n");
803 /* NULL destination */
804 errorCode
=U_ZERO_ERROR
;
805 strcpy(utf8Out
, defg
);
806 length
=ucasemap_utf8ToLower(csm
, NULL
, (int32_t)sizeof(utf8Out
), aBc
, -1, &errorCode
);
807 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
|| 0!=strcmp(defg
, utf8Out
)) {
808 log_err("ucasemap_utf8ToLower(dest=NULL) failed\n");
812 errorCode
=U_ZERO_ERROR
;
813 strcpy(utf8Out
, defg
);
814 length
=ucasemap_utf8ToLower(csm
, utf8Out
, -2, aBc
, -1, &errorCode
);
815 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
|| 0!=strcmp(defg
, utf8Out
)) {
816 log_err("ucasemap_utf8ToLower(destCapacity<0) failed\n");
820 errorCode
=U_ZERO_ERROR
;
821 strcpy(utf8Out
, defg
);
822 length
=ucasemap_utf8ToLower(csm
, utf8Out
, (int32_t)sizeof(utf8Out
), NULL
, -1, &errorCode
);
823 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
|| 0!=strcmp(defg
, utf8Out
)) {
824 log_err("ucasemap_utf8ToLower(src=NULL) failed\n");
828 errorCode
=U_ZERO_ERROR
;
829 strcpy(utf8Out
, defg
);
830 length
=ucasemap_utf8ToLower(csm
, utf8Out
, (int32_t)sizeof(utf8Out
), aBc
, -2, &errorCode
);
831 if(errorCode
!=U_ILLEGAL_ARGUMENT_ERROR
|| 0!=strcmp(defg
, utf8Out
)) {
832 log_err("ucasemap_utf8ToLower(srcLength<-1) failed\n");
835 /* buffer overflow */
836 errorCode
=U_ZERO_ERROR
;
837 strcpy(utf8Out
, defg
);
838 length
=ucasemap_utf8ToUpper(csm
, utf8Out
, 2, aBc
, 3, &errorCode
);
839 if(errorCode
!=U_BUFFER_OVERFLOW_ERROR
|| length
!=3 || 0!=strcmp(defg
+2, utf8Out
+2)) {
840 log_err("ucasemap_utf8ToUpper(overflow) failed\n");
843 /* dest not terminated (leaves g from defg alone) */
844 errorCode
=U_ZERO_ERROR
;
845 strcpy(utf8Out
, defg
);
846 length
=ucasemap_utf8ToUpper(csm
, utf8Out
, 3, aBc
, 3, &errorCode
);
847 if(errorCode
!=U_STRING_NOT_TERMINATED_WARNING
|| length
!=3 || 0!=strcmp(ABCg
, utf8Out
)) {
848 log_err("ucasemap_utf8ToUpper(overflow) failed\n");
851 /* C API coverage for case folding. More thorough test via C++ intltest's StringCaseTest::TestCasing(). */
852 errorCode
=U_ZERO_ERROR
;
854 length
=ucasemap_utf8FoldCase(csm
, utf8Out
, (int32_t)sizeof(utf8Out
), aBc
, 3, &errorCode
);
855 if(U_FAILURE(errorCode
) || length
!=3 || 0!=strcmp(abc
, utf8Out
)) {
856 log_err("ucasemap_utf8FoldCase(aBc) failed\n");
862 #if !UCONFIG_NO_BREAK_ITERATION
864 /* Try titlecasing with options. */
866 TestUCaseMapToTitle(void) {
867 /* "a 'CaT. A 'dOg! 'eTc." where '=U+02BB */
869 * Note: The sentence BreakIterator does not recognize a '.'
870 * as a sentence terminator if it is followed by lowercase.
871 * That is why the example has the '!'.
875 beforeTitle
[]= { 0x61, 0x20, 0x2bb, 0x43, 0x61, 0x54, 0x2e, 0x20, 0x41, 0x20, 0x2bb, 0x64, 0x4f, 0x67, 0x21, 0x20, 0x2bb, 0x65, 0x54, 0x63, 0x2e },
876 titleWord
[]= { 0x41, 0x20, 0x2bb, 0x43, 0x61, 0x74, 0x2e, 0x20, 0x41, 0x20, 0x2bb, 0x44, 0x6f, 0x67, 0x21, 0x20, 0x2bb, 0x45, 0x74, 0x63, 0x2e },
877 titleWordNoAdjust
[]={ 0x41, 0x20, 0x2bb, 0x63, 0x61, 0x74, 0x2e, 0x20, 0x41, 0x20, 0x2bb, 0x64, 0x6f, 0x67, 0x21, 0x20, 0x2bb, 0x65, 0x74, 0x63, 0x2e },
878 titleSentNoLower
[]= { 0x41, 0x20, 0x2bb, 0x43, 0x61, 0x54, 0x2e, 0x20, 0x41, 0x20, 0x2bb, 0x64, 0x4f, 0x67, 0x21, 0x20, 0x2bb, 0x45, 0x54, 0x63, 0x2e };
882 UBreakIterator
*sentenceIter
;
883 const UBreakIterator
*iter
;
885 UErrorCode errorCode
;
887 errorCode
=U_ZERO_ERROR
;
888 csm
=ucasemap_open("", 0, &errorCode
);
889 if(U_FAILURE(errorCode
)) {
890 log_err("ucasemap_open(\"\") failed - %s\n", u_errorName(errorCode
));
894 iter
=ucasemap_getBreakIterator(csm
);
896 log_err("ucasemap_getBreakIterator() returns %p!=NULL before setting any iterator or titlecasing\n", iter
);
899 /* Use default UBreakIterator: Word breaks. */
900 length
=ucasemap_toTitle(csm
, buffer
, UPRV_LENGTHOF(buffer
), beforeTitle
, UPRV_LENGTHOF(beforeTitle
), &errorCode
);
901 if( U_FAILURE(errorCode
) ||
902 length
!=UPRV_LENGTHOF(titleWord
) ||
903 0!=u_memcmp(buffer
, titleWord
, length
) ||
906 log_err_status(errorCode
, "ucasemap_toTitle(default iterator)=%ld failed - %s\n", (long)length
, u_errorName(errorCode
));
908 if (U_SUCCESS(errorCode
)) {
909 iter
=ucasemap_getBreakIterator(csm
);
911 log_err("ucasemap_getBreakIterator() returns NULL after titlecasing\n");
915 /* Try U_TITLECASE_NO_BREAK_ADJUSTMENT. */
916 ucasemap_setOptions(csm
, U_TITLECASE_NO_BREAK_ADJUSTMENT
, &errorCode
);
917 if(U_FAILURE(errorCode
)) {
918 log_err_status(errorCode
, "error: ucasemap_setOptions(U_TITLECASE_NO_BREAK_ADJUSTMENT) failed - %s\n", u_errorName(errorCode
));
922 length
=ucasemap_toTitle(csm
, buffer
, UPRV_LENGTHOF(buffer
), beforeTitle
, UPRV_LENGTHOF(beforeTitle
), &errorCode
);
923 if( U_FAILURE(errorCode
) ||
924 length
!=UPRV_LENGTHOF(titleWordNoAdjust
) ||
925 0!=u_memcmp(buffer
, titleWordNoAdjust
, length
) ||
928 log_err("ucasemap_toTitle(default iterator, no break adjustment)=%ld failed - %s\n", (long)length
, u_errorName(errorCode
));
931 /* Set a sentence break iterator. */
932 errorCode
=U_ZERO_ERROR
;
933 sentenceIter
=ubrk_open(UBRK_SENTENCE
, "", NULL
, 0, &errorCode
);
934 if(U_FAILURE(errorCode
)) {
935 log_err("error: ubrk_open(UBRK_SENTENCE) failed - %s\n", u_errorName(errorCode
));
939 ucasemap_setBreakIterator(csm
, sentenceIter
, &errorCode
);
940 if(U_FAILURE(errorCode
)) {
941 log_err("error: ucasemap_setBreakIterator(sentence iterator) failed - %s\n", u_errorName(errorCode
));
942 ubrk_close(sentenceIter
);
946 iter
=ucasemap_getBreakIterator(csm
);
947 if(iter
!=sentenceIter
) {
948 log_err("ucasemap_getBreakIterator() returns %p!=%p after setting the iterator\n", iter
, sentenceIter
);
951 ucasemap_setOptions(csm
, U_TITLECASE_NO_LOWERCASE
, &errorCode
);
952 if(U_FAILURE(errorCode
)) {
953 log_err("error: ucasemap_setOptions(U_TITLECASE_NO_LOWERCASE) failed - %s\n", u_errorName(errorCode
));
957 /* Use the sentence break iterator with the option. Preflight first. */
958 length
=ucasemap_toTitle(csm
, NULL
, 0, beforeTitle
, UPRV_LENGTHOF(beforeTitle
), &errorCode
);
959 if( errorCode
!=U_BUFFER_OVERFLOW_ERROR
||
960 length
!=UPRV_LENGTHOF(titleSentNoLower
)
962 log_err("ucasemap_toTitle(preflight sentence break iterator, no lowercasing)=%ld failed - %s\n", (long)length
, u_errorName(errorCode
));
965 errorCode
=U_ZERO_ERROR
;
967 length
=ucasemap_toTitle(csm
, buffer
, UPRV_LENGTHOF(buffer
), beforeTitle
, UPRV_LENGTHOF(beforeTitle
), &errorCode
);
968 if( U_FAILURE(errorCode
) ||
969 length
!=UPRV_LENGTHOF(titleSentNoLower
) ||
970 0!=u_memcmp(buffer
, titleSentNoLower
, length
) ||
973 log_err("ucasemap_toTitle(sentence break iterator, no lowercasing)=%ld failed - %s\n", (long)length
, u_errorName(errorCode
));
976 /* UTF-8 C API coverage. More thorough test via C++ intltest's StringCaseTest::TestCasing(). */
978 char utf8BeforeTitle
[64], utf8TitleSentNoLower
[64], utf8
[64];
979 int32_t utf8BeforeTitleLength
, utf8TitleSentNoLowerLength
;
981 errorCode
=U_ZERO_ERROR
;
982 u_strToUTF8(utf8BeforeTitle
, (int32_t)sizeof(utf8BeforeTitle
), &utf8BeforeTitleLength
, beforeTitle
, UPRV_LENGTHOF(beforeTitle
), &errorCode
);
983 u_strToUTF8(utf8TitleSentNoLower
, (int32_t)sizeof(utf8TitleSentNoLower
), &utf8TitleSentNoLowerLength
, titleSentNoLower
, UPRV_LENGTHOF(titleSentNoLower
), &errorCode
);
985 length
=ucasemap_utf8ToTitle(csm
, utf8
, (int32_t)sizeof(utf8
), utf8BeforeTitle
, utf8BeforeTitleLength
, &errorCode
);
986 if( U_FAILURE(errorCode
) ||
987 length
!=utf8TitleSentNoLowerLength
||
988 0!=uprv_memcmp(utf8
, utf8TitleSentNoLower
, length
) ||
991 log_err("ucasemap_utf8ToTitle(sentence break iterator, no lowercasing)=%ld failed - %s\n", (long)length
, u_errorName(errorCode
));
1000 /* Test case for internal API u_caseInsensitivePrefixMatch */
1002 TestUCaseInsensitivePrefixMatch(void) {
1009 {"ABC", "ab", 2, 2},
1010 {"ABCD", "abcx", 3, 3},
1011 {"ABC", "xyz", 0, 0},
1012 /* U+00DF LATIN SMALL LETTER SHARP S */
1013 {"A\\u00dfBC", "Ass", 2, 3},
1014 {"Fust", "Fu\\u00dfball", 2, 2},
1015 {"\\u00dfsA", "s\\u00dfB", 2, 2},
1016 {"\\u00dfs", "s\\u00df", 2, 2},
1017 /* U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE */
1018 {"XYZ\\u0130i\\u0307xxx", "xyzi\\u0307\\u0130yyy", 6, 6},
1023 for (i
= 0; testCases
[i
].s1
!= 0; i
++) {
1024 UErrorCode sts
= U_ZERO_ERROR
;
1025 UChar u1
[64], u2
[64];
1026 int32_t matchLen1
, matchLen2
;
1028 u_unescape(testCases
[i
].s1
, u1
, 64);
1029 u_unescape(testCases
[i
].s2
, u2
, 64);
1031 u_caseInsensitivePrefixMatch(u1
, -1, u2
, -1, 0, &matchLen1
, &matchLen2
, &sts
);
1032 if (U_FAILURE(sts
)) {
1033 log_err("error: %s, s1=%s, s2=%s", u_errorName(sts
), testCases
[i
].s1
, testCases
[i
].s2
);
1034 } else if (matchLen1
!= testCases
[i
].r1
|| matchLen2
!= testCases
[i
].r2
) {
1035 log_err("s1=%s, s2=%2 / match len1=%d, len2=%d / expected len1=%d, len2=%d",
1036 testCases
[i
].s1
, testCases
[i
].s2
,
1037 matchLen1
, matchLen2
,
1038 testCases
[i
].r1
, testCases
[i
].r2
);
1043 void addCaseTest(TestNode
** root
);
1045 void addCaseTest(TestNode
** root
) {
1046 /* cstrcase.c functions, declared in cucdtst.h */
1047 addTest(root
, &TestCaseLower
, "tsutil/cstrcase/TestCaseLower");
1048 addTest(root
, &TestCaseUpper
, "tsutil/cstrcase/TestCaseUpper");
1049 #if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILE_IO
1050 addTest(root
, &TestCaseTitle
, "tsutil/cstrcase/TestCaseTitle");
1051 addTest(root
, &TestCaseDutchTitle
, "tsutil/cstrcase/TestCaseDutchTitle");
1053 addTest(root
, &TestCaseFolding
, "tsutil/cstrcase/TestCaseFolding");
1054 addTest(root
, &TestCaseCompare
, "tsutil/cstrcase/TestCaseCompare");
1055 addTest(root
, &TestUCaseMap
, "tsutil/cstrcase/TestUCaseMap");
1056 #if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILE_IO
1057 addTest(root
, &TestUCaseMapToTitle
, "tsutil/cstrcase/TestUCaseMapToTitle");
1059 addTest(root
, &TestUCaseInsensitivePrefixMatch
, "tsutil/cstrcase/TestUCaseInsensitivePrefixMatch");