[Mono.Unix] Fix crasher in StringToHeap (#5639)
[mono.git] / mcs / class / Mono.Posix / Test / Mono.Unix / UnixMarshalTest.cs
index e27a5dd246c68ef04c4f602b6fda95195e4f69aa..9b0ce35d9614123b25bf97468dbdb3a68be03bfd 100644 (file)
@@ -28,7 +28,7 @@ namespace MonoTests.Mono.Unix {
                }
        }
 
-       [TestFixture]
+       [TestFixture, Category ("NotOnWindows")]
        public class UnixMarshalTest {
 #if false
                public static void Main ()
@@ -40,6 +40,13 @@ namespace MonoTests.Mono.Unix {
                }
 #endif
 
+               [Test]
+               public void BXC10074 ()
+               {
+                       var result = UnixMarshal.StringToHeap (null, Encoding.ASCII);
+                       Assert.AreEqual (IntPtr.Zero, result, "This used to crash due to a NullReferenceException");
+               }
+
                [Test]
                public void TestStringToHeap ()
                {