lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [32/50] [abbrv] lucenenet git commit: Fixed "out of range" and "key not found" bugs in Facet.Taxonomy.TestTaxonomyFacetSumValueSource.TestRandom()
Date Tue, 23 Aug 2016 23:18:25 GMT
Fixed "out of range" and "key not found" bugs in Facet.Taxonomy.TestTaxonomyFacetSumValueSource.TestRandom()


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

Branch: refs/heads/analysis-work
Commit: 0fd8d3465d54362285f83635871528a5ef888ae2
Parents: 5b9b2fe
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Aug 21 10:36:54 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Aug 21 10:36:54 2016 +0700

----------------------------------------------------------------------
 .../Taxonomy/TestTaxonomyFacetSumValueSource.cs                | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0fd8d346/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
index 21ede3c..e05daa9 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetSumValueSource.cs
@@ -541,10 +541,10 @@ namespace Lucene.Net.Facet.Taxonomy
                 Facets facets = new TaxonomyFacetSumValueSource(tr, config, fc, values);
 
                 // Slow, yet hopefully bug-free, faceting:
-                var expectedValues = new List<Dictionary<string, float?>>();
+                var expectedValues = new List<Dictionary<string, float?>>(numDims);
                 for (int i = 0; i < numDims; i++)
                 {
-                    expectedValues[i] = new Dictionary<string, float?>();
+                    expectedValues.Add(new Dictionary<string, float?>());
                 }
 
                 foreach (TestDoc doc in testDocs)
@@ -555,7 +555,7 @@ namespace Lucene.Net.Facet.Taxonomy
                         {
                             if (doc.dims[j] != null)
                             {
-                                float? v = expectedValues[j][doc.dims[j]];
+                                float? v = expectedValues[j].ContainsKey(doc.dims[j]) ? expectedValues[j][doc.dims[j]]
: null;
                                 if (v == null)
                                 {
                                     expectedValues[j][doc.dims[j]] = doc.value;


Mime
View raw message