mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[USER32_APITEST] Add SetWindowPlacement testcase (#7082)
Verify behavior of NtUserSetWindowPlacement function. JIRA issue: N/A Add SetWindowPlacement testcase into user32_apitest.
This commit is contained in:
parent
073f594749
commit
172d65327b
3 changed files with 47 additions and 0 deletions
|
@ -51,6 +51,7 @@ list(APPEND SOURCE
|
|||
SetProp.c
|
||||
SetScrollInfo.c
|
||||
SetScrollRange.c
|
||||
SetWindowPlacement.c
|
||||
ShowWindow.c
|
||||
SwitchToThisWindow.c
|
||||
SystemMenu.c
|
||||
|
|
44
modules/rostests/apitests/user32/SetWindowPlacement.c
Normal file
44
modules/rostests/apitests/user32/SetWindowPlacement.c
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* PROJECT: ReactOS API tests
|
||||
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
|
||||
* PURPOSE: Tests for Get/SetWindowPlacement
|
||||
* COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
START_TEST(SetWindowPlacement)
|
||||
{
|
||||
HWND hwnd;
|
||||
WINDOWPLACEMENT wndpl;
|
||||
BOOL ret;
|
||||
|
||||
hwnd = CreateWindowW(L"BUTTON", L"Button", WS_POPUPWINDOW, 0, 0, 100, 100,
|
||||
NULL, NULL, GetModuleHandleW(NULL), NULL);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
wndpl.length = 0xFFFF;
|
||||
ret = GetWindowPlacement(hwnd, &wndpl);
|
||||
ok_int(ret, TRUE);
|
||||
ok_err(0xDEADFACE);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
wndpl.length = sizeof(wndpl);
|
||||
ret = GetWindowPlacement(hwnd, &wndpl);
|
||||
ok_int(ret, TRUE);
|
||||
ok_err(0xDEADFACE);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
wndpl.length = 0xFFFF;
|
||||
ret = SetWindowPlacement(hwnd, &wndpl);
|
||||
ok_int(ret, FALSE);
|
||||
ok_err(ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
wndpl.length = sizeof(wndpl);
|
||||
ret = SetWindowPlacement(hwnd, &wndpl);
|
||||
ok_int(ret, TRUE);
|
||||
ok_err(ERROR_SUCCESS);
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
}
|
|
@ -52,6 +52,7 @@ extern void func_SetParent(void);
|
|||
extern void func_SetProp(void);
|
||||
extern void func_SetScrollInfo(void);
|
||||
extern void func_SetScrollRange(void);
|
||||
extern void func_SetWindowPlacement(void);
|
||||
extern void func_ShowWindow(void);
|
||||
extern void func_SwitchToThisWindow(void);
|
||||
extern void func_SystemParametersInfo(void);
|
||||
|
@ -112,6 +113,7 @@ const struct test winetest_testlist[] =
|
|||
{ "SetProp", func_SetProp },
|
||||
{ "SetScrollInfo", func_SetScrollInfo },
|
||||
{ "SetScrollRange", func_SetScrollRange },
|
||||
{ "SetWindowPlacement", func_SetWindowPlacement },
|
||||
{ "ShowWindow", func_ShowWindow },
|
||||
{ "SwitchToThisWindow", func_SwitchToThisWindow },
|
||||
{ "SystemMenu", func_SystemMenu },
|
||||
|
|
Loading…
Reference in a new issue