From 3aa3ae6073af49b9167674f1e89f2899bede9128 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 12 Aug 2014 23:36:45 +0000 Subject: [PATCH] test: reset count1=0 in beforeClass git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1617625 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/search/TestBooleanUnevenly.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanUnevenly.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanUnevenly.java index bc194b793ad..3aa50209a4f 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanUnevenly.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanUnevenly.java @@ -40,13 +40,14 @@ public class TestBooleanUnevenly extends LuceneTestCase { public static final String field = "field"; private static Directory directory; - private static int count1 = 0; + private static int count1; @BeforeClass public static void beforeClass() throws Exception { directory = newDirectory(); RandomIndexWriter w = new RandomIndexWriter(random(), directory, new MockAnalyzer(random())); Document doc; + count1 = 0; for (int i=0;i<2;i++) { for (int j=0;j<2048;j++) { doc = new Document(); @@ -102,8 +103,8 @@ public class TestBooleanUnevenly extends LuceneTestCase { ScoreDoc[] hits2 = tops2.scoreDocs; int hitsNum2 = tops2.totalHits; - assertEquals(hitsNum1, count1); - assertEquals(hitsNum2, count1); + assertEquals(count1, hitsNum1); + assertEquals(count1, hitsNum2); CheckHits.checkEqual(query, hits1, hits2); } @@ -125,8 +126,8 @@ public class TestBooleanUnevenly extends LuceneTestCase { ScoreDoc[] hits2 = tops2.scoreDocs; int hitsNum2 = tops2.totalHits; - assertEquals(hitsNum1, count1); - assertEquals(hitsNum2, count1); + assertEquals(count1, hitsNum1); + assertEquals(count1, hitsNum2); CheckHits.checkEqual(query, hits1, hits2); } }