[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:
Katayama Hirofumi MZ 2024-07-08 00:34:18 +09:00 committed by GitHub
parent 073f594749
commit 172d65327b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 0 deletions

View file

@ -51,6 +51,7 @@ list(APPEND SOURCE
SetProp.c
SetScrollInfo.c
SetScrollRange.c
SetWindowPlacement.c
ShowWindow.c
SwitchToThisWindow.c
SystemMenu.c

View 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);
}

View file

@ -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 },