lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [24/26] lucenenet git commit: fix test TestMergeStability
Date Fri, 14 Nov 2014 11:59:39 GMT
fix test TestMergeStability


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

Branch: refs/heads/master
Commit: eabf7f287b9e71233ceb72f53f88126946628f24
Parents: f1262cd
Author: eladmarg <eladmarg@gmail.com>
Authored: Thu Nov 13 23:36:54 2014 -0800
Committer: eladmarg <eladmarg@gmail.com>
Committed: Thu Nov 13 23:36:54 2014 -0800

----------------------------------------------------------------------
 .../Index/BaseIndexFileFormatTestCase.cs            | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eabf7f28/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
index 693540e..264d1ef 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
@@ -65,10 +65,20 @@ namespace Lucene.Net.Index
             foreach (string file in d.ListAll())
             {
                 string ext = IndexFileNames.GetExtension(file);
-                long previousLength = bytesUsedByExtension.ContainsKey(ext) ? bytesUsedByExtension[ext]
: 0;
-                bytesUsedByExtension[ext] = previousLength + d.FileLength(file);
+                if (!string.IsNullOrWhiteSpace(ext))
+                {
+                    long previousLength = bytesUsedByExtension.ContainsKey(ext) ? bytesUsedByExtension[ext]
: 0;
+                    bytesUsedByExtension[ext] = previousLength + d.FileLength(file);
+                }
+            }
+
+            foreach (var elm in ExcludedExtensionsFromByteCounts())
+            {
+                if (bytesUsedByExtension.Keys.Contains(elm))
+                {
+                    bytesUsedByExtension.Remove(elm);
+                }
             }
-            bytesUsedByExtension.Keys.RemoveAll(ExcludedExtensionsFromByteCounts());
             return bytesUsedByExtension;
         }
 


Mime
View raw message