You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ar...@apache.org on 2007/08/21 03:46:15 UTC

svn commit: r567903 - in /incubator/lucene.net/trunk/C#/src/Test: Index/TestIndexWriter.cs Index/TestIndexWriterDelete.cs SupportClass.cs Test.csproj

Author: aroush
Date: Mon Aug 20 18:46:14 2007
New Revision: 567903

URL: http://svn.apache.org/viewvc?rev=567903&view=rev
Log:
Fix: LUCENENET-68 "Bug in TestIndexWriterDelete.TestOperationsOnDiskFull"

Added:
    incubator/lucene.net/trunk/C#/src/Test/SupportClass.cs
Modified:
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs
    incubator/lucene.net/trunk/C#/src/Test/Test.csproj

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexWriter.cs?rev=567903&r1=567902&r2=567903&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs Mon Aug 20 18:46:14 2007
@@ -393,7 +393,7 @@
                         }
                         */
 						
-                        if (CompareStringArrays(startFiles, endFiles) == false)
+                        if (Test.SupportClass.Compare.CompareStringArrays(startFiles, endFiles) == false)
                         {
                             System.String successStr;
                             if (success)
@@ -908,18 +908,6 @@
             else
                 tmpBool2 = false;
             bool generatedAux2 = tmpBool2;
-        }
-
-        bool CompareStringArrays(System.String[] l1, System.String[] l2)
-        {
-            if (l1.Length != l2.Length)
-                return false;
-            for (int i = 0; i < l1.Length; i++)
-            {
-                if (l1[i] != l2[i])
-                    return false;
-            }
-            return true;
         }
     }
 }

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexWriterDelete.cs?rev=567903&r1=567902&r2=567903&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs Mon Aug 20 18:46:14 2007
@@ -403,7 +403,7 @@
 					// System.out.println(" startFiles: " + i + ": " + startFiles[i]);
 					// }
 					
-					if (!startFiles.Equals(endFiles))
+					if (Test.SupportClass.Compare.CompareStringArrays(startFiles, endFiles) == false)
 					{
 						System.String successStr;
 						if (success)

Added: incubator/lucene.net/trunk/C#/src/Test/SupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/SupportClass.cs?rev=567903&view=auto
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/SupportClass.cs (added)
+++ incubator/lucene.net/trunk/C#/src/Test/SupportClass.cs Mon Aug 20 18:46:14 2007
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Lucene.Net.Test.SupportClass
+{
+	/// <summary>
+	/// Summary description for TestSupportClass.
+	/// </summary>
+	public class Compare
+	{
+        /// <summary>
+        /// Compares two string arrays for equality.
+        /// </summary>
+        /// <param name="l1">First string array list to compare</param>
+        /// <param name="l2">First string array list to compare</param>
+        /// <returns>true if the strings are equal, false otherwise</returns>
+        public static bool CompareStringArrays(System.String[] l1, System.String[] l2)
+		{
+            if (l1.Length != l2.Length)
+                return false;
+            for (int i = 0; i < l1.Length; i++)
+            {
+                if (l1[i] != l2[i])
+                    return false;
+            }
+            return true;
+        }
+	}
+}

Modified: incubator/lucene.net/trunk/C#/src/Test/Test.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Test.csproj?rev=567903&r1=567902&r2=567903&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Test.csproj (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Test.csproj Mon Aug 20 18:46:14 2007
@@ -141,6 +141,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "SupportClass.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "TestDemo.cs"
                     SubType = "Code"
                     BuildAction = "Compile"