[corlib] Fix tests for watchOS. (#3131)
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 8 Jun 2016 20:46:11 +0000 (22:46 +0200)
committerZoltan Varga <vargaz@gmail.com>
Wed, 8 Jun 2016 20:46:11 +0000 (16:46 -0400)
mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
mcs/class/corlib/Test/System/EnvironmentTest.cs

index b43d9fd08954b011f170b3629bf0fe147a876a91..bc3416441cfad03b93e428301df40573aaff264e 100644 (file)
@@ -182,7 +182,10 @@ namespace MonoTests.System.Reflection
                        // note: only available in default appdomain
                        // http://weblogs.asp.net/asanto/archive/2003/09/08/26710.aspx
                        // Not sure we should emulate this behavior.
-#if !MONODROID
+#if __WATCHOS__
+                       Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
+                       Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
+#elif !MONODROID
                        string fname = AppDomain.CurrentDomain.FriendlyName;
                        if (fname.EndsWith (".dll")) { // nunit-console
                                Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
@@ -249,7 +252,7 @@ namespace MonoTests.System.Reflection
                public void Corlib_test ()
                {
                        Assembly corlib_test = Assembly.GetExecutingAssembly ();
-#if MONODROID || MOBILE_STATIC
+#if MONODROID || MOBILE_STATIC || __WATCHOS__
                        Assert.IsNull (corlib_test.EntryPoint, "EntryPoint");
                        Assert.IsNull (corlib_test.Evidence, "Evidence");
 #elif MOBILE
index deb0e3314b650593fd20d1b2c71e5f0a84200468..fed370974e584b8d5c33dd49eca0a75dc87de8e6 100644 (file)
@@ -156,9 +156,13 @@ namespace MonoTests.System
                public void GetCommandLineArgs ()
                {
                        string[] args = Environment.GetCommandLineArgs ();
+#if !__WATCHOS__
                        Assert.IsNotNull (args, "not null");
                        Assert.IsTrue (((args.Length > 0) && (args.Length < 256)), "reasonable");
                        Assert.IsNotNull (args [0], "application");
+#else
+                       Assert.AreEqual (0, args.Length, "length");
+#endif
                }
 
 #if !NET_2_1