Commit 34ab21d1 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ole32: Register the window used in the marshal tests only once.

Destroy the windows that have been created when they are no longer needed.
parent cf48f090
...@@ -1831,15 +1831,19 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l ...@@ -1831,15 +1831,19 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
} }
} }
static void test_message_reentrancy(void) static void register_test_window(void)
{ {
WNDCLASS wndclass; WNDCLASS wndclass;
MSG msg;
memset(&wndclass, 0, sizeof(wndclass)); memset(&wndclass, 0, sizeof(wndclass));
wndclass.lpfnWndProc = window_proc; wndclass.lpfnWndProc = window_proc;
wndclass.lpszClassName = "WineCOMTest"; wndclass.lpszClassName = "WineCOMTest";
RegisterClass(&wndclass); RegisterClass(&wndclass);
}
static void test_message_reentrancy(void)
{
MSG msg;
hwnd_app = CreateWindow("WineCOMTest", NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, 0); hwnd_app = CreateWindow("WineCOMTest", NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, 0);
ok(hwnd_app != NULL, "Window creation failed\n"); ok(hwnd_app != NULL, "Window creation failed\n");
...@@ -1852,6 +1856,7 @@ static void test_message_reentrancy(void) ...@@ -1852,6 +1856,7 @@ static void test_message_reentrancy(void)
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
DestroyWindow(hwnd_app);
} }
static HRESULT WINAPI TestMsg_IClassFactory_CreateInstance( static HRESULT WINAPI TestMsg_IClassFactory_CreateInstance(
...@@ -1917,6 +1922,7 @@ static void test_call_from_message(void) ...@@ -1917,6 +1922,7 @@ static void test_call_from_message(void)
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
DestroyWindow(hwnd_app);
} }
static void test_WM_QUIT_handling(void) static void test_WM_QUIT_handling(void)
...@@ -2873,7 +2879,6 @@ static void test_channel_hook(void) ...@@ -2873,7 +2879,6 @@ static void test_channel_hook(void)
START_TEST(marshal) START_TEST(marshal)
{ {
WNDCLASS wndclass;
HMODULE hOle32 = GetModuleHandle("ole32"); HMODULE hOle32 = GetModuleHandle("ole32");
int argc; int argc;
char **argv; char **argv;
...@@ -2890,11 +2895,7 @@ START_TEST(marshal) ...@@ -2890,11 +2895,7 @@ START_TEST(marshal)
return; return;
} }
/* register a window class used in several tests */ register_test_window();
memset(&wndclass, 0, sizeof(wndclass));
wndclass.lpfnWndProc = window_proc;
wndclass.lpszClassName = "WineCOMTest";
RegisterClass(&wndclass);
test_cocreateinstance_proxy(); test_cocreateinstance_proxy();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment