Author: gert
Date: 2007-10-21 11:01:17 -0400 (Sun, 21 Oct 2007)
New Revision: 87868

Modified:
   trunk/mcs/class/corlib/Test/System.Threading/ChangeLog
   trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs
Log:
* ThreadTest.cs: On 2.0 profile, enable > 0 tests for GetHashCode.
Added test that asserts if the hashcode of two threads is distinct.


Modified: trunk/mcs/class/corlib/Test/System.Threading/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Threading/ChangeLog      2007-10-21 
13:29:41 UTC (rev 87867)
+++ trunk/mcs/class/corlib/Test/System.Threading/ChangeLog      2007-10-21 
15:01:17 UTC (rev 87868)
@@ -1,3 +1,8 @@
+2007-10-21  Gert Driesen  <[EMAIL PROTECTED]>
+
+       * ThreadTest.cs: On 2.0 profile, enable > 0 tests for GetHashCode.
+       Added test that asserts if the hashcode of two threads is distinct.
+
 2007-10-20  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * TimerTest.cs (TestHeavyCreationLoad): Don't shadow a variable name.

Modified: trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs  2007-10-21 
13:29:41 UTC (rev 87867)
+++ trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs  2007-10-21 
15:01:17 UTC (rev 87868)
@@ -218,8 +218,9 @@
                        C1Test test1 = new C1Test ();
                        Thread tA = new Thread (new ThreadStart 
(test1.TestMethod));
                        int hA1 = tA.GetHashCode ();
-                       // GetHashCode can legitimately return 0
-                       //Assert.IsTrue (hA1 > 0, "#A1");
+#if NET_2_0
+                       Assert.IsTrue (hA1 > 0, "#A1");
+#endif
                        tA.Start ();
                        int hA2 = tA.GetHashCode ();
                        Assert.AreEqual (hA1, hA2, "#A2");
@@ -233,8 +234,9 @@
                        test1 = new C1Test ();
                        Thread tB = new Thread (new ThreadStart 
(test1.TestMethod));
                        int hB1 = tB.GetHashCode ();
-                       // GetHashCode can legitimately return 0
-                       //Assert.IsTrue (hB1 > 0, "#B1");
+#if NET_2_0
+                       Assert.IsTrue (hB1 > 0, "#B1");
+#endif
                        tB.Start ();
                        int hB2 = tB.GetHashCode ();
                        Assert.AreEqual (hB1, hB2, "#B2");
@@ -244,6 +246,7 @@
 #if NET_2_0
                        Assert.AreEqual (hB1, tB.ManagedThreadId, "#B4");
 #endif
+                       Assert.IsFalse (hA2 == hB2, "#B5");
                }
 
 #if NET_2_0

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to