From 1ad19cc9ceb259be26c9329b851a8739a521fb34 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 3 Mar 2009 10:24:08 +0000 Subject: [PATCH] gdi32/tests: Improve some test failure messages. --- dlls/gdi32/tests/bitmap.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index b1ba7a0607c..c46c745c058 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -101,7 +101,17 @@ static void test_bitmap_info(HBITMAP hbm, INT expected_depth, const BITMAPINFOHE memset(buf, 0xAA, sizeof(buf)); ret = GetBitmapBits(hbm, sizeof(buf), buf); ok(ret == bm.bmWidthBytes * bm.bmHeight, "%d != %d\n", ret, bm.bmWidthBytes * bm.bmHeight); - ok(!memcmp(buf, buf_cmp, sizeof(buf)), "buffers do not match\n"); + ok(!memcmp(buf, buf_cmp, sizeof(buf)), "buffers do not match, depth %d\n", bmih->biBitCount); + if(memcmp(buf, buf_cmp, sizeof(buf))) + { + int i; + for(i = 0; i < sizeof(buf); i++) + if(buf[i] != buf_cmp[i]) + { + trace("first mismatched byte %d: got %02x expected %02x\n", i, buf[i], buf_cmp[i]); + break; + } + } /* test various buffer sizes for GetObject */ ret = GetObject(hbm, sizeof(*bma) * 2, bma); @@ -427,7 +437,7 @@ static void test_dib_bits_access( HBITMAP hdib, void *bits ) pbmi->bmiHeader.biCompression = BI_RGB; ret = SetDIBits( hdc, hdib, 0, 16, data, pbmi, DIB_RGB_COLORS ); - ok( ret == 16, "SetDIBits failed\n" ); + ok(ret == 16, "SetDIBits failed: expected 16 got %d\n", ret); ok(VirtualQuery(bits, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); @@ -2185,7 +2195,7 @@ static void test_get16dibits(void) info->bmiHeader.biCompression = BI_RGB; ret = GetDIBits(screen_dc, hbmp, 0, 0, NULL, info, 0); - ok(ret != 0, "GetDIBits failed\n"); + ok(ret != 0, "GetDIBits failed got %d\n", ret); for (p = ((BYTE *) info) + sizeof(info->bmiHeader); (p - ((BYTE *) info)) < info_len; p++) if (*p != '!')