[gdi32/tests] Fix a few failures on Win9x
Paul Vriens
paul.vriens.wine at gmail.com
Mon Dec 15 00:51:50 CST 2008
This is a multi-part message in MIME format.
--------------070508080205080006050203
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Changelog
Fix a few failures on Win9x
--
Cheers,
Paul.
--------------070508080205080006050203
Content-Type: text/x-diff;
name="0002-Fix-a-few-failures-on-Win9x.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="0002-Fix-a-few-failures-on-Win9x.patch"
>From d1721c99ac2822ccda35db831d0a99374f204ab3 Mon Sep 17 00:00:00 2001
From: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date: Fri, 12 Dec 2008 17:07:54 +0100
Subject: [PATCH] Fix a few failures on Win9x
---
dlls/gdi32/tests/bitmap.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c
index 7683d35..3f8a674 100644
--- a/dlls/gdi32/tests/bitmap.c
+++ b/dlls/gdi32/tests/bitmap.c
@@ -1018,9 +1018,12 @@ static void test_bitmap(void)
SetLastError(0xdeadbeef);
hbmp = CreateBitmap(0x7ffffff + 1, 1, 1, 1, NULL);
- ok(!hbmp, "CreateBitmap should fail\n");
- ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
+ ok(!hbmp || broken(hbmp != NULL /* Win9x */), "CreateBitmap should fail\n");
+ if (!hbmp)
+ ok(GetLastError() == ERROR_INVALID_PARAMETER,
+ "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
+ else
+ DeleteObject(hbmp);
hbmp = CreateBitmap(15, 15, 1, 1, NULL);
assert(hbmp != NULL);
@@ -1040,7 +1043,8 @@ static void test_bitmap(void)
assert(sizeof(buf) == sizeof(buf_cmp));
ret = GetBitmapBits(hbmp, 0, NULL);
- ok(ret == bm.bmWidthBytes * bm.bmHeight, "%d != %d\n", ret, bm.bmWidthBytes * bm.bmHeight);
+ ok(ret == bm.bmWidthBytes * bm.bmHeight || broken(ret == 0 /* Win9x */),
+ "%d != %d\n", ret, bm.bmWidthBytes * bm.bmHeight);
memset(buf_cmp, 0xAA, sizeof(buf_cmp));
memset(buf_cmp, 0, bm.bmWidthBytes * bm.bmHeight);
@@ -1323,6 +1327,8 @@ static void test_GetDIBits_selected_DDB(BOOL monochrome)
/* Get the palette indices */
res = GetDIBits(dc, ddb, 0, 0, NULL, info2, DIB_PAL_COLORS);
+ if (res == 0 && GetLastError() == ERROR_INVALID_PARAMETER) /* Win9x */
+ res = GetDIBits(dc, ddb, 0, height, NULL, info2, DIB_PAL_COLORS);
ok(res, "GetDIBits failed\n");
for (i=0;i < 1 << info->bmiHeader.biSizeImage; i++)
@@ -1465,7 +1471,7 @@ static void test_GetDIBits(void)
ok(!bm.bmBits, "wrong bmBits %p\n", bm.bmBits);
bytes = GetBitmapBits(hbmp, 0, NULL);
- ok(bytes == sizeof(bmp_bits_1), "expected 16*2 got %d bytes\n", bytes);
+ ok(bytes == sizeof(bmp_bits_1) || broken(bytes == 0 /* Win9x */), "expected 16*2 got %d bytes\n", bytes);
bytes = GetBitmapBits(hbmp, sizeof(buf), buf);
ok(bytes == sizeof(bmp_bits_1), "expected 16*2 got %d bytes\n", bytes);
ok(!memcmp(buf, bmp_bits_1, sizeof(bmp_bits_1)), "bitmap bits don't match\n");
--
1.6.0.4
--------------070508080205080006050203--
More information about the wine-patches
mailing list