From: Norbert Runge Date: Fri, 16 Jun 2017 23:02:41 +0000 (+0000) Subject: ICU-13241 removes obsolete test code that does not test anything from ICU. X-Git-Tag: milestone-60-0-1~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=229a0cb38163146e3a135eb0dbe89374eddfb2b0;p=icu ICU-13241 removes obsolete test code that does not test anything from ICU. X-SVN-Rev: 40173 --- diff --git a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/TestComparator.java b/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/TestComparator.java deleted file mode 100644 index 6a2b0a68d04..00000000000 --- a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/TestComparator.java +++ /dev/null @@ -1,84 +0,0 @@ -// © 2016 and later: Unicode, Inc. and others. -// License & terms of use: http://www.unicode.org/copyright.html#License -/* - ******************************************************************************* - * Copyright (C) 2002-2010, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - */ - - -package com.ibm.icu.dev.test.collator; - -import java.util.Comparator; - -import org.junit.Ignore; -import org.junit.Test; - -public class TestComparator { - - // TODO(junit): apparently orphaned - added dummy test to pass ant junit - @Ignore - @Test - public void dummyTest() {} - - // test the symmetry and transitivity - public void test(Comparator comp, int count) { - Object c = null; - Object b = newObject(c); - Object a = newObject(b); - int compab = comp.compare(a,b); - while (--count >= 0) { - // rotate old values - c = b; - b = a; - int compbc = compab; - - // allocate new and get comparisons - a = newObject(b); - compab = comp.compare(a,b); - int compba = comp.compare(b,a); - int compac = comp.compare(a,c); - - // check symmetry - if (compab != -compba) { - log("Symmetry Failure", new Object[] {a, b}); - } - - // check transitivity - check(a, b, c, compab, compbc, compac); - check(a, c, b, compab, -compbc, compab); - check(b, a, c, -compab, compac, compbc); - check(b, c, a, compbc, -compac, -compab); - check(c, a, b, -compac, compab, -compbc); - check(c, b, a, -compbc, -compab, -compac); - } - } - - private void check(Object a, Object b, Object c, - int compab, int compbc, int compac) { - if (compab <= 0 && compbc <= 0 && !(compac <= 0)) { - log("Transitivity Failure", new Object[] {a, b, c}); - } - } - - public Object newObject(Object c) { - // return a new object - return ""; - } - - public String format(Object c) { - // return a new object - return c.toString(); - } - - public void log(String title, Object[] arguments) { - String result = title + ": ["; - for (int i = 0; i < arguments.length; ++i) { - if (i != 0) result += ", "; - result += format(arguments[i]); - } - result += "]"; - throw new RuntimeException(result); - } -} \ No newline at end of file