]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/tstnorm.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / intltest / tstnorm.cpp
index 56df7cac445c22a04b20f27798939828a912632c..886df6f15adf103cf31106372a4e78346614c311 100644 (file)
@@ -1369,7 +1369,7 @@ initExpectedSkippables(UnicodeSet skipSets[UNORM_MODE_COUNT], UErrorCode &errorC
     // We need not look at control codes, Han characters nor Hangul LVT syllables because they
     // do not combine forward. LV syllables are already removed.
     UnicodeSet notInteresting("[[:C:][:Unified_Ideograph:][:HST=LVT:]]", errorCode);
-    LocalPointer<UnicodeSet> unsure(&((UnicodeSet *)(skipSets[UNORM_NFC].clone()))->removeAll(notInteresting));
+    LocalPointer<UnicodeSet> unsure(&(skipSets[UNORM_NFC].clone())->removeAll(notInteresting));
     // System.out.format("unsure.size()=%d\n", unsure.size());
 
     // For each character about which we are unsure, see if it changes when we add
@@ -1574,8 +1574,8 @@ BasicNormalizerTest::TestNormalizeUTF8WithEdits() {
         return;
     }
     static const char *const src =
-        u8"  AÄA\u0308A\u0308\u00ad\u0323Ä\u0323,\u00ad\u1100\u1161가\u11A8가\u3133  ";
-    std::string expected = u8"  aääạ\u0308ạ\u0308,가각갃  ";
+        reinterpret_cast<const char*>(u8"  AÄA\u0308A\u0308\u00ad\u0323Ä\u0323,\u00ad\u1100\u1161가\u11A8가\u3133  ");
+    std::string expected = reinterpret_cast<const char*>(u8"  aääạ\u0308ạ\u0308,가각갃  ");
     std::string result;
     StringByteSink<std::string> sink(&result, static_cast<int32_t>(expected.length()));
     Edits edits;
@@ -1607,7 +1607,7 @@ BasicNormalizerTest::TestNormalizeUTF8WithEdits() {
     assertTrue("isNormalizedUTF8(normalized)", nfkc_cf->isNormalizedUTF8(result, errorCode));
 
     // Omit unchanged text.
-    expected = u8"aääạ\u0308ạ\u0308가각갃";
+    expected = reinterpret_cast<const char*>(u8"aääạ\u0308ạ\u0308가각갃");
     result.clear();
     edits.reset();
     nfkc_cf->normalizeUTF8(U_OMIT_UNCHANGED_TEXT, src, sink, &edits, errorCode);
@@ -1623,7 +1623,7 @@ BasicNormalizerTest::TestNormalizeUTF8WithEdits() {
     // With filter: The normalization code does not see the "A" substrings.
     UnicodeSet filter(u"[^A]", errorCode);
     FilteredNormalizer2 fn2(*nfkc_cf, filter);
-    expected = u8"  AäA\u0308A\u0323\u0308ạ\u0308,가각갃  ";
+    expected = reinterpret_cast<const char*>(u8"  AäA\u0308A\u0323\u0308ạ\u0308,가각갃  ");
     result.clear();
     edits.reset();
     fn2.normalizeUTF8(0, src, sink, &edits, errorCode);
@@ -1655,7 +1655,7 @@ BasicNormalizerTest::TestNormalizeUTF8WithEdits() {
     // Omit unchanged text.
     // Note that the result is not normalized because the inner normalizer
     // does not see text across filter spans.
-    expected = u8"ä\u0323\u0308ạ\u0308가각갃";
+    expected = reinterpret_cast<const char*>(u8"ä\u0323\u0308ạ\u0308가각갃");
     result.clear();
     edits.reset();
     fn2.normalizeUTF8(U_OMIT_UNCHANGED_TEXT, src, sink, &edits, errorCode);
@@ -1743,16 +1743,16 @@ BasicNormalizerTest::TestNormalizeIllFormedText() {
     assertSuccess("normalize", errorCode.get());
     assertEquals("normalize", expected, result);
 
-    std::string src8(u8"  A");
-    src8.append("\x80").append(u8"ÄA\u0308").append("\xC0\x80").
-        append(u8"A\u0308\u00ad\u0323").append("\xED\xA0\x80").
-        append(u8"Ä\u0323,\u00ad").append("\xF4\x90\x80\x80").
-        append(u8"\u1100\u1161가\u11A8가\u3133  ").append("\xF0");
-    std::string expected8(u8"  a");
-    expected8.append("\x80").append(u8"ää").append("\xC0\x80").
-        append(u8"ạ\u0308").append("\xED\xA0\x80").
-        append(u8"ạ\u0308,").append("\xF4\x90\x80\x80").
-        append(u8"가각갃  ").append("\xF0");
+    std::string src8(reinterpret_cast<const char*>(u8"  A"));
+    src8.append("\x80").append(reinterpret_cast<const char*>(u8"ÄA\u0308")).append("\xC0\x80").
+        append(reinterpret_cast<const char*>(u8"A\u0308\u00ad\u0323")).append("\xED\xA0\x80").
+        append(reinterpret_cast<const char*>(u8"Ä\u0323,\u00ad")).append("\xF4\x90\x80\x80").
+        append(reinterpret_cast<const char*>(u8"\u1100\u1161가\u11A8가\u3133  ")).append("\xF0");
+    std::string expected8(reinterpret_cast<const char*>(u8"  a"));
+    expected8.append("\x80").append(reinterpret_cast<const char*>(u8"ää")).append("\xC0\x80").
+        append(reinterpret_cast<const char*>(u8"ạ\u0308")).append("\xED\xA0\x80").
+        append(reinterpret_cast<const char*>(u8"ạ\u0308,")).append("\xF4\x90\x80\x80").
+        append(reinterpret_cast<const char*>(u8"가각갃  ")).append("\xF0");
     std::string result8;
     StringByteSink<std::string> sink(&result8);
     nfkc_cf->normalizeUTF8(0, src8, sink, nullptr, errorCode);
@@ -1777,8 +1777,8 @@ BasicNormalizerTest::TestComposeJamoTBase() {
     assertFalse("isNormalized(LV+11A7)", nfkc->isNormalized(s, errorCode));
     assertTrue("isNormalized(normalized)", nfkc->isNormalized(result, errorCode));
 
-    std::string s8(u8"\u1100\u1161\u11A7\u1100\u314F\u11A7가\u11A7");
-    std::string expected8(u8"가\u11A7가\u11A7가\u11A7");
+    std::string s8(reinterpret_cast<const char*>(u8"\u1100\u1161\u11A7\u1100\u314F\u11A7가\u11A7"));
+    std::string expected8(reinterpret_cast<const char*>(u8"가\u11A7가\u11A7가\u11A7"));
     std::string result8;
     StringByteSink<std::string> sink(&result8, static_cast<int32_t>(expected8.length()));
     nfkc->normalizeUTF8(0, s8, sink, nullptr, errorCode);