Add assert when dllmap is disabled and fix support build in netcore mode
[mono-project.git] / mono / tests / abort-tests.cs
blobdc5222e0f4ff70bd0d3631a34ea2df9dcce4c7e6
1 using System;
2 using System.Threading;
4 public class Tests {
6 public static void Test1 ()
8 bool called_finally = false;
9 bool failed_abort = false;
10 bool finished = false;
12 Thread thr = new Thread (() => {
13 try {
14 try {
15 Thread.CurrentThread.Abort ();
16 } finally {
17 called_finally = true;
18 Thread.CurrentThread.Abort ();
19 failed_abort = true;
21 } catch (ThreadAbortException) {
22 Thread.ResetAbort ();
24 finished = true;
25 });
27 thr.Start ();
28 thr.Join ();
30 if (!called_finally)
31 Environment.Exit (1);
32 if (failed_abort)
33 Environment.Exit (2);
34 if (!finished)
35 Environment.Exit (3);
38 public static void Main ()
40 Test1 ();
41 Console.WriteLine ("done, all things good");