Dmitry Timoshkov : gdiplus/tests: Add a test for image flags to PNG grayscale image tests.

Alexandre Julliard julliard at winehq.org
Tue Aug 29 14:48:25 CDT 2017


Module: wine
Branch: master
Commit: 221c04d0dfb813750a458dfd6b40b828403ed958
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=221c04d0dfb813750a458dfd6b40b828403ed958

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Aug 28 11:30:15 2017 -0500

gdiplus/tests: Add a test for image flags to PNG grayscale image tests.

Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/tests/image.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index b9685c3..9f7cf66 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -4980,22 +4980,24 @@ static void test_png_color_formats(void)
     {
         char bit_depth, color_type;
         PixelFormat format;
+        UINT flags;
     } td[] =
     {
         /* 2 - PNG_COLOR_TYPE_RGB */
-        { 8, 2, PixelFormat24bppRGB },
+        { 8, 2, PixelFormat24bppRGB, ImageFlagsColorSpaceRGB },
         /* 0 - PNG_COLOR_TYPE_GRAY */
-        { 1, 0, PixelFormat1bppIndexed },
-        { 2, 0, PixelFormat32bppARGB },
-        { 4, 0, PixelFormat32bppARGB },
-        { 8, 0, PixelFormat32bppARGB },
-        { 16, 0, PixelFormat32bppARGB },
+        { 1, 0, PixelFormat1bppIndexed, ImageFlagsColorSpaceRGB },
+        { 2, 0, PixelFormat32bppARGB, ImageFlagsColorSpaceGRAY },
+        { 4, 0, PixelFormat32bppARGB, ImageFlagsColorSpaceGRAY },
+        { 8, 0, PixelFormat32bppARGB, ImageFlagsColorSpaceGRAY },
+        { 16, 0, PixelFormat32bppARGB, ImageFlagsColorSpaceGRAY },
     };
     BYTE buf[sizeof(png_1x1_data)];
     GpStatus status;
     GpImage *image;
     ImageType type;
     PixelFormat format;
+    UINT flags;
     int i;
 
     for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
@@ -5018,6 +5020,13 @@ static void test_png_color_formats(void)
            broken(td[i].bit_depth == 1 && td[i].color_type == 0 && format == PixelFormat32bppARGB), /* XP */
            "%d: expected %#x, got %#x\n", i, td[i].format, format);
 
+        status = GdipGetImageFlags(image, &flags);
+        expect(Ok, status);
+todo_wine_if(td[i].bit_depth > 1 && td[i].color_type == 0)
+        ok((flags & td[i].flags) == td[i].flags ||
+           broken(td[i].bit_depth == 1 && td[i].color_type == 0 && (flags & ImageFlagsColorSpaceGRAY)), /* XP */
+           "%d: expected %#x, got %#x\n", i, td[i].flags, flags);
+
         GdipDisposeImage(image);
     }
 }




More information about the wine-cvs mailing list