Apache Lucene open-source search software
As BytesRef has now native order use them in numeric tests. The contents are raw byte[] and no strings, it should compare native
Uwe Schindler55b373f5ed29
diff --git a/lucene/src/test/org/apache/lucene/util/TestNumericUtils.java b/lucene/src/test/org/apache/lucene/util/TestNumericUtils.javaindex cc945133691..1bb32b2bd81 100644--- a/lucene/src/test/org/apache/lucene/util/TestNumericUtils.java+++ b/lucene/src/test/org/apache/lucene/util/TestNumericUtils.java@@ -31,7 +31,7 @@ public class TestNumericUtils extends LuceneTestCase {NumericUtils.longToPrefixCoded(l, 0, act);if (last!=null) {// test if smaller- assertTrue("actual bigger than last (BytesRef)", BytesRef.getUTF8SortedAsUnicodeComparator().compare(last, act) < 0 );+ assertTrue("actual bigger than last (BytesRef)", last.compareTo(act) < 0 );assertTrue("actual bigger than last (as String)", last.utf8ToString().compareTo(act.utf8ToString()) < 0 );}// test is back and forward conversion works@@ -49,7 +49,7 @@ public class TestNumericUtils extends LuceneTestCase {NumericUtils.intToPrefixCoded(i, 0, act);if (last!=null) {// test if smaller- assertTrue("actual bigger than last (BytesRef)", BytesRef.getUTF8SortedAsUnicodeComparator().compare(last, act) < 0 );+ assertTrue("actual bigger than last (BytesRef)", last.compareTo(act) < 0 );assertTrue("actual bigger than last (as String)", last.utf8ToString().compareTo(act.utf8ToString()) < 0 );}// test is back and forward conversion works@@ -85,7 +85,7 @@ public class TestNumericUtils extends LuceneTestCase {// check sort order (prefixVals should be ascending)for (int i=1; i<prefixVals.length; i++) {- assertTrue( "check sort order", BytesRef.getUTF8SortedAsUnicodeComparator().compare(prefixVals[i-1], prefixVals[i] ) < 0 );+ assertTrue( "check sort order", prefixVals[i-1].compareTo(prefixVals[i]) < 0 );}// check the prefix encoding, lower precision should have the difference to original value equal to the lower removed bits@@ -125,7 +125,7 @@ public class TestNumericUtils extends LuceneTestCase {// check sort order (prefixVals should be ascending)for (int i=1; i<prefixVals.length; i++) {- assertTrue( "check sort order", BytesRef.getUTF8SortedAsUnicodeComparator().compare(prefixVals[i-1], prefixVals[i] ) < 0 );+ assertTrue( "check sort order", prefixVals[i-1].compareTo(prefixVals[i]) < 0 );}// check the prefix encoding, lower precision should have the difference to original value equal to the lower removed bits