lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1477453 - /lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
Date Tue, 30 Apr 2013 02:48:47 GMT
Author: rmuir
Date: Tue Apr 30 02:48:46 2013
New Revision: 1477453

URL: http://svn.apache.org/r1477453
Log:
use a relative epsilon in case we get a crazy sim

Modified:
    lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java

Modified: lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java?rev=1477453&r1=1477452&r2=1477453&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
(original)
+++ lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
Tue Apr 30 02:48:46 2013
@@ -22,6 +22,7 @@ import org.apache.lucene.queries.functio
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.CheckHits;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.search.IndexSearcher;
@@ -337,19 +338,19 @@ public class TestCustomScoreQuery extend
       
       float score2 = h2customNeutral.get(doc);
       logResult("score2=", s, q2, doc, score2);
-      assertEquals("same score (just boosted) for neutral", boost * score1, score2, TEST_SCORE_TOLERANCE_DELTA);
+      assertEquals("same score (just boosted) for neutral", boost * score1, score2, CheckHits.explainToleranceDelta(boost
* score1, score2));
 
       float score3 = h3CustomMul.get(doc);
       logResult("score3=", s, q3, doc, score3);
-      assertEquals("new score for custom mul", boost * fieldScore * score1, score3, TEST_SCORE_TOLERANCE_DELTA);
+      assertEquals("new score for custom mul", boost * fieldScore * score1, score3, CheckHits.explainToleranceDelta(boost
* fieldScore * score1, score3));
       
       float score4 = h4CustomAdd.get(doc);
       logResult("score4=", s, q4, doc, score4);
-      assertEquals("new score for custom add", boost * (fieldScore + score1), score4, TEST_SCORE_TOLERANCE_DELTA);
+      assertEquals("new score for custom add", boost * (fieldScore + score1), score4, CheckHits.explainToleranceDelta(boost
* (fieldScore + score1), score4));
       
       float score5 = h5CustomMulAdd.get(doc);
       logResult("score5=", s, q5, doc, score5);
-      assertEquals("new score for custom mul add", boost * fieldScore * (score1 + fieldScore),
score5, TEST_SCORE_TOLERANCE_DELTA);
+      assertEquals("new score for custom mul add", boost * fieldScore * (score1 + fieldScore),
score5, CheckHits.explainToleranceDelta(boost * fieldScore * (score1 + fieldScore), score5));
     }
   }
 



Mime
View raw message