Vincent Povirk : gdiplus: Test getting/ setting pixels of indexed color bitmaps.
Alexandre Julliard
julliard at winehq.org
Mon Feb 1 08:55:57 CST 2010
Module: wine
Branch: master
Commit: 3815add31bb7db8b02710f4297ca829e7161f71d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3815add31bb7db8b02710f4297ca829e7161f71d
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Sat Jan 30 18:43:31 2010 -0600
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;
More information about the wine-cvs
mailing list