gdi32/tests: Win9x's GetDIBits() sets biSizeImage to zero for BI_RGB dibs.

This commit is contained in:
Huw Davies 2009-03-09 17:03:40 +00:00 committed by Alexandre Julliard
parent f7608053e7
commit 3d461dbe85
1 changed files with 12 additions and 4 deletions

View File

@ -1564,7 +1564,9 @@ static void test_GetDIBits(void)
lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS);
ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n",
lines, bm.bmHeight, GetLastError()); lines, bm.bmHeight, GetLastError());
ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1) ||
broken(bi->bmiHeader.biSizeImage == 0), /* win9x */
"expected 16*4, got %u\n", bi->bmiHeader.biSizeImage);
/* the color table consists of black and white */ /* the color table consists of black and white */
ok(bi->bmiColors[0].rgbRed == 0 && bi->bmiColors[0].rgbGreen == 0 && ok(bi->bmiColors[0].rgbRed == 0 && bi->bmiColors[0].rgbGreen == 0 &&
@ -1614,7 +1616,9 @@ static void test_GetDIBits(void)
lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS);
ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n",
lines, bm.bmHeight, GetLastError()); lines, bm.bmHeight, GetLastError());
ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24) ||
broken(bi->bmiHeader.biSizeImage == 0), /* win9x */
"expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage);
/* the color table doesn't exist for 24-bit images */ /* the color table doesn't exist for 24-bit images */
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
@ -1675,7 +1679,9 @@ static void test_GetDIBits(void)
lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS);
ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n",
lines, bm.bmHeight, GetLastError()); lines, bm.bmHeight, GetLastError());
ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1) ||
broken(bi->bmiHeader.biSizeImage == 0), /* win9x */
"expected 16*4, got %u\n", bi->bmiHeader.biSizeImage);
/* the color table consists of black and white */ /* the color table consists of black and white */
ok(bi->bmiColors[0].rgbRed == 0 && bi->bmiColors[0].rgbGreen == 0 && ok(bi->bmiColors[0].rgbRed == 0 && bi->bmiColors[0].rgbGreen == 0 &&
@ -1726,7 +1732,9 @@ todo_wine
lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS);
ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n",
lines, bm.bmHeight, GetLastError()); lines, bm.bmHeight, GetLastError());
ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24) ||
broken(bi->bmiHeader.biSizeImage == 0), /* win9x */
"expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage);
/* the color table doesn't exist for 24-bit images */ /* the color table doesn't exist for 24-bit images */
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)