Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/user32/tests/win.c | 70 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 0156987f529..b93839e40b5 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -12328,6 +12328,75 @@ static void test_DragDetect(void) ok(!(GetKeyState( VK_LBUTTON ) & 0x8000), "got VK_LBUTTON\n"); }
+static void test_WM_NCCALCSIZE(void) +{ + WNDCLASSA cls; + HWND hwnd; + NCCALCSIZE_PARAMS params; + WINDOWPOS winpos; + RECT client_rect, window_rect; + LRESULT ret; + + cls.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW; + cls.lpfnWndProc = DefWindowProcA; + cls.cbClsExtra = 0; + cls.cbWndExtra = 0; + cls.hInstance = GetModuleHandleA(0); + cls.hIcon = 0; + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); + cls.hbrBackground = GetStockObject(WHITE_BRUSH); + cls.lpszMenuName = NULL; + cls.lpszClassName = "dummy_window_class"; + ret = RegisterClassA(&cls); + ok(ret, "RegisterClass error %u\n", GetLastError()); + + hwnd = CreateWindowExA(0, "dummy_window_class", NULL, + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP, + 100, 100, 200, 200, 0, 0, GetModuleHandleA(NULL), NULL); + ok(hwnd != 0, "CreateWindowEx error %u\n", GetLastError()); + + GetWindowRect(hwnd, &window_rect); + params.rgrc[0] = window_rect; + params.rgrc[1] = window_rect; + GetClientRect(hwnd, &client_rect); + MapWindowPoints(hwnd, 0, (POINT *)&client_rect, 2); + params.rgrc[2] = client_rect; + + winpos.hwnd = hwnd; + winpos.hwndInsertAfter = HWND_TOP; + winpos.x = window_rect.left; + winpos.y = window_rect.top; + winpos.cx = window_rect.right - window_rect.left; + winpos.cy = window_rect.bottom - window_rect.top; + winpos.flags = SWP_NOMOVE; + params.lppos = &winpos; + + ret = SendMessageW(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)¶ms); +todo_wine + ok(!ret, "got %08x\n", ret); + ok(EqualRect(¶ms.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(¶ms.rgrc[0])); + + params.rgrc[0] = window_rect; + ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)¶ms); +todo_wine + ok(!ret, "got %08x\n", ret); + ok(EqualRect(¶ms.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(¶ms.rgrc[0])); + + GetWindowRect(hwnd, &window_rect); + ret = SendMessageW(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect); +todo_wine + ok(!ret, "got %08x\n", ret); + ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect)); + + GetWindowRect(hwnd, &window_rect); + ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect); +todo_wine + ok(!ret, "got %08x\n", ret); + ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect)); + + DestroyWindow(hwnd); +} + START_TEST(win) { char **argv; @@ -12497,6 +12566,7 @@ START_TEST(win) test_SC_SIZE(); test_cancel_mode(); test_DragDetect(); + test_WM_NCCALCSIZE();
/* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook);
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=104363
Your paranoid android.
=== w1064_tsign (32 bit report) ===
user32: win.c:4135: Test failed: hwnd 00030260/00030260 message 0200 win.c:4137: Test failed: wparam 0 win.c:4148: Test failed: hwnd 00030260/00030260 message 0203 win.c:4152: Test failed: message 0202 available
=== w10pro64 (32 bit report) ===
user32: win.c:9768: Test failed: Timed out waiting for the child process win.c:2271: Test failed: style 0x200000: expected !100 win.c:2271: Test failed: style 0x300000: expected !100
=== w10pro64 (64 bit report) ===
user32: win.c:2271: Test failed: style 0x200000: expected !100 win.c:2271: Test failed: style 0x300000: expected !100
=== debian11 (32 bit Japanese:Japan report) ===
user32: win.c:10433: Test failed: Expected foreground window 0, got 00D10074 win.c:10439: Test failed: Expected foreground window 00020052, got 00D10074