Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(795)

Unified Diff: icu4c/source/test/intltest/ucdtest.cpp

Issue 335150043: Refreshing Number Parsing: ICU4J Base URL: svn+icussh://source.icu-project.org/repos/icu/trunk/
Patch Set: Replying to Andy feedback round one. See commit message. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu4c/source/test/intltest/ucdtest.h ('k') | icu4j » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu4c/source/test/intltest/ucdtest.cpp
===================================================================
--- icu4c/source/test/intltest/ucdtest.cpp (revision 40724)
+++ icu4c/source/test/intltest/ucdtest.cpp (working copy)
@@ -63,6 +63,7 @@
TESTCASE_AUTO(TestBidiPairedBracketType);
TESTCASE_AUTO(TestEmojiProperties);
TESTCASE_AUTO(TestDefaultScriptExtensions);
+ TESTCASE_AUTO(TestInvalidCodePointFolding);
TESTCASE_AUTO_END;
}
@@ -546,3 +547,21 @@
uscript_getScriptExtensions(0x3012, scx, UPRV_LENGTHOF(scx), errorCode));
assertEquals("U+3012 num scx[0]", USCRIPT_COMMON, scx[0]);
}
+
+void UnicodeTest::TestInvalidCodePointFolding(void) {
+ // Test behavior when an invalid code point is passed to u_foldCase
+ static const UChar32 invalidCodePoints[] = {
+ 0xD800, // lead surrogate
+ 0xDFFF, // trail surrogate
+ 0xFDD0, // noncharacter
+ 0xFFFF, // noncharacter
+ 0x110000, // out of range
+ -1 // negative
+ };
+ for (auto cp : invalidCodePoints) {
+ assertEquals("Invalid code points should be echoed back",
+ cp, u_foldCase(cp, U_FOLD_CASE_DEFAULT));
+ assertEquals("Invalid code points should be echoed back",
+ cp, u_foldCase(cp, U_FOLD_CASE_EXCLUDE_SPECIAL_I));
+ }
+}
« no previous file with comments | « icu4c/source/test/intltest/ucdtest.h ('k') | icu4j » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b