2006-04-25 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 25 Apr 2006 06:48:23 +0000 (06:48 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 25 Apr 2006 06:48:23 +0000 (06:48 -0000)
* QueueTest.cs, SortedListTest.cs : many capacity-related tests are
  written under improper assumption. As a result they don't pass when
  we run make PROFILE=net_2_0 run-test-ondotnet, so got rid of them.

svn path=/trunk/mcs/; revision=59835

mcs/class/corlib/Test/System.Collections/ChangeLog
mcs/class/corlib/Test/System.Collections/QueueTest.cs
mcs/class/corlib/Test/System.Collections/SortedListTest.cs

index fbc0e0b9c3610a1a9d74f6d1898480192c95880e..c3a30c00e8aa58c84e3995412db3c17d133d939b 100644 (file)
@@ -1,3 +1,9 @@
+2006-04-25  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * QueueTest.cs, SortedListTest.cs : many capacity-related tests are
+         written under improper assumption. As a result they don't pass when
+         we run make PROFILE=net_2_0 run-test-ondotnet, so got rid of them.
+
 2006-01-04  Sebastien Pouliot  <sebastien@ximian.com>
 
        * HashtableTest.cs: Added test case to check if all subclasses are 
index e0b2a125f2fbb8323639881d394a282f4faa43e7..1493952976f02e015cc52aeee0398f2770fd85b4 100644 (file)
@@ -136,9 +136,11 @@ namespace MonoTests.System.Collections {
                public void TestSyncRoot() 
                {
                        SetUp();
+#if !NET_2_0 // umm, why on earth do you expect SyncRoot is the Queue itself?
                        AssertEquals("SyncRoot q1", q1, q1.SyncRoot);
                        AssertEquals("SyncRoot q2", q2, q2.SyncRoot);
                        AssertEquals("SyncRoot emptyQueue", emptyQueue, emptyQueue.SyncRoot);
+#endif
 
                        Queue q1sync = Queue.Synchronized(q1);
                        AssertEquals("SyncRoot value of a synchronized queue", q1, q1sync.SyncRoot);
index 2f861f59994166136ddbefa0fcdcd304b71c01fd..34f1a751874d776871994c01981bae2b83fa6858 100644 (file)
@@ -39,7 +39,9 @@ public class SortedListTest : Assertion {
        public void TestConstructor1() {
                SortedList temp1 = new SortedList();
                AssertNotNull("sl.constructor-1: returns null", temp1);
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
                AssertEquals("sl.constructor-1: incorrect initial capacity", icap, temp1.Capacity);
+#endif
        }
 
         [Test]
@@ -47,7 +49,9 @@ public class SortedListTest : Assertion {
                Comparer c = Comparer.Default;
                SortedList temp1 = new SortedList(c);
                AssertNotNull("sl.constructor-2: returns null", temp1);
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
                AssertEquals("sl.constructor-2: incorrect initial capacity", icap, temp1.Capacity);
+#endif
        }
 
         [Test]
@@ -111,6 +115,7 @@ public class SortedListTest : Assertion {
                } catch (ArgumentOutOfRangeException) {}
        }
 
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
        [Test]
        public void Constructor_Capacity () 
        {
@@ -128,6 +133,7 @@ public class SortedListTest : Assertion {
                        AssertEquals ("Capacity-Resetted" + i.ToString (), 16, sl.Capacity);
                }
        }
+#endif
 
         [Test] 
        public void TestIsSynchronized() {
@@ -183,7 +189,9 @@ public class SortedListTest : Assertion {
                SortedList list = new SortedList (42);
                AssertEquals ("42", 42, list.Capacity);
                list.Capacity = 0;
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
                AssertEquals ("0(16)", 16, list.Capacity);
+#endif
        }
 
         [Test]
@@ -312,9 +320,12 @@ public class SortedListTest : Assertion {
                AssertEquals("sl.Clear: should have one element", 2, sl1.Count);
                sl1.Clear();
                AssertEquals("sl.Clear: is not cleared", 0, sl1.Count);
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
                AssertEquals("sl.Clear: capacity is altered", 16, sl1.Capacity);
+#endif
        }
 
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
        [Test]
        public void Clear_Capacity () 
        {
@@ -340,6 +351,7 @@ public class SortedListTest : Assertion {
                AssertEquals ("Capacity", 16, sl.Capacity);
                // note: we didn't return to 0 - so Clear cahnge the default capacity
        }
+#endif
 
         [Test]
        public void TestClone() {
@@ -799,11 +811,15 @@ public class SortedListTest : Assertion {
                SortedList sl1 = new SortedList(24);
                
                sl1.TrimToSize();
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
                AssertEquals("sl.TrimToSize: incorrect capacity after trimming empty list",icap,sl1.Capacity);
+#endif
                
                for (int i = 72; i>=0; i--) sl1.Add(100+i,i);
                sl1.TrimToSize();
+#if !NET_2_0 // no such expectation as it is broken in .NET 2.0
                AssertEquals("sl.TrimToSize: incorrect capacity after trimming a list",73,sl1.Capacity);
+#endif
        }
 
        [Test]