dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System TestArray.cs,1.


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System TestArray.cs,1.1,1.2
Date: Mon, 14 Apr 2003 01:23:35 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System
In directory subversions:/tmp/cvs-serv8904/tests/runtime/System

Modified Files:
        TestArray.cs 
Log Message:


Use quicksort for sorting Array and ArrayList instances.


Index: TestArray.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System/TestArray.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** TestArray.cs        14 Apr 2003 04:49:11 -0000      1.1
--- TestArray.cs        14 Apr 2003 05:23:33 -0000      1.2
***************
*** 161,163 ****
--- 161,184 ----
                        }
  
+       // Test sorting an array.
+       public void TestArraySort()
+                       {
+                               int[] list = new int [] {98, 45};
+                               Array.Sort(list);
+                               AssertEquals("Sort (1)", 45, list[0]);
+                               AssertEquals("Sort (2)", 98, list[1]);
+ 
+                               list = new int[] {98, 0, 45};
+                               Array.Sort(list);
+                               AssertEquals("Sort (3)",  0, list[0]);
+                               AssertEquals("Sort (4)", 45, list[1]);
+                               AssertEquals("Sort (5)", 98, list[2]);
+ 
+                               list = new int[] {97, 104, 98};
+                               Array.Sort(list);
+                               AssertEquals("Sort (6)", 97, list[0]);
+                               AssertEquals("Sort (7)", 98, list[1]);
+                               AssertEquals("Sort (8)", 104, list[2]);
+                       }
+ 
  }; // class TestArray





reply via email to

[Prev in Thread] Current Thread [Next in Thread]