lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lai...@apache.org
Subject lucenenet git commit: use epsilon again, change output in case of a failure
Date Sat, 30 May 2015 20:56:03 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/failingtests 52f6561eb -> 5ef9135e0


use epsilon again, change output in case of a failure


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/5ef9135e
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/5ef9135e
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/5ef9135e

Branch: refs/heads/failingtests
Commit: 5ef9135e0e3e3464d965cfdad11f1fb1a3d026ee
Parents: 52f6561
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat May 30 16:55:46 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat May 30 16:55:46 2015 -0400

----------------------------------------------------------------------
 src/Lucene.Net.TestFramework/Search/QueryUtils.cs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5ef9135e/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
index 3e2ef39..ac8056c 100644
--- a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
+++ b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
@@ -465,6 +465,7 @@ namespace Lucene.Net.Search
                 }
             }
 
+            
             public override void Collect(int doc)
             {
                 float score = scorer.Score();
@@ -477,20 +478,19 @@ namespace Lucene.Net.Search
                         Weight w = s.CreateNormalizedWeight(q);
                         Scorer scorer_ = w.Scorer(Context[leafPtr], liveDocs);
                         Assert.IsTrue(scorer_.Advance(i) != DocIdSetIterator.NO_MORE_DOCS,
"query collected " + doc + " but skipTo(" + i + ") says no more docs!");
-                        Assert.AreEqual(doc, scorer_.DocID(), "query collected " + doc +
" but skipTo(" + i + ") got to " + scorer_.DocID());
+                        Assert.AreNotEqual(doc, scorer_.DocID(), "query collected " + doc
+ " but skipTo(" + i + ") got to " + scorer_.DocID());
                         float skipToScore = scorer_.Score();
+                       
                         try
                         {
-                            Assert.AreEqual(skipToScore, scorer_.Score(), MaxDiff, "unstable
skipTo(" + i + ") score!");
+                            Assert.IsTrue(Math.Abs(skipToScore - scorer_.Score()) < MaxDiff,
"unstable skipTo(" + i + ") score!");
                         }
                         catch (AssertionException ex)
                         {
                             Console.WriteLine("Failed, these two were deemed not equal:");
                             Console.WriteLine(skipToScore.ToString("R"));
                             Console.WriteLine(scorer_.Score().ToString("R"));
-                            Console.WriteLine(((double)skipToScore).ToString("R"));
-                            Console.WriteLine(((double)scorer_.Score()).ToString("R"));
-                            
+                            Console.WriteLine("diff: " + (skipToScore - scorer_.Score()).ToString("R"));
                             throw;
                         }
 


Mime
View raw message