Package com.ibm.icu.dev.test.util

Examples of com.ibm.icu.dev.test.util.UnicodeMap


    new UnicodeMapTest().run(args);
  }
 
  public void TestModify() {
    Random random = new Random(0);
    UnicodeMap unicodeMap = new UnicodeMap();
    HashMap hashMap = new HashMap();
    String[] values = {null, "the", "quick", "brown", "fox"};
    for (int count = 1; count <= MODIFY_TEST_ITERATIONS; ++count) {
      String value = values[random.nextInt(values.length)];
      int start = random.nextInt(MODIFY_TEST_LIMIT); // test limited range
      int end = random.nextInt(MODIFY_TEST_LIMIT);
      if (start > end) {
        int temp = start;
        start = end;
        end = temp;
      }
      int modCount = count & 0xFF;
      if (modCount == 0 && isVerbose()) {
        logln("***"+count);
        logln(unicodeMap.toString());
      }
      unicodeMap.putAll(start, end, value);
      if (modCount == 1 && isVerbose()) {
        logln(">>>\t" + Utility.hex(start) + ".." + Utility.hex(end) + "\t" + value);
        logln(unicodeMap.toString());
      }
      for (int i = start; i <= end; ++i) {
        hashMap.put(new Integer(i), value);
      }
      if (!hasSameValues(unicodeMap, hashMap)) {
View Full Code Here

TOP

Related Classes of com.ibm.icu.dev.test.util.UnicodeMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.