Merge pull request #4845 from lambdageek/dev-coop-delegates
[mono.git] / mono / tests / appdomain.cs
index a6cdfcd1f313af6c05796cbf895cd94b82a4aa43..577ab6e8567136b8ca2e09e03844c43690bd1fed 100644 (file)
@@ -5,19 +5,32 @@ using System.Threading;
 class Container {
 
        [LoaderOptimization (LoaderOptimization.SingleDomain)]
-       static void Main ()
+       static int arg_sum (string[] args) {
+               int res = 0;
+               foreach (string s in args) {
+                       res += Convert.ToInt32 (s);
+               }
+               return res;
+       }
+       
+       static int Main ()
        {
+               int res;
+               
                AppDomainSetup setup = new AppDomainSetup ();
                setup.ApplicationBase = ".";
 
                Console.WriteLine (AppDomain.CurrentDomain.FriendlyName);
                        
-               AppDomain newDomain = AppDomain.CreateDomain ("NewDomain", new Evidence (), setup);
+               AppDomain newDomain = AppDomain.CreateDomain ("NewDomain", null, setup);
 
-               string[] args = { "test0", "test1" };
+               string[] args = { "1", "2", "3"};               
+               res = newDomain.ExecuteAssembly ("appdomain-client.exe", null, args);
+               if (res != arg_sum (args))
+                       return 1;
                
-               newDomain.ExecuteAssembly ("jit-int.exe");
+               Console.WriteLine ("test-ok");
 
-               Console.WriteLine ("Ready");
+               return 0;
        }
 }