[netcore] Disable a flaky test on interpreter (#18904)
[mono-project.git] / mono / tests / appdomain.cs
blob577ab6e8567136b8ca2e09e03844c43690bd1fed
1 using System;
2 using System.Security.Policy;
3 using System.Threading;
5 class Container {
7 [LoaderOptimization (LoaderOptimization.SingleDomain)]
8 static int arg_sum (string[] args) {
9 int res = 0;
10 foreach (string s in args) {
11 res += Convert.ToInt32 (s);
13 return res;
16 static int Main ()
18 int res;
20 AppDomainSetup setup = new AppDomainSetup ();
21 setup.ApplicationBase = ".";
23 Console.WriteLine (AppDomain.CurrentDomain.FriendlyName);
25 AppDomain newDomain = AppDomain.CreateDomain ("NewDomain", null, setup);
27 string[] args = { "1", "2", "3"};
28 res = newDomain.ExecuteAssembly ("appdomain-client.exe", null, args);
29 if (res != arg_sum (args))
30 return 1;
32 Console.WriteLine ("test-ok");
34 return 0;