Prechádzať zdrojové kódy

* TimerTest.cs: Added test for bug #78202. Marked individual tests
NotWorking instead of the test class to enable test for bug #78202.

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

Gert Driesen 19 rokov pred
rodič
commit
2a73ea1ab3

+ 5 - 0
mcs/class/corlib/Test/System.Threading/ChangeLog

@@ -1,3 +1,8 @@
+2006-04-30  Gert Driesen  <[email protected]>
+
+	* TimerTest.cs: Added test for bug #78202. Marked individual tests
+	NotWorking instead of the test class to enable test for bug #78202. 
+
 2006-01-18  Atsushi Enomoto  <[email protected]>
 
 	* ThreadTest.cs : mark not-working tests as [Ignore] since it blocks

+ 33 - 15
mcs/class/corlib/Test/System.Threading/TimerTest.cs

@@ -22,15 +22,9 @@ namespace MonoTests.System.Threading {
 	// Am going with door #1, but it would be nice to investigate this.
 	// -- Ben
 	//
-	[Category ("NotWorking")]
 	public class TimerTest : Assertion {
-
-		public int counter;
-		
-		private void Callback (object foo) {
-			counter ++;
-		}
-
+		[Test]
+		[Category ("NotWorking")]
 		public void TestDueTime ()
 		{
 			counter = 0;
@@ -47,7 +41,9 @@ namespace MonoTests.System.Threading {
 			Assert ("t3", counter > 20);
 			t.Dispose ();
 		}
-		
+
+		[Test]
+		[Category ("NotWorking")]
 		public void TestChange ()
 		{
 			counter = 0;
@@ -61,6 +57,8 @@ namespace MonoTests.System.Threading {
 			t.Dispose ();
 		}
 
+		[Test]
+		[Category ("NotWorking")]
 		public void TestZeroDueTime () {
 			counter = 0;
 
@@ -72,7 +70,9 @@ namespace MonoTests.System.Threading {
 			AssertEquals (2, counter);
 			t.Dispose ();
 		}
-		
+
+		[Test]
+		[Category ("NotWorking")]
 		public void TestDispose ()
 		{
 			counter = 0;
@@ -85,12 +85,17 @@ namespace MonoTests.System.Threading {
 			Thread.Sleep (200);
 			AssertEquals (c, counter);
 		}
-		
-		private void CallbackTestDispose (object foo) {
-			counter ++;
-		}
 
-		Timer t1;
+		[Test] // bug #78202
+		public void TestDispose2 ()
+		{
+			Timer t = new Timer (new TimerCallback (CallbackTestDispose), null, 10, 10);
+			t.Dispose ();
+			t.Dispose ();
+		}
+		
+		[Test]
+		[Category ("NotWorking")]
 		public void TestDisposeOnCallback () {
 			counter = 0;
 			t1 = new Timer (new TimerCallback (CallbackTestDisposeOnCallback), null, 0, 10);
@@ -110,5 +115,18 @@ namespace MonoTests.System.Threading {
 				t1 = null;
 			}
 		}
+
+		private void CallbackTestDispose (object foo)
+		{
+			counter++;
+		}
+
+		private void Callback (object foo)
+		{
+			counter++;
+		}
+
+		Timer t1;
+		int counter;
 	}
 }