Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Fix test bug.

Adrien Grandffabbc9ddab7
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestSorterTemplate.java b/lucene/core/src/test/org/apache/lucene/util/TestSorterTemplate.java
index f43ffa46428..00e63fb057c 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestSorterTemplate.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestSorterTemplate.java
@@ -111,9 +111,11 @@ public class TestSorterTemplate extends LuceneTestCase {
}
int randomLength() {
- return random().nextBoolean()
- ? random().nextInt(SLOW_SORT_THRESHOLD)
- : random().nextInt(100000);
+ return _TestUtil.nextInt(random(), 1, random().nextBoolean() ? SLOW_SORT_THRESHOLD : 100000);
+ }
+
+ public void testEmpty() {
+ testSort(new int[0]);
}
public void testAscending() {