]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/lcukocol.cpp
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1997-2009, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
9 #include "unicode/utypes.h"
11 #if !UCONFIG_NO_COLLATION
14 #include "unicode/coll.h"
18 #include "unicode/tblcoll.h"
22 #include "unicode/unistr.h"
26 #include "unicode/sortkey.h"
33 LotusCollationKoreanTest::LotusCollationKoreanTest()
36 UErrorCode status
= U_ZERO_ERROR
;
37 myCollation
= Collator::createInstance("ko_kr", status
);
38 if(U_SUCCESS(status
)) {
39 myCollation
->setAttribute(UCOL_NORMALIZATION_MODE
, UCOL_ON
, status
);
41 errcheckln(status
, "Couldn't instantiate the collator with %s", u_errorName(status
));
48 LotusCollationKoreanTest::~LotusCollationKoreanTest()
53 const UChar
LotusCollationKoreanTest::testSourceCases
[][LotusCollationKoreanTest::MAX_TOKEN_LEN
] = {
58 const UChar
LotusCollationKoreanTest::testTargetCases
[][LotusCollationKoreanTest::MAX_TOKEN_LEN
] = {
62 const Collator::EComparisonResult
LotusCollationKoreanTest::results
[] = {
66 void LotusCollationKoreanTest::TestTertiary(/* char* par */)
69 myCollation
->setStrength(Collator::TERTIARY
);
71 for (i
= 0; i
< 1; i
++) {
72 doTest(myCollation
, testSourceCases
[i
], testTargetCases
[i
], results
[i
]);
76 void LotusCollationKoreanTest::runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* /*par*/ )
78 if (exec
) logln("TestSuite LotusCollationKoreanTest: ");
81 case 0: name
= "TestTertiary"; if (exec
) TestTertiary(/* par */); break;
82 default: name
= ""; break;
85 dataerrln("Class collator not instantiated");
90 #endif /* #if !UCONFIG_NO_COLLATION */