/* GENERATED SOURCE. DO NOT MODIFY. */ // © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html#License /* ******************************************************************************* * Copyright (C) 1996-2010, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* */ package android.icu.dev.test.normalizer; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import android.icu.dev.test.TestFmwk; import android.icu.impl.Utility; import android.icu.lang.UCharacter; import android.icu.lang.UProperty; import android.icu.text.ComposedCharIter; import android.icu.text.Normalizer; import android.icu.text.StringCharacterIterator; import android.icu.testsharding.MainTestShard; @MainTestShard @RunWith(JUnit4.class) public class TestDeprecatedNormalizerAPI extends TestFmwk { public TestDeprecatedNormalizerAPI() { } @Test public void TestNormalizerAPI(){ // instantiate a Normalizer from a CharacterIterator String s=Utility.unescape("a\u0308\uac00\\U0002f800"); // make s a bit longer and more interesting java.text.CharacterIterator iter = new StringCharacterIterator(s+s); //test deprecated constructors Normalizer norm = new Normalizer(iter, Normalizer.NFC,0); if(norm.next()!=0xe4) { errln("error in Normalizer(CharacterIterator).next()"); } Normalizer norm2 = new Normalizer(s,Normalizer.NFC,0); if(norm2.next()!=0xe4) { errln("error in Normalizer(CharacterIterator).next()"); } // test clone(), ==, and hashCode() Normalizer clone=(Normalizer)norm.clone(); if(clone.getBeginIndex()!= norm.getBeginIndex()){ errln("error in Normalizer.getBeginIndex()"); } if(clone.getEndIndex()!= norm.getEndIndex()){ errln("error in Normalizer.getEndIndex()"); } // test setOption() and getOption() clone.setOption(0xaa0000, true); clone.setOption(0x20000, false); if(clone.getOption(0x880000) ==0|| clone.getOption(0x20000)==1) { errln("error in Normalizer::setOption() or Normalizer::getOption()"); } //test deprecated normalize method Normalizer.normalize(s,Normalizer.NFC,0); //test deprecated compose method Normalizer.compose(s,false,0); //test deprecated decompose method Normalizer.decompose(s,false,0); } /** * Run through all of the characters returned by a composed-char iterator * and make sure that: *