From d88151704ea375040b38f9a3289146ddeb4bdfb0 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 4 Aug 2011 12:38:31 +0100 Subject: [PATCH] gdi32/tests: Add some GetDIBits tests with zero lines and bits parameters. --- dlls/gdi32/tests/bitmap.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 7358ccdcc99..69f4d74efd2 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -1252,6 +1252,28 @@ static void test_GetDIBits_selected_DIB(UINT bpp) ok( !memcmp( bits, bits2, dib_size ), "bit mismatch (bpp %d)\n", bpp ); + /* Test various combinations of lines = 0 and bits2 = NULL */ + memset( info2->bmiColors, 0xcc, 256 * sizeof(RGBQUAD) ); + res = GetDIBits( dc, dib, 0, 0, bits2, info2, DIB_RGB_COLORS ); +todo_wine + ok( res == 1, "got %d (bpp %d)\n", res, bpp ); + ok( !memcmp( info->bmiColors, info2->bmiColors, (1 << bpp) * sizeof(RGBQUAD) ), + "color table mismatch (bpp %d)\n", bpp ); + + memset( info2->bmiColors, 0xcc, 256 * sizeof(RGBQUAD) ); + res = GetDIBits( dc, dib, 0, 0, NULL, info2, DIB_RGB_COLORS ); +todo_wine + ok( res == 1, "got %d (bpp %d)\n", res, bpp ); + ok( !memcmp( info->bmiColors, info2->bmiColors, (1 << bpp) * sizeof(RGBQUAD) ), + "color table mismatch (bpp %d)\n", bpp ); + + memset( info2->bmiColors, 0xcc, 256 * sizeof(RGBQUAD) ); + res = GetDIBits( dc, dib, 0, info->bmiHeader.biHeight, NULL, info2, DIB_RGB_COLORS ); +todo_wine + ok( res == 1, "got %d (bpp %d)\n", res, bpp ); + ok( !memcmp( info->bmiColors, info2->bmiColors, (1 << bpp) * sizeof(RGBQUAD) ), + "color table mismatch (bpp %d)\n", bpp ); + /* Map into a 32bit-DIB */ info2->bmiHeader.biBitCount = 32; res = GetDIBits(dc, dib, 0, info->bmiHeader.biHeight, bits2, info2, DIB_RGB_COLORS); @@ -1364,7 +1386,8 @@ static void test_GetDIBits_selected_DDB(BOOL monochrome) /* Get the palette indices */ res = GetDIBits(dc, ddb, 0, 0, NULL, info2, DIB_PAL_COLORS); - ok( res, "got %d (bpp %d)\n", res, bpp ); +todo_wine + ok( res == 1, "got %d (bpp %d)\n", res, bpp ); for (i = 0; i < (1 << info->bmiHeader.biBitCount); i++) ok( colors[i] == i, "%d: got %d (bpp %d)\n", i, colors[i], bpp ); -- 2.11.4.GIT