+ csm=ucasemap_open(localeID, options, &errorCode);
+#if !UCONFIG_NO_BREAK_ITERATION
+ if(iter!=NULL) {
+ // Clone the break iterator so that the UCaseMap can safely adopt it.
+ int32_t size=1; // Not 0 because that only gives preflighting.
+ UBreakIterator *clone=ubrk_safeClone((UBreakIterator *)iter, NULL, &size, &errorCode);
+ ucasemap_setBreakIterator(csm, clone, &errorCode);
+ }
+#endif
+
+ u_strToUTF8(utf8In, (int32_t)sizeof(utf8In), &utf8InLength, input.getBuffer(), input.length(), &errorCode);
+ switch(whichCase) {
+ case TEST_LOWER:
+ name="ucasemap_utf8ToLower";
+ utf8OutLength=ucasemap_utf8ToLower(csm,
+ utf8Out, (int32_t)sizeof(utf8Out),
+ utf8In, utf8InLength, &errorCode);
+ break;
+ case TEST_UPPER:
+ name="ucasemap_utf8ToUpper";
+ utf8OutLength=ucasemap_utf8ToUpper(csm,
+ utf8Out, (int32_t)sizeof(utf8Out),
+ utf8In, utf8InLength, &errorCode);
+ break;
+#if !UCONFIG_NO_BREAK_ITERATION
+ case TEST_TITLE:
+ name="ucasemap_utf8ToTitle";
+ utf8OutLength=ucasemap_utf8ToTitle(csm,
+ utf8Out, (int32_t)sizeof(utf8Out),
+ utf8In, utf8InLength, &errorCode);
+ break;
+#endif
+ case TEST_FOLD:
+ name="ucasemap_utf8FoldCase";
+ utf8OutLength=ucasemap_utf8FoldCase(csm,
+ utf8Out, (int32_t)sizeof(utf8Out),
+ utf8In, utf8InLength, &errorCode);
+ break;
+ default:
+ name="";
+ utf8OutLength=0;
+ break; // won't happen