Merge pull request #5382 from kumpera/pedump_fix
[mono.git] / mono / tests / appdomain-unload.cs
index b43368cf0a77421df2dd665188a81eb367e1aee6..e5ce63689219231bba99f26ef95eb35baafc8c1f 100644 (file)
@@ -16,6 +16,13 @@ public class Bar : MarshalByRefObject {
                Console.WriteLine ("in " + Thread.GetDomain ().FriendlyName);
                return x + 1;
        }
+
+       public void start_wait () {
+               Action a = delegate () {
+                       Thread.Sleep (10000);
+               };
+               a.BeginInvoke (null, null);
+       }
 }
 
 [Serializable]
@@ -97,8 +104,11 @@ class CrossDomainTester : MarshalByRefObject
 
 public class Tests
 {
-       public static int Main() {
-               return TestDriver.RunTests (typeof (Tests));
+       public static int Main(string[] args) {
+               if (args.Length == 0)
+                       return TestDriver.RunTests (typeof (Tests), new String[] { "-v" });
+               else
+                       return TestDriver.RunTests (typeof (Tests), args);
        }
 
        public static int test_0_unload () {
@@ -262,6 +272,16 @@ public class Tests
                }
        }
 
+       public static int test_0_abort_wait () {
+               AppDomain domain = AppDomain.CreateDomain ("AbortWait");
+               Bar bar = (Bar)domain.CreateInstanceAndUnwrap (typeof (Tests).Assembly.FullName, "Bar");
+               int x;
+
+               bar.start_wait ();
+               AppDomain.Unload (domain);
+               return 0;
+       }
+
        // FIXME: This does not work yet, because the thread is finalized too
        // early
        /*