Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: icu46/source/test/intltest/trcoll.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/test/intltest/trcoll.h ('k') | icu46/source/test/intltest/trnserr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/test/intltest/trcoll.cpp
===================================================================
--- icu46/source/test/intltest/trcoll.cpp (revision 0)
+++ icu46/source/test/intltest/trcoll.cpp (revision 0)
@@ -0,0 +1,106 @@
+/********************************************************************
+ * COPYRIGHT:
+ * Copyright (c) 1997-2009, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ ********************************************************************/
+
+#include "unicode/unistr.h"
+
+#if !UCONFIG_NO_COLLATION
+
+#include "unicode/tstdtmod.h"
+#include "unicode/coll.h"
+#include "unicode/tblcoll.h"
+#include "unicode/sortkey.h"
+#include "trcoll.h"
+#include "sfwdchit.h"
+
+CollationTurkishTest::CollationTurkishTest()
+: myCollation(0)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ myCollation = Collator::createInstance(Locale("tr", "", ""),status);
+}
+
+CollationTurkishTest::~CollationTurkishTest()
+{
+ delete myCollation;
+}
+
+const UChar CollationTurkishTest::testSourceCases[][CollationTurkishTest::MAX_TOKEN_LEN] = {
+ {0x73, 0x0327, 0},
+ {0x76, 0x00E4, 0x74, 0},
+ {0x6f, 0x6c, 0x64, 0},
+ {0x00FC, 0x6f, 0x69, 0x64, 0},
+ {0x68, 0x011E, 0x61, 0x6c, 0x74, 0},
+ {0x73, 0x74, 0x72, 0x65, 0x73, 0x015E, 0},
+ {0x76, 0x6f, 0x0131, 0x64, 0},
+ {0x69, 0x64, 0x65, 0x61, 0},
+ {0x00FC, 0x6f, 0x69, 0x64, 0},
+ {0x76, 0x6f, 0x0131, 0x64, 0},
+ {0x69, 0x64, 0x65, 0x61, 0}
+};
+
+const UChar CollationTurkishTest::testTargetCases[][CollationTurkishTest::MAX_TOKEN_LEN] = {
+ {0x75, 0x0308, 0},
+ {0x76, 0x62, 0x74, 0},
+ {0x00D6, 0x61, 0x79, 0},
+ {0x76, 0x6f, 0x69, 0x64, 0},
+ {0x68, 0x61, 0x6c, 0x74, 0},
+ {0x015E, 0x74, 0x72, 0x65, 0x015E, 0x73, 0},
+ {0x76, 0x6f, 0x69, 0x64, 0},
+ {0x49, 0x64, 0x65, 0x61, 0},
+ {0x76, 0x6f, 0x69, 0x64, 0},
+ {0x76, 0x6f, 0x69, 0x64, 0},
+ {0x49, 0x64, 0x65, 0x61, 0}
+};
+
+const Collator::EComparisonResult CollationTurkishTest::results[] = {
+ Collator::LESS,
+ Collator::LESS,
+ Collator::LESS,
+ Collator::LESS,
+ Collator::GREATER,
+ Collator::LESS,
+ Collator::LESS,
+ Collator::GREATER,
+ // test priamry > 8
+ Collator::LESS,
+ Collator::LESS,
+ Collator::GREATER
+};
+
+void CollationTurkishTest::TestTertiary(/* char* par */)
+{
+ int32_t i = 0;
+ myCollation->setStrength(Collator::TERTIARY);
+ for (i = 0; i < 8 ; i++) {
+ doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
+ }
+}
+void CollationTurkishTest::TestPrimary(/* char* par */)
+{
+ int32_t i;
+ myCollation->setStrength(Collator::PRIMARY);
+ for (i = 8; i < 11; i++) {
+ doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
+ }
+}
+
+void CollationTurkishTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ )
+{
+ if (exec) logln("TestSuite CollationTurkishTest: ");
+
+ if((!myCollation) && exec) {
+ dataerrln(__FILE__ " cannot test - failed to create collator.");
+ name = "some test";
+ return;
+ }
+ switch (index) {
+ case 0: name = "TestPrimary"; if (exec) TestPrimary(/* par */); break;
+ case 1: name = "TestTertiary"; if (exec) TestTertiary(/* par */); break;
+ default: name = ""; break;
+ }
+}
+
+#endif /* #if !UCONFIG_NO_COLLATION */
Property changes on: icu46/source/test/intltest/trcoll.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « icu46/source/test/intltest/trcoll.h ('k') | icu46/source/test/intltest/trnserr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698