mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 20:34:59 +00:00
[SHELL32_APITEST] Try to fix Test Win2003_x64 again
This commit is contained in:
parent
45a4e53fa4
commit
60b89da383
6 changed files with 40 additions and 29 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include "shelltest.h"
|
#include "shelltest.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
|
#include "shell32_apitest_sub.h"
|
||||||
|
|
||||||
static char s_sub_program[MAX_PATH];
|
static char s_sub_program[MAX_PATH];
|
||||||
|
|
||||||
|
@ -268,4 +269,6 @@ START_TEST(FindExecutable)
|
||||||
DeleteFileA(s_sys_bat_file);
|
DeleteFileA(s_sys_bat_file);
|
||||||
DeleteFileA(s_win_txt_file);
|
DeleteFileA(s_win_txt_file);
|
||||||
DeleteFileA(s_sys_txt_file);
|
DeleteFileA(s_sys_txt_file);
|
||||||
|
|
||||||
|
DoWaitForWindow(CLASSNAME, CLASSNAME, TRUE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// NOTE: This test program closes the Explorer windows before tests.
|
// NOTE: This test program closes the Explorer windows before tests.
|
||||||
|
|
||||||
#include "shelltest.h"
|
#include "shelltest.h"
|
||||||
#include "SHChangeNotify.h"
|
#include "shell32_apitest_sub.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <versionhelpers.h>
|
#include <versionhelpers.h>
|
||||||
|
@ -32,31 +32,6 @@ static WCHAR s_szSubProgram[MAX_PATH];
|
||||||
static HANDLE s_hThread = NULL;
|
static HANDLE s_hThread = NULL;
|
||||||
static HANDLE s_hEvent = NULL;
|
static HANDLE s_hEvent = NULL;
|
||||||
|
|
||||||
static HWND DoWaitForWindow(LPCWSTR clsname, LPCWSTR text, BOOL bClosing, BOOL bForce)
|
|
||||||
{
|
|
||||||
HWND hwnd = NULL;
|
|
||||||
for (INT i = 0; i < 50; ++i)
|
|
||||||
{
|
|
||||||
hwnd = FindWindowW(clsname, text);
|
|
||||||
if (bClosing)
|
|
||||||
{
|
|
||||||
if (!hwnd)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (bForce)
|
|
||||||
PostMessage(hwnd, WM_CLOSE, 0, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (hwnd)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Sleep(1);
|
|
||||||
}
|
|
||||||
return hwnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL DoCreateEmptyFile(LPCWSTR pszFileName)
|
static BOOL DoCreateEmptyFile(LPCWSTR pszFileName)
|
||||||
{
|
{
|
||||||
FILE *fp = _wfopen(pszFileName, L"wb");
|
FILE *fp = _wfopen(pszFileName, L"wb");
|
||||||
|
@ -964,5 +939,5 @@ START_TEST(SHChangeNotify)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DoWaitForWindow(CLASSNAME, CLASSNAME, TRUE, TRUE);
|
DoWaitForWindow(CLASSNAME, CLASSNAME, TRUE, TRUE);
|
||||||
Sleep(500);
|
Sleep(100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
#include <versionhelpers.h>
|
#include <versionhelpers.h>
|
||||||
|
#include "shell32_apitest_sub.h"
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -738,4 +739,7 @@ START_TEST(ShellExecCmdLine)
|
||||||
ok(DeleteFileA("Test File 1.txt"), "failed to delete the test file\n");
|
ok(DeleteFileA("Test File 1.txt"), "failed to delete the test file\n");
|
||||||
ok(DeleteFileA("Test File 2.bat"), "failed to delete the test file\n");
|
ok(DeleteFileA("Test File 2.bat"), "failed to delete the test file\n");
|
||||||
free(s_wi0.phwnd);
|
free(s_wi0.phwnd);
|
||||||
|
|
||||||
|
DoWaitForWindow(CLASSNAME, CLASSNAME, TRUE, TRUE);
|
||||||
|
Sleep(100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "shelltest.h"
|
#include "shelltest.h"
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "shell32_apitest_sub.h"
|
||||||
|
|
||||||
#define ok_ShellExecuteEx (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : TestShellExecuteEx
|
#define ok_ShellExecuteEx (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : TestShellExecuteEx
|
||||||
|
|
||||||
|
@ -465,4 +466,7 @@ START_TEST(ShellExecuteEx)
|
||||||
DoAppPathTest();
|
DoAppPathTest();
|
||||||
DoTestEntries();
|
DoTestEntries();
|
||||||
test_properties();
|
test_properties();
|
||||||
|
|
||||||
|
DoWaitForWindow(CLASSNAME, CLASSNAME, TRUE, TRUE);
|
||||||
|
Sleep(100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "shelltest.h"
|
#include "shelltest.h"
|
||||||
#include "SHChangeNotify.h"
|
#include "shell32_apitest_sub.h"
|
||||||
|
|
||||||
static HWND s_hwnd = NULL;
|
static HWND s_hwnd = NULL;
|
||||||
static UINT s_uRegID = 0;
|
static UINT s_uRegID = 0;
|
||||||
|
|
|
@ -59,7 +59,7 @@ inline LPITEMIDLIST DoGetPidl(DIRTYPE iDir)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline LPWSTR DoGetDir(DIRTYPE iDir)
|
static inline LPWSTR DoGetDir(DIRTYPE iDir)
|
||||||
{
|
{
|
||||||
static size_t s_index = 0;
|
static size_t s_index = 0;
|
||||||
static WCHAR s_pathes[3][MAX_PATH];
|
static WCHAR s_pathes[3][MAX_PATH];
|
||||||
|
@ -71,3 +71,28 @@ inline LPWSTR DoGetDir(DIRTYPE iDir)
|
||||||
s_index = (s_index + 1) % _countof(s_pathes);
|
s_index = (s_index + 1) % _countof(s_pathes);
|
||||||
return psz;
|
return psz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline HWND DoWaitForWindow(LPCWSTR clsname, LPCWSTR text, BOOL bClosing, BOOL bForce)
|
||||||
|
{
|
||||||
|
HWND hwnd = NULL;
|
||||||
|
for (INT i = 0; i < 50; ++i)
|
||||||
|
{
|
||||||
|
hwnd = FindWindowW(clsname, text);
|
||||||
|
if (bClosing)
|
||||||
|
{
|
||||||
|
if (!hwnd)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (bForce)
|
||||||
|
PostMessage(hwnd, WM_CLOSE, 0, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (hwnd)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sleep(1);
|
||||||
|
}
|
||||||
|
return hwnd;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue