Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/user32/tests/bmp1x1_32bpp.bmp | Bin 0 -> 58 bytes dlls/user32/tests/resource.rc | 3 ++ dlls/user32/tests/static.c | 60 +++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 dlls/user32/tests/bmp1x1_32bpp.bmp
diff --git a/dlls/user32/tests/bmp1x1_32bpp.bmp b/dlls/user32/tests/bmp1x1_32bpp.bmp new file mode 100644 index 0000000000000000000000000000000000000000..3b565be8c2b1ca5b8d121df4e3b6f57822b72600 GIT binary patch literal 58 hcmZ?rwPJt(Ga#h_#EfvP0Aw*Ruz*QaLQu)r1pq_i0r>y`
literal 0 HcmV?d00001
diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc index 4301af6d68..89aaf5a61c 100644 --- a/dlls/user32/tests/resource.rc +++ b/dlls/user32/tests/resource.rc @@ -249,6 +249,9 @@ FONT 8, "MS Shell Dlg" /* @makedep: test_mono.bmp */ 100 BITMAP test_mono.bmp
+/* @makedep: bmp1x1_32bpp.bmp */ +101 BITMAP bmp1x1_32bpp.bmp + 1 MENU { POPUP "&File" diff --git a/dlls/user32/tests/static.c b/dlls/user32/tests/static.c index 8776c3a9e0..0c453d08a6 100644 --- a/dlls/user32/tests/static.c +++ b/dlls/user32/tests/static.c @@ -130,6 +130,65 @@ static void test_set_text(void) DestroyWindow(hStatic); }
+static void test_image(HBITMAP image) +{ + BITMAP bm; + HDC hdc; + BITMAPINFO info; + BYTE bits[4]; + + GetObjectW(image, sizeof(bm), &bm); + ok(bm.bmWidth == 1, "got %d\n", bm.bmWidth); + ok(bm.bmHeight == 1, "got %d\n", bm.bmHeight); + ok(bm.bmBitsPixel == 32, "got %d\n", bm.bmBitsPixel); + ok(bm.bmBits == NULL, "bmBits is not NULL\n"); + + info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + info.bmiHeader.biWidth = bm.bmWidth; + info.bmiHeader.biHeight = bm.bmHeight; + info.bmiHeader.biPlanes = 1; + info.bmiHeader.biBitCount = 32; + info.bmiHeader.biCompression = BI_RGB; + info.bmiHeader.biSizeImage = 4; + info.bmiHeader.biXPelsPerMeter = 0; + info.bmiHeader.biYPelsPerMeter = 0; + info.bmiHeader.biClrUsed = 0; + info.bmiHeader.biClrImportant = 0; + + hdc = CreateCompatibleDC(0); + GetDIBits(hdc, image, 0, bm.bmHeight, bits, &info, DIB_RGB_COLORS); + DeleteDC(hdc); + + ok(bits[0] == 0x11 && bits[1] == 0x22 && bits[2] == 0x33 && bits[3] == 0x44, + "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); +} + +static void test_set_image(void) +{ + HWND hwnd = build_static(SS_BITMAP); + HBITMAP bmp, image; + + image = LoadImageW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(101), IMAGE_BITMAP, 0, 0, 0); + ok(image != NULL, "LoadImage failed\n"); + + test_image(image); + + bmp = (HBITMAP)SendMessageW(hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)image); + ok(bmp == NULL, "got not NULL\n"); + + bmp = (HBITMAP)SendMessageW(hwnd, STM_GETIMAGE, IMAGE_BITMAP, 0); + ok(bmp != NULL, "got NULL\n"); + ok(bmp == image, "bmp != image\n"); + + bmp = (HBITMAP)SendMessageW(hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)image); + ok(bmp != NULL, "got NULL\n"); + ok(bmp == image, "bmp != image\n"); + test_image(image); + + DestroyWindow(hwnd); + DeleteObject(image); +} + START_TEST(static) { static const char szClassName[] = "testclass"; @@ -162,6 +221,7 @@ START_TEST(static) test_updates(SS_ETCHEDHORZ, TODO_COUNT); test_updates(SS_ETCHEDVERT, TODO_COUNT); test_set_text(); + test_set_image();
DestroyWindow(hMainWnd); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64642
Your paranoid android.
=== w1064v1507 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_2scr (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_ar (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_he (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_ja (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_zh_CN (32 bit report) ===
user32: cursoricon.c:2366: Test failed: wrong info cursor 000203D5/00010003 cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1507 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_ar (32 bit report) ===
user32: menu.c:2339: Test failed: test 8 menu.c:2339: Test failed: test 10 menu.c:2339: Test failed: test 12 menu.c:2339: Test failed: test 14 menu.c:2339: Test failed: test 16
=== w1064v1809_he (32 bit report) ===
user32: menu.c:2339: Test failed: test 6 menu.c:2339: Test failed: test 8 menu.c:2339: Test failed: test 10 menu.c:2339: Test failed: test 12 menu.c:2339: Test failed: test 14 menu.c:2339: Test failed: test 16
=== w8 (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809 (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_2scr (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_ar (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_he (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_ja (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809_zh_CN (32 bit report) ===
user32: sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809 (32 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 00040066 win.c:3170: Test failed: GetFocus() = 00000000 win.c:3182: Test failed: GetFocus() = 00000000 win.c:3185: Test failed: GetFocus() = 00000000 win.c:3188: Test failed: GetFocus() = 00000000 win.c:3191: Test failed: GetActiveWindow() = 00040066 win.c:3195: Test failed: GetFocus() = 00000000 win.c:3198: Test failed: GetFocus() = 00000000 win.c:3892: Test failed: hwnd 00060176/000B02E8 message 0737 win.c:3897: Test failed: hwnd 000B02E8/000B02E8 message 0202 win.c:3902: Test failed: hwnd 000B02E8/000B02E8 message 0203 win.c:3906: Test failed: message 0202 available
=== w1064v1809_2scr (32 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 000A01A4 win.c:3170: Test failed: GetFocus() = 00000000 win.c:3182: Test failed: GetFocus() = 00000000 win.c:3185: Test failed: GetFocus() = 00000000 win.c:3188: Test failed: GetFocus() = 00000000 win.c:3191: Test failed: GetActiveWindow() = 000A01A4 win.c:3195: Test failed: GetFocus() = 00000000 win.c:3198: Test failed: GetFocus() = 00000000 win.c:3892: Test failed: hwnd 000202BC/0012018A message 0737 win.c:3897: Test failed: hwnd 0012018A/0012018A message 0202 win.c:3902: Test failed: hwnd 0012018A/0012018A message 0203 win.c:3906: Test failed: message 0202 available
=== w1064v1809_he (32 bit report) ===
user32: win.c:3460: Test failed: GetCapture() = 00020306 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3407: Test failed: VK_LBUTTON should not be pressed, state ff81 win.c:3506: Test failed: GetCapture() = 00000000 win.c:3510: Test failed: GetCapture() = 00000000 win.c:3517: Test failed: GetCapture() = 00000000 win.c:3521: Test failed: GetCapture() = 00000000 win.c:3524: Test failed: SetCapture() = 00000000 win.c:3727: Test failed: message 0738 available
=== w1064v1809_ja (32 bit report) ===
user32: win.c:9439: Test failed: didn't get start_event win.c:9443: Test failed: WindowFromPoint returned 0002033C, expected 00000000 win.c:9451: Test failed: WindowFromPoint returned 0002033C, expected 00000000 win.c:9352: Test failed: WindowFromPoint returned 00030080, expected 0002033C win.c:9359: Test failed: WindowFromPoint returned 00030080, expected 0006007A win.c:9365: Test failed: CreateWindowEx failed win.c:9380: Test failed: transparent window didn't get WM_NCHITTEST message win.c:9381: Test failed: button under static window didn't get WM_LBUTTONUP win.c:3727: Test failed: message 0738 available win.c:3852: Test failed: hwnd 000202F0 message 7fff win.c:3931: Test failed: hwnd 000202F0/00110328 message 7fff win.c:3934: Test failed: hwnd 000202F0/00110328 message 7fff
=== w1064v1809_zh_CN (32 bit report) ===
user32: win.c:3852: Test failed: hwnd 00010382 message 0282 win.c:3931: Test failed: hwnd 00010382/000C03DE message 0282 win.c:3934: Test failed: hwnd 00010382/000C03DE message 0282
=== w1064v1809 (64 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 0000000000030044 win.c:3170: Test failed: GetFocus() = 0000000000000000 win.c:3182: Test failed: GetFocus() = 0000000000000000 win.c:3185: Test failed: GetFocus() = 0000000000000000 win.c:3188: Test failed: GetFocus() = 0000000000000000 win.c:3191: Test failed: GetActiveWindow() = 0000000000030044 win.c:3195: Test failed: GetFocus() = 0000000000000000 win.c:3198: Test failed: GetFocus() = 0000000000000000 win.c:3892: Test failed: hwnd 0000000000020176/00000000000F0048 message 0737 win.c:3897: Test failed: hwnd 00000000000F0048/00000000000F0048 message 0202 win.c:3902: Test failed: hwnd 00000000000F0048/00000000000F0048 message 0203 win.c:3906: Test failed: message 0202 available
=== debian10 (32 bit Chinese:China report) ===
user32: clipboard.c:760: Test failed: 3: gle 5 clipboard.c:765: Test failed: 3.0: got 0000 instead of 000e clipboard.c:805: Test failed: 3: gle 1418 clipboard.c:815: Test failed: 3: count 2 clipboard.c:818: Test failed: 3: gle 1418 clipboard.c:852: Test failed: 3: format 000e got data 0005003F clipboard.c:853: Test failed: 3.0: formats 00000000 have been rendered clipboard.c:858: Test failed: 3.0: formats 00000000 have been rendered clipboard.c:852: Test failed: 3: format 0003 got data 00217508 clipboard.c:853: Test failed: 3.1: formats 00000000 have been rendered clipboard.c:858: Test failed: 3.1: formats 00000000 have been rendered