2001-03-21 18:10:38 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
2001-03-21 20:09:56 +00:00
|
|
|
* Copyright (c) 1997-2001, International Business Machines Corporation and
|
2001-03-21 18:10:38 +00:00
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
2002-09-21 00:43:14 +00:00
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
|
|
|
|
#if !UCONFIG_NO_COLLATION
|
|
|
|
|
2001-03-21 18:10:38 +00:00
|
|
|
#ifndef _COLL
|
|
|
|
#include "unicode/coll.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _TBLCOLL
|
|
|
|
#include "unicode/tblcoll.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _UNISTR
|
|
|
|
#include "unicode/unistr.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _SORTKEY
|
|
|
|
#include "unicode/sortkey.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "lcukocol.h"
|
|
|
|
|
|
|
|
#include "sfwdchit.h"
|
|
|
|
|
|
|
|
LotusCollationKoreanTest::LotusCollationKoreanTest()
|
|
|
|
: myCollation(0)
|
|
|
|
{
|
|
|
|
UErrorCode status = U_ZERO_ERROR;
|
|
|
|
myCollation = Collator::createInstance("ko_kr", status);
|
2002-08-21 19:09:33 +00:00
|
|
|
myCollation->setAttribute(UCOL_NORMALIZATION_MODE, UCOL_ON, status);
|
2001-03-21 18:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LotusCollationKoreanTest::~LotusCollationKoreanTest()
|
|
|
|
{
|
|
|
|
delete myCollation;
|
|
|
|
}
|
|
|
|
|
|
|
|
const UChar LotusCollationKoreanTest::testSourceCases[][LotusCollationKoreanTest::MAX_TOKEN_LEN] = {
|
2002-04-02 02:55:31 +00:00
|
|
|
{0xac00, 0}
|
2001-03-21 18:10:38 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const UChar LotusCollationKoreanTest::testTargetCases[][LotusCollationKoreanTest::MAX_TOKEN_LEN] = {
|
2002-04-02 02:55:31 +00:00
|
|
|
{0xac01, 0}
|
2001-03-21 18:10:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const Collator::EComparisonResult LotusCollationKoreanTest::results[] = {
|
|
|
|
Collator::LESS
|
|
|
|
};
|
|
|
|
|
|
|
|
void LotusCollationKoreanTest::TestTertiary(/* char* par */)
|
|
|
|
{
|
|
|
|
int32_t i = 0;
|
2002-04-02 02:55:31 +00:00
|
|
|
myCollation->setStrength(Collator::TERTIARY);
|
|
|
|
|
2001-03-21 18:10:38 +00:00
|
|
|
for (i = 0; i < 1; i++) {
|
2003-02-14 07:14:02 +00:00
|
|
|
doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
|
2001-03-21 18:10:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void LotusCollationKoreanTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ )
|
|
|
|
{
|
|
|
|
if (exec) logln("TestSuite LotusCollationKoreanTest: ");
|
|
|
|
switch (index) {
|
|
|
|
case 0: name = "TestTertiary"; if (exec) TestTertiary(/* par */); break;
|
|
|
|
default: name = ""; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif /* #if !UCONFIG_NO_COLLATION */
|