Disable failing tests on Windows 7
authorFrederik Carlier <frederik.carlier@quamotion.mobi>
Wed, 27 Sep 2017 20:03:14 +0000 (22:03 +0200)
committerFrederik Carlier <frederik.carlier@quamotion.mobi>
Wed, 27 Sep 2017 20:03:14 +0000 (22:03 +0200)
Commit migrated from https://github.com/dotnet/corefx/commit/f44f45ee59cdebe02b6c34db22c88ca8c4bc5ff5

src/libraries/System.Drawing.Common/tests/Helpers.cs
src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/JpegCodecTests.cs

index 7bf4347..a1e577c 100644 (file)
@@ -16,6 +16,7 @@ namespace System.Drawing
         public const string RecentGdiplusIsAvailable = nameof(Helpers) + "." + nameof(GetRecentGdiPlusIsAvailable);
         public const string RecentGdiplusIsAvailable2 = nameof(Helpers) + "." + nameof(GetRecentGdiPlusIsAvailable2);
         public const string GdiPlusIsAvailableNotRedhat73 = nameof(Helpers) + "." + nameof(GetGdiPlusIsAvailableNotRedhat73);
+        public const string GdiPlusIsAvailableNotWindows7 = nameof(Helpers) + "." + nameof(GetGdiPlusIsAvailableNotWindows7);
         public const string AnyInstalledPrinters = nameof(Helpers) + "." + nameof(IsAnyInstalledPrinters);
 
         public static bool GetGdiplusIsAvailable()
@@ -65,6 +66,16 @@ namespace System.Drawing
             return GetGdiplusIsAvailable();
         }
 
+        public static bool GetGdiPlusIsAvailableNotWindows7()
+        {
+            if (PlatformDetection.IsWindows7)
+            {
+                return false;
+            }
+
+            return GetGdiplusIsAvailable();
+        }
+
         public static bool GetRecentGdiPlusIsAvailable()
         {
             // CentOS 7, RHEL 7 and Ubuntu 14.04 are running outdated versions of libgdiplus
index fdddfeb..89f1709 100644 (file)
@@ -108,15 +108,15 @@ namespace MonoTests.System.Drawing.Imaging
             }
         }
 
-        [ConditionalFact(Helpers.RecentGdiplusIsAvailable)]
+        [ConditionalFact(Helpers.GdiPlusIsAvailableNotWindows7)]
         public void Bitmap8bbpIndexedGreyscalePixels()
         {
             string sInFile = Helpers.GetTestBitmapPath("nature-greyscale.jpg");
             using (Bitmap bmp = new Bitmap(sInFile))
             {
                 // sampling values from a well known bitmap
-                // Assert.Equal(-7697782, bmp.GetPixel(0, 0).ToArgb());
-                // Assert.Equal(-12171706, bmp.GetPixel(0, 32).ToArgb());
+                Assert.Equal(-7697782, bmp.GetPixel(0, 0).ToArgb());
+                Assert.Equal(-12171706, bmp.GetPixel(0, 32).ToArgb());
                 Assert.Equal(-14013910, bmp.GetPixel(0, 64).ToArgb());
                 Assert.Equal(-15132391, bmp.GetPixel(0, 96).ToArgb());
                 Assert.Equal(-328966, bmp.GetPixel(32, 0).ToArgb());
@@ -134,7 +134,7 @@ namespace MonoTests.System.Drawing.Imaging
             }
         }
 
-        [ConditionalFact(Helpers.RecentGdiplusIsAvailable)]
+        [ConditionalFact(Helpers.GdiPlusIsAvailableNotWindows7)]
         public void Bitmap8bbpIndexedGreyscaleData()
         {
             string sInFile = Helpers.GetTestBitmapPath("nature-greyscale.jpg");
@@ -153,8 +153,8 @@ namespace MonoTests.System.Drawing.Imaging
                     {
                         byte* scan = (byte*)data.Scan0;
                         // sampling values from a well known bitmap
-                        // Assert.Equal(138, *(scan + 0));
-                        // Assert.Equal(203, *(scan + 1009));
+                        Assert.Equal(138, *(scan + 0));
+                        Assert.Equal(203, *(scan + 1009));
                         Assert.Equal(156, *(scan + 2018));
                         Assert.Equal(248, *(scan + 3027));
                         Assert.Equal(221, *(scan + 4036));