Merge pull request #3503 from ntherning/fix-MarshalTest.GetHINSTANCE-on-mono-windows
authorNiklas Therning <niklas@therning.org>
Thu, 1 Sep 2016 14:41:58 +0000 (16:41 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Sep 2016 14:41:58 +0000 (16:41 +0200)
Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows

mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs

index 094fb8a54811c8396c25b5bb393dac3ce62d5e42..d6254137ee0122b4b5008f679181c54239ccc207 100644 (file)
@@ -208,8 +208,8 @@ namespace MonoTests.System.Runtime.InteropServices
                [Test]
                public void GetHINSTANCE ()
                {
-                       if (RunningOnUnix)
-                               Assert.Ignore ("GetHINSTANCE only applies to Windows.");
+                       if (RunningOnMono)
+                               Assert.Ignore ("GetHINSTANCE only applies to .NET on Windows.");
 
                        Assembly a;
                        IntPtr hinstance;
@@ -803,10 +803,9 @@ namespace MonoTests.System.Runtime.InteropServices
                        ex = Marshal.GetExceptionForHR (E_INVALIDARG);
                        Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "E_INVALIDARG");
                }
-               bool RunningOnUnix {
+               bool RunningOnMono {
                        get {
-                               int p = (int) Environment.OSVersion.Platform;
-                               return ((p == 4) || (p == 128) || (p == 6));
+                               return (Type.GetType ("System.MonoType", false) != null);
                        }
                }