// logln("Using ko__LOTUS locale\n");
// genericLocaleStarter(new Locale("ko__LOTUS", ""), koreanData);
}
public void TestIncrementalNormalize() {
Collator coll = null;
// logln("Test 1 ....");
{
/* Test 1. Run very long unnormalized strings, to force overflow of*/
/* most buffers along the way.*/
try {
coll = Collator.getInstance(new Locale("en", "US"));
} catch (Exception e) {
warnln("Cannot get default instance!");
return;
}
char baseA =0x41;
char ccMix[] = {0x316, 0x321, 0x300};
int sLen;
int i;
StringBuffer strA = new StringBuffer();
StringBuffer strB = new StringBuffer();
coll.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
for (sLen = 1000; sLen<1001; sLen++) {
strA.delete(0, strA.length());
strA.append(baseA);
strB.delete(0, strB.length());
strB.append(baseA);
for (i=1; i< sLen; i++) {
strA.append(ccMix[i % 3]);
strB.insert(1, ccMix[i % 3]);
}
coll.setStrength(Collator.TERTIARY); // Do test with default strength, which runs
CollationTest.doTest(this, (RuleBasedCollator)coll,
strA.toString(), strB.toString(), 0); // optimized functions in the impl
coll.setStrength(Collator.IDENTICAL); // Do again with the slow, general impl.
CollationTest.doTest(this, (RuleBasedCollator)coll,
strA.toString(), strB.toString(), 0);
}
}
/* Test 2: Non-normal sequence in a string that extends to the last character*/
/* of the string. Checks a couple of edge cases.*/
// logln("Test 2 ....");
{
String strA = "AA\u0300\u0316";
String strB = "A\u00c0\u0316";
coll.setStrength(Collator.TERTIARY);
CollationTest.doTest(this, (RuleBasedCollator)coll, strA, strB, 0);
}
/* Test 3: Non-normal sequence is terminated by a surrogate pair.*/
// logln("Test 3 ....");
{
String strA = "AA\u0300\u0316\uD800\uDC01";
String strB = "A\u00c0\u0316\uD800\uDC00";
coll.setStrength(Collator.TERTIARY);
CollationTest.doTest(this, (RuleBasedCollator)coll, strA, strB, 1);
}
/* Test 4: Imbedded nulls do not terminate a string when length is specified.*/
// logln("Test 4 ....");
/*