mirror of https://github.com/apache/lucene.git
LUCENE-6697: test bug: the stupid-simple-yet-hopefully-bug-free numeric range filter was buggy
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1693800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2e077c1516
commit
0efca23e6e
|
@ -402,6 +402,9 @@ public class TestRangeTree extends LuceneTestCase {
|
|||
}
|
||||
}
|
||||
if (random().nextBoolean()) {
|
||||
if (VERBOSE) {
|
||||
System.out.println(" forceMerge(1)");
|
||||
}
|
||||
w.forceMerge(1);
|
||||
}
|
||||
final IndexReader r = DirectoryReader.open(w, true);
|
||||
|
@ -514,17 +517,21 @@ public class TestRangeTree extends LuceneTestCase {
|
|||
}
|
||||
|
||||
private static boolean matches(long lower, boolean includeLower, long upper, boolean includeUpper, long value) {
|
||||
if (value > lower && value < upper) {
|
||||
return true;
|
||||
}
|
||||
if (value == lower && includeLower) {
|
||||
return true;
|
||||
}
|
||||
if (value == upper && includeUpper) {
|
||||
return true;
|
||||
}
|
||||
if (includeLower == false) {
|
||||
if (lower == Long.MAX_VALUE) {
|
||||
return false;
|
||||
}
|
||||
lower++;
|
||||
}
|
||||
if (includeUpper == false) {
|
||||
if (upper == Long.MIN_VALUE) {
|
||||
return false;
|
||||
}
|
||||
upper--;
|
||||
}
|
||||
|
||||
return value >= lower && value <= upper;
|
||||
}
|
||||
|
||||
private static long randomValue() {
|
||||
if (valueRange == 0) {
|
||||
|
|
Loading…
Reference in New Issue