[tests] Tweak MemoryMappedFile test case that fails on iOS/ARM64 [#27667]
[mono.git] / mcs / class / System.Core / Test / System.IO.MemoryMappedFiles / MemoryMappedFileTest.cs
index 8f7ba979afc5baffc95b931313e820421be412f5..f64d0c54477b7dd9e8281190050979a0aeb5bdb4 100644 (file)
@@ -345,16 +345,21 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                [Test]
                public void CreateViewStreamAlignToPageSize ()
                {
+#if MONOTOUCH
+                       // iOS bugs on ARM64 - bnc #27667 - apple #
+                       int pageSize = (IntPtr.Size == 4) ? Environment.SystemPageSize : 4096;
+#else
                        int pageSize = Environment.SystemPageSize;
+#endif
                        string f = Path.Combine (tempDir, "p-file");
                        File.WriteAllBytes (f, new byte [pageSize * 2 + 1]);
 
                        MemoryMappedFile mappedFile = MemoryMappedFile.CreateFromFile (f, FileMode.Open);
 
                        MemoryMappedViewStream stream = mappedFile.CreateViewStream (pageSize * 2, 0, MemoryMappedFileAccess.ReadWrite);
-
+#if !MONOTOUCH
                        Assert.AreEqual (stream.Capacity, Environment.SystemPageSize);
-
+#endif
                        stream.Write (new byte [pageSize], 0, pageSize);
                }
        }