Author: gert
Date: 2007-09-18 08:28:18 -0400 (Tue, 18 Sep 2007)
New Revision: 85965

Modified:
   trunk/mcs/class/corlib/Test/System.Threading/ChangeLog
   trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs
Log:
* ThreadTest.cs: Added GetHashCode test for bug #325566.


Modified: trunk/mcs/class/corlib/Test/System.Threading/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Threading/ChangeLog      2007-09-18 
11:44:52 UTC (rev 85964)
+++ trunk/mcs/class/corlib/Test/System.Threading/ChangeLog      2007-09-18 
12:28:18 UTC (rev 85965)
@@ -1,3 +1,7 @@
+2007-09-18  Gert Driesen  <[EMAIL PROTECTED]>
+
+       * ThreadTest.cs: Added GetHashCode test for bug #325566.
+
 2007-09-05  Gert Driesen  <[EMAIL PROTECTED]>
 
        * ThreadTest.cs: Added test for bug #82700. Re-enabled and fixed some

Modified: trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs  2007-09-18 
11:44:52 UTC (rev 85964)
+++ trunk/mcs/class/corlib/Test/System.Threading/ThreadTest.cs  2007-09-18 
12:28:18 UTC (rev 85965)
@@ -212,7 +212,40 @@
                        Thread TestThread = new Thread(new 
ThreadStart(test1.TestMethod));
                }
 
+               [Test] // bug #325566
+               [Category ("NotWorking")]
+               public void GetHashCodeTest ()
+               {
+                       C1Test test1 = new C1Test ();
+                       Thread tA = new Thread (new ThreadStart 
(test1.TestMethod));
+                       int hA1 = tA.GetHashCode ();
+                       Assert.IsTrue (hA1 > 0, "#A1");
+                       tA.Start ();
+                       int hA2 = tA.GetHashCode ();
+                       Assert.AreEqual (hA1, hA2, "#A2");
+                       tA.Join ();
+                       int hA3 = tA.GetHashCode ();
+                       Assert.AreEqual (hA1, hA3, "#A3");
 #if NET_2_0
+                       Assert.AreEqual (hA1, tA.ManagedThreadId, "#A4");
+#endif
+
+                       test1 = new C1Test ();
+                       Thread tB = new Thread (new ThreadStart 
(test1.TestMethod));
+                       int hB1 = tB.GetHashCode ();
+                       Assert.IsTrue (hB1 > 0, "#B1");
+                       tB.Start ();
+                       int hB2 = tB.GetHashCode ();
+                       Assert.AreEqual (hB1, hB2, "#B2");
+                       tB.Join ();
+                       int hB3 = tB.GetHashCode ();
+                       Assert.AreEqual (hB1, hB3, "#B3");
+#if NET_2_0
+                       Assert.AreEqual (hB1, tB.ManagedThreadId, "#B4");
+#endif
+               }
+
+#if NET_2_0
                [Test] // bug #82700
                [Category ("NotWorking")]
                public void ManagedThreadId ()

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

Reply via email to