+2007-10-21 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * 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 <harinath@gmail.com>
* TimerTest.cs (TestHeavyCreationLoad): Don't shadow a variable name.
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");
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");
#if NET_2_0
Assert.AreEqual (hB1, tB.ManagedThreadId, "#B4");
#endif
+ Assert.IsFalse (hA2 == hB2, "#B5");
}
#if NET_2_0