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

Alexandre Julliard julliard at winehq.org
Fri Dec 7 11:02:02 CST 2007


Module: wine
Branch: master
Commit: 34ab21d11ecdec40690b300bb0e20a4a581e14f5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=34ab21d11ecdec40690b300bb0e20a4a581e14f5

Author: Rob Shearman <rob at codeweavers.com>
Date:   Fri Dec  7 14:14:25 2007 +0000

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

Destroy the windows that have been created when they are no longer needed.

---

 dlls/ole32/tests/marshal.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index ae82e37..035a725 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -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;
-    MSG msg;
 
     memset(&wndclass, 0, sizeof(wndclass));
     wndclass.lpfnWndProc = window_proc;
     wndclass.lpszClassName = "WineCOMTest";
     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);
     ok(hwnd_app != NULL, "Window creation failed\n");
@@ -1852,6 +1856,7 @@ static void test_message_reentrancy(void)
         TranslateMessage(&msg);
         DispatchMessage(&msg);
     }
+    DestroyWindow(hwnd_app);
 }
 
 static HRESULT WINAPI TestMsg_IClassFactory_CreateInstance(
@@ -1917,6 +1922,7 @@ static void test_call_from_message(void)
         TranslateMessage(&msg);
         DispatchMessage(&msg);
     }
+    DestroyWindow(hwnd_app);
 }
 
 static void test_WM_QUIT_handling(void)
@@ -2873,7 +2879,6 @@ static void test_channel_hook(void)
 
 START_TEST(marshal)
 {
-    WNDCLASS wndclass;
     HMODULE hOle32 = GetModuleHandle("ole32");
     int argc;
     char **argv;
@@ -2890,11 +2895,7 @@ START_TEST(marshal)
         return;
     }
 
-    /* register a window class used in several tests */
-    memset(&wndclass, 0, sizeof(wndclass));
-    wndclass.lpfnWndProc = window_proc;
-    wndclass.lpszClassName = "WineCOMTest";
-    RegisterClass(&wndclass);
+    register_test_window();
 
     test_cocreateinstance_proxy();
 




More information about the wine-cvs mailing list