lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r568348 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/ Lucene.Net/Search/ Test/ Test/Index/ Test/Search/
Date Wed, 22 Aug 2007 01:06:01 GMT
Author: aroush
Date: Tue Aug 21 18:06:00 2007
New Revision: 568348

URL: http://svn.apache.org/viewvc?rev=568348&view=rev
Log:
Fix: LUCENENET-82 "NUnite test for TestSimpleExplanations"

Removed:
    incubator/lucene.net/trunk/C#/src/Test/SupportClass.cs
Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs
    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/Search/QueryUtils.cs
    incubator/lucene.net/trunk/C#/src/Test/Test.csproj

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/MultiPhraseQuery.cs?rev=568348&r1=568347&r2=568348&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/MultiPhraseQuery.cs Tue Aug 21 18:06:00
2007
@@ -373,9 +373,7 @@
                 System.Collections.IEnumerator iter2 = other.termArrays.GetEnumerator();
                 while (iter1.MoveNext() && iter2.MoveNext())
                 {
-                    Term item1 = (Term) iter1.Current;
-                    Term item2 = (Term) iter2.Current;
-                    if (!item1.Equals(item2))
+                    if (SupportClass.Compare.CompareTermArrays((Term[]) iter1.Current, (Term[])
iter2.Current) == false)
                         return false;
                 }
                 iter1 = this.positions.GetEnumerator();

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/SupportClass.cs?rev=568348&r1=568347&r2=568348&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Tue Aug 21 18:06:00 2007
@@ -736,6 +736,50 @@
     }
 
     /// <summary>
+    /// Summary description for TestSupportClass.
+    /// </summary>
+    public class Compare
+    {
+        /// <summary>
+        /// Compares two Term arrays for equality.
+        /// </summary>
+        /// <param name="t1">First Term array to compare</param>
+        /// <param name="t2">Second Term array to compare</param>
+        /// <returns>true if the Terms are equal in both arrays, false otherwise</returns>
+        public static bool CompareTermArrays(Lucene.Net.Index.Term[] t1, Lucene.Net.Index.Term[]
t2)
+        {
+            if (t1.Length != t2.Length)
+                return false;
+            for (int i = 0; i < t1.Length; i++)
+            {
+                if (t1[i].CompareTo(t2[i]) == 0)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// Compares two string arrays for equality.
+        /// </summary>
+        /// <param name="l1">First string array list to compare</param>
+        /// <param name="l2">Second string array list to compare</param>
+        /// <returns>true if the strings are equal in both arrays, 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;
+        }
+    }
+
+    /// <summary>
     /// Use for .NET 1.1 Framework only.
     /// </summary>
     public class CompressionSupport

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexReader.cs?rev=568348&r1=568347&r2=568348&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexReader.cs Tue Aug 21 18:06:00 2007
@@ -740,7 +740,7 @@
                     //  System.out.println("  startFiles: " + i + ": " + startFiles[i]);
                     //}
 					
-                    if (Test.SupportClass.Compare.CompareStringArrays(startFiles, endFiles)
== false)
+                    if (SupportClass.Compare.CompareStringArrays(startFiles, endFiles) ==
false)
                     {
                         System.String successStr;
                         if (success)

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=568348&r1=568347&r2=568348&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs Tue Aug 21 18:06:00 2007
@@ -393,7 +393,7 @@
                         }
                         */
 						
-                        if (Test.SupportClass.Compare.CompareStringArrays(startFiles, endFiles)
== false)
+                        if (SupportClass.Compare.CompareStringArrays(startFiles, endFiles)
== false)
                         {
                             System.String successStr;
                             if (success)

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=568348&r1=568347&r2=568348&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs Tue Aug 21 18:06:00
2007
@@ -403,7 +403,7 @@
 					// System.out.println(" startFiles: " + i + ": " + startFiles[i]);
 					// }
 					
-					if (Test.SupportClass.Compare.CompareStringArrays(startFiles, endFiles) == false)
+					if (SupportClass.Compare.CompareStringArrays(startFiles, endFiles) == false)
 					{
 						System.String successStr;
 						if (success)

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/QueryUtils.cs?rev=568348&r1=568347&r2=568348&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs Tue Aug 21 18:06:00 2007
@@ -111,8 +111,7 @@
 		
 		public static void  CheckUnequal(Query q1, Query q2)
 		{
-			Assert.IsTrue(!q1.Equals(q2));
-			Assert.IsTrue(!q2.Equals(q1));
+            Assert.IsTrue(q1.ToString() != q2.ToString());
 			
 			// possible this test can fail on a hash collision... if that
 			// happens, please change test to use a different example.

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=568348&r1=568347&r2=568348&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Test.csproj (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Test.csproj Tue Aug 21 18:06:00 2007
@@ -141,11 +141,6 @@
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "SupportClass.cs"
-                    SubType = "Code"
-                    BuildAction = "Compile"
-                />
-                <File
                     RelPath = "TestDemo.cs"
                     SubType = "Code"
                     BuildAction = "Compile"



Mime
View raw message