public override void Run() { for (int i = 0; i < 10000; i++) { actualName = UChar.GetName(codePoint); if (!correctName.Equals(actualName)) { break; } } }
public void TestUCharactersGetName() { List <GetNameThread> threads = new List <GetNameThread>(); for (int t = 0; t < 20; t++) { int codePoint = 47 + t; String correctName = UChar.GetName(codePoint); GetNameThread thread = new GetNameThread(codePoint, correctName); thread.Start(); threads.Add(thread); } foreach (var thread in threads) { thread.Join(); if (!thread.correctName.Equals(thread.actualName)) { Errln("FAIL, expected \"" + thread.correctName + "\", got \"" + thread.actualName + "\""); } } }
public void TestRoundTrip() { int options = Normalizer.IGNORE_HANGUL; bool compat = false; ComposedCharIter iter = new ComposedCharIter(false, options); while (iter.HasNext) { char ch = iter.Next(); string chStr = "" + ch; string decomp = iter.Decomposition(); string comp = Normalizer.Compose(decomp, compat); if (UChar.HasBinaryProperty(ch, UProperty.Full_Composition_Exclusion)) { Logln("Skipped excluded char " + Hex(ch) + " (" + UChar.GetName(ch) + ")"); continue; } // Avoid disparaged characters if (decomp.Length == 4) { continue; } if (!comp.Equals(chStr)) { Errln("ERROR: Round trip invalid: " + Hex(chStr) + " --> " + Hex(decomp) + " --> " + Hex(comp)); Errln(" char decomp is '" + decomp + "'"); } } }