OLD | NEW |
1 /******************************************************************** | 1 /******************************************************************** |
2 * Copyright (c) 1997-2009, International Business Machines | 2 * Copyright (c) 1997-2009,2014, International Business Machines |
3 * Corporation and others. All Rights Reserved. | 3 * Corporation and others. All Rights Reserved. |
4 ********************************************************************/ | 4 ********************************************************************/ |
5 | 5 |
6 #include "unicode/utypes.h" | 6 #include "unicode/utypes.h" |
7 | 7 |
8 #if !UCONFIG_NO_COLLATION | 8 #if !UCONFIG_NO_COLLATION |
9 | 9 |
10 #ifndef _COLL | 10 #ifndef _COLL |
11 #include "unicode/coll.h" | 11 #include "unicode/coll.h" |
12 #endif | 12 #endif |
(...skipping 22 matching lines...) Expand all Loading... |
35 UErrorCode status = U_ZERO_ERROR; | 35 UErrorCode status = U_ZERO_ERROR; |
36 myCollation = Collator::createInstance(Locale("fi", "FI", "", "collation=sta
ndard"),status); | 36 myCollation = Collator::createInstance(Locale("fi", "FI", "", "collation=sta
ndard"),status); |
37 } | 37 } |
38 | 38 |
39 CollationFinnishTest::~CollationFinnishTest() | 39 CollationFinnishTest::~CollationFinnishTest() |
40 { | 40 { |
41 delete myCollation; | 41 delete myCollation; |
42 } | 42 } |
43 | 43 |
44 const UChar CollationFinnishTest::testSourceCases[][CollationFinnishTest::MAX_TO
KEN_LEN] = { | 44 const UChar CollationFinnishTest::testSourceCases[][CollationFinnishTest::MAX_TO
KEN_LEN] = { |
45 {0x77, 0x61, 0x74, 0}, | 45 {0x77, 0x61, 0x74, 0}, // "wat" |
46 {0x76, 0x61, 0x74, 0}, | 46 {0x76, 0x61, 0x74, 0}, // "vat" |
47 {0x61, 0x00FC, 0x62, 0x65, 0x63, 0x6b, 0}, | 47 {0x61, 0x00FC, 0x62, 0x65, 0x63, 0x6b, 0}, |
48 {0x4c, 0x00E5, 0x76, 0x69, 0}, | 48 {0x4c, 0x00E5, 0x76, 0x69, 0}, |
49 {0x77, 0x61, 0x74, 0} | 49 {0x77, 0x61, 0x74, 0} // "wat" |
50 }; | 50 }; |
51 | 51 |
52 const UChar CollationFinnishTest::testTargetCases[][CollationFinnishTest::MAX_TO
KEN_LEN] = { | 52 const UChar CollationFinnishTest::testTargetCases[][CollationFinnishTest::MAX_TO
KEN_LEN] = { |
53 {0x76, 0x61, 0x74, 0}, | 53 {0x76, 0x61, 0x74, 0}, // "vat" |
54 {0x77, 0x61, 0x79, 0}, | 54 {0x77, 0x61, 0x79, 0}, |
55 {0x61, 0x78, 0x62, 0x65, 0x63, 0x6b, 0}, | 55 {0x61, 0x78, 0x62, 0x65, 0x63, 0x6b, 0}, |
56 {0x4c, 0x00E4, 0x77, 0x65, 0}, | 56 {0x4c, 0x00E4, 0x77, 0x65, 0}, |
57 {0x76, 0x61, 0x74, 0} | 57 {0x76, 0x61, 0x74, 0} // "vat" |
58 }; | 58 }; |
59 | 59 |
60 const Collator::EComparisonResult CollationFinnishTest::results[] = { | 60 const Collator::EComparisonResult CollationFinnishTest::results[] = { |
61 Collator::GREATER, | 61 Collator::GREATER, |
62 Collator::LESS, | 62 Collator::LESS, |
63 Collator::GREATER, | 63 Collator::GREATER, |
64 Collator::LESS, | 64 Collator::LESS, |
65 // test primary > 4 | 65 // test primary > 4 |
66 Collator::EQUAL, | 66 Collator::GREATER, // v < w per cldrbug 6615 |
67 }; | 67 }; |
68 | 68 |
69 void CollationFinnishTest::TestTertiary(/* char* par */) | 69 void CollationFinnishTest::TestTertiary(/* char* par */) |
70 { | 70 { |
71 int32_t i = 0; | 71 int32_t i = 0; |
72 myCollation->setStrength(Collator::TERTIARY); | 72 myCollation->setStrength(Collator::TERTIARY); |
73 for (i = 0; i < 4 ; i++) { | 73 for (i = 0; i < 4 ; i++) { |
74 doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]); | 74 doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]); |
75 } | 75 } |
76 } | 76 } |
(...skipping 16 matching lines...) Expand all Loading... |
93 return; | 93 return; |
94 } | 94 } |
95 switch (index) { | 95 switch (index) { |
96 case 0: name = "TestPrimary"; if (exec) TestPrimary(/* par */); brea
k; | 96 case 0: name = "TestPrimary"; if (exec) TestPrimary(/* par */); brea
k; |
97 case 1: name = "TestTertiary"; if (exec) TestTertiary(/* par */); bre
ak; | 97 case 1: name = "TestTertiary"; if (exec) TestTertiary(/* par */); bre
ak; |
98 default: name = ""; break; | 98 default: name = ""; break; |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 #endif /* #if !UCONFIG_NO_COLLATION */ | 102 #endif /* #if !UCONFIG_NO_COLLATION */ |
OLD | NEW |