Ignore the MarshalTest.GetHINSTANCE() test on Mono on Windows
authorNiklas Therning <niklas@therning.org>
Thu, 1 Sep 2016 14:25:01 +0000 (16:25 +0200)
committerNiklas Therning <niklas@therning.org>
Thu, 1 Sep 2016 14:25:01 +0000 (16:25 +0200)
Won't work on Mono even when running 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);
                        }
                }