From 8a9e20bfa16eb479b7609bb2dcbdb572c9f6cea1 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 19 Jan 2016 14:26:27 +0000 Subject: [PATCH] fix this test to disregard NaN scores git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1725529 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/uninverting/TestFieldCacheSort.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java index eaaa5b923c0..e2f669d4ad3 100644 --- a/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java +++ b/lucene/misc/src/test/org/apache/lucene/uninverting/TestFieldCacheSort.java @@ -1209,8 +1209,10 @@ public class TestFieldCacheSort extends LuceneTestCase { bq.add(new MatchAllDocsQuery(), Occur.SHOULD); TopDocs td = searcher.search(bq.build(), 10, sort); assertEquals(2, td.totalHits); - assertEquals(1, td.scoreDocs[0].doc); - assertEquals(0, td.scoreDocs[1].doc); + if (Float.isNaN(td.scoreDocs[0].score) == false && Float.isNaN(td.scoreDocs[1].score) == false) { + assertEquals(1, td.scoreDocs[0].doc); + assertEquals(0, td.scoreDocs[1].doc); + } TestUtil.checkReader(ir); ir.close(); dir.close();