Gabriel Ivăncescu : user32/tests: Test minimized window placement after trying to change position.
Alexandre Julliard
julliard at winehq.org
Thu Feb 4 16:15:20 CST 2021
Module: wine
Branch: master
Commit: 9ef33b5e2086b8abf18358036ce48e3310976f72
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9ef33b5e2086b8abf18358036ce48e3310976f72
Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date: Thu Feb 4 18:34:37 2021 +0200
user32/tests: Test minimized window placement after trying to change position.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/tests/win.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 47864340e39..c457ce16d4e 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -11547,6 +11547,61 @@ todo_wine
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
+ wp.flags = WPF_SETMINPOSITION;
+ wp.showCmd = SW_NORMAL;
+ wp.ptMinPosition.x = wp.ptMinPosition.y = 100;
+ wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
+ wp.rcNormalPosition = orig;
+ ret = SetWindowPlacement(hwnd, &wp);
+ ok(ret, "failed to set window placement, error %u\n", GetLastError());
+
+ ShowWindow(hwnd, SW_MINIMIZE);
+
+ ret = GetWindowPlacement(hwnd, &wp);
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+todo_wine
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
+ wine_dbgstr_rect(&wp.rcNormalPosition));
+
+ ret = SetWindowPos(hwnd, NULL, 100, 100, 151, 151, SWP_NOACTIVATE | SWP_NOZORDER);
+ ok(ret, "failed to set window pos, error %u\n", GetLastError());
+
+ ret = GetWindowPlacement(hwnd, &wp);
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
+todo_wine
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+todo_wine
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
+ wine_dbgstr_rect(&wp.rcNormalPosition));
+ GetWindowRect(hwnd, &rect);
+todo_wine
+ ok(rect.left == -32000 && rect.top == -32000, "got window rect %s\n", wine_dbgstr_rect(&rect));
+
+ ShowWindow(hwnd, SW_SHOWNORMAL);
+
+ ret = GetWindowPlacement(hwnd, &wp);
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(wp.showCmd == SW_NORMAL, "got show cmd %u\n", wp.showCmd);
+todo_wine
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+todo_wine
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
+ wine_dbgstr_rect(&wp.rcNormalPosition));
+ GetWindowRect(hwnd, &rect);
+ ok(EqualRect(&rect, &orig), "got window rect %s\n", wine_dbgstr_rect(&rect));
+
DestroyWindow(hwnd);
}
More information about the wine-cvs
mailing list