[SHELL32_APITEST] Certainly close newly-opened windows (#8171)

It's frustrating when windows open
during a test and remain after the test
is over.
JIRA issue: ROSTESTS-402
- Delete closewnd.cpp. Enhance
  closewnd.h.
- Modify ShellExecCmdLine,
  ShellExec_RunDLL, ShellExecuteEx,
  and ShellExecuteW testcases.
- Certainly close the newly-opened
  windows.
This commit is contained in:
Katayama Hirofumi MZ 2025-06-26 18:20:49 +09:00 committed by GitHub
parent f1332c7722
commit f7c36c6d94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 210 additions and 277 deletions

View file

@ -314,17 +314,30 @@ static BOOL TEST_Start(void)
static void TEST_End(void)
{
GetWindowListForClose(&s_List2);
CloseNewWindows(&s_List1, &s_List2);
FreeWindowList(&s_List1);
FreeWindowList(&s_List2);
DeleteFileW(s_win_test_exe);
DeleteFileW(s_sys_test_exe);
DeleteFileW(s_win_txt_file);
DeleteFileW(s_sys_txt_file);
DeleteFileW(s_win_bat_file);
DeleteFileW(s_sys_bat_file);
// Execution can be asynchronous; you have to wait for it to finish.
INT nCount = GetWindowCount();
for (INT i = 0; i < 100; ++i)
{
INT nOldCount = nCount;
Sleep(3000);
nCount = GetWindowCount();
if (nOldCount == nCount)
break;
}
Sleep(3000);
// Close newly-opened window(s)
GetWindowList(&s_List2);
CloseNewWindows(&s_List1, &s_List2);
FreeWindowList(&s_List1);
FreeWindowList(&s_List2);
}
static void test_properties()