lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [16/18] lucenenet git commit: Fixed "index out of range" and "key not found" bugs in Facet.Taxonomy.TestTaxonomyFacetCounts
Date Sun, 21 Aug 2016 06:54:55 GMT
Fixed "index out of range" and "key not found" bugs in Facet.Taxonomy.TestTaxonomyFacetCounts


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

Branch: refs/heads/master
Commit: 132da59331a3f9e9f1ed4a276cb79e7118617095
Parents: 9313ff9
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Aug 21 11:02:05 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Aug 21 11:02:05 2016 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/132da593/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
index a2b412e..72390e2 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts.cs
@@ -791,7 +791,7 @@ namespace Lucene.Net.Facet.Taxonomy
                 var expectedCounts = new List<Dictionary<string, int?>>();
                 for (int i = 0; i < numDims; i++)
                 {
-                    expectedCounts[i] = new Dictionary<string, int?>();
+                    expectedCounts.Add(new Dictionary<string, int?>());
                 }
 
                 foreach (TestDoc doc in testDocs)
@@ -802,7 +802,7 @@ namespace Lucene.Net.Facet.Taxonomy
                         {
                             if (doc.dims[j] != null)
                             {
-                                int? v = expectedCounts[j][doc.dims[j]];
+                                int? v = expectedCounts[j].ContainsKey(doc.dims[j]) ? expectedCounts[j][doc.dims[j]]
: null;
                                 if (v == null)
                                 {
                                     expectedCounts[j][doc.dims[j]] = 1;


Mime
View raw message