2
0
Эх сурвалжийг харах

Fix the Thread.Interrupt () test now that it is implemented.

Zoltan Varga 14 жил өмнө
parent
commit
fab2a3e2b5

+ 3 - 12
mcs/class/corlib/Test/System.Threading/ThreadTest.cs

@@ -822,21 +822,12 @@ namespace MonoTests.System.Threading
 		{
 			bool interruptedExceptionThrown = false;
 
+			Thread.CurrentThread.Interrupt ();
 			try {
-				try {
-					Thread.CurrentThread.Interrupt ();
-				} finally {
-					try {
-						Thread.Sleep (0);
-					} catch (ThreadInterruptedException) {
-						Assert.Fail ("ThreadInterruptedException should not be thrown.");
-					}
-				}
+				Thread.Sleep (0);
+				Assert.Fail ();
 			} catch (ThreadInterruptedException) {
-				interruptedExceptionThrown = true;
 			}
-
-			Assert.IsFalse (interruptedExceptionThrown, "ThreadInterruptedException should not be thrown.");
 		}
 
 		void CheckIsRunning (string s, Thread t)