[tests] Assembly.GetEntryAssembly works differently on Android
authorMarek Habersack <grendel@twistedcode.net>
Tue, 7 Jul 2015 09:53:36 +0000 (11:53 +0200)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 15 Jul 2015 18:45:37 +0000 (20:45 +0200)
There's no entry assembly as such, adjust the test accordingly.

mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs

index 6e957ec7b7d255a992bb063c99556fe116e1584e..471a354b8ff0315fa179591c697eec4360a148fd 100644 (file)
@@ -123,6 +123,7 @@ 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
                        string fname = AppDomain.CurrentDomain.FriendlyName;
                        if (fname.EndsWith (".dll")) { // nunit-console
                                Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
@@ -131,6 +132,10 @@ namespace MonoTests.System.Reflection
                                Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
                                Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
                        }
+#else
+                       Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
+                       Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
+#endif
                }
 
 #if !MONOTOUCH // Reflection.Emit is not supported.