From 9d59aeab507e231a27db8eef3c32303919386c06 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sat, 30 Jan 2010 18:43:31 -0600 Subject: [PATCH 2/3] gdiplus: Test getting/setting pixels of indexed color bitmaps. --- dlls/gdiplus/tests/image.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index fe49425..53d66e0 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1133,6 +1133,7 @@ static void test_palette(void) INT size; BYTE buffer[1040]; ColorPalette *palette=(ColorPalette*)buffer; + ARGB color=0; /* test initial palette from non-indexed bitmap */ stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppRGB, NULL, &bitmap); @@ -1178,6 +1179,22 @@ static void test_palette(void) expect(0xff000000, palette->Entries[0]); expect(0xffffffff, palette->Entries[1]); + /* test getting/setting pixels */ + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + todo_wine expect(Ok, stat); + todo_wine expect(0xff000000, color); + + stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffffffff); + todo_wine ok((stat == Ok) || + broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); + + if (stat == Ok) + { + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + expect(Ok, stat); + expect(0xffffffff, color); + } + GdipDisposeImage((GpImage*)bitmap); /* test initial palette on 4-bit bitmap */ @@ -1195,6 +1212,22 @@ static void test_palette(void) check_halftone_palette(palette); + /* test getting/setting pixels */ + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + todo_wine expect(Ok, stat); + todo_wine expect(0xff000000, color); + + stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffff00ff); + todo_wine ok((stat == Ok) || + broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); + + if (stat == Ok) + { + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + expect(Ok, stat); + expect(0xffff00ff, color); + } + GdipDisposeImage((GpImage*)bitmap); /* test initial palette on 8-bit bitmap */ @@ -1212,6 +1245,22 @@ static void test_palette(void) check_halftone_palette(palette); + /* test getting/setting pixels */ + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + todo_wine expect(Ok, stat); + todo_wine expect(0xff000000, color); + + stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffcccccc); + todo_wine ok((stat == Ok) || + broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat); + + if (stat == Ok) + { + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + expect(Ok, stat); + expect(0xffcccccc, color); + } + /* test setting/getting a different palette */ palette->Entries[1] = 0xffcccccc; -- 1.6.3.3