Nikolay Sivov : user32/tests: Restore original procedure to let control clean up.

Alexandre Julliard julliard at winehq.org
Thu Dec 3 10:29:51 CST 2009


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Dec  2 23:03:21 2009 +0300

user32/tests: Restore original procedure to let control clean up.

---

 dlls/user32/tests/class.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c
index 7b42ce3..940550e 100644
--- a/dlls/user32/tests/class.c
+++ b/dlls/user32/tests/class.c
@@ -707,6 +707,7 @@ static void test_builtinproc(void)
 
         oldproc = (WNDPROC)SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)ClassTest_WndProc);
         ok(IS_WNDPROC_HANDLE(oldproc) == FALSE, "Class %s shouldn't return a handle\n", NORMAL_CLASSES[i]);
+        SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)oldproc);
         DestroyWindow(hwnd);
     }
 
@@ -747,6 +748,8 @@ static void test_builtinproc(void)
     CallWindowProcW((WNDPROC)GetWindowLongPtrW(hwnd, GWLP_WNDPROC), hwnd, WM_GETTEXT, 120, (LPARAM)buf);
     ok(memcmp(buf, classW, sizeof(classW)) == 0, "WM_GETTEXT invalid return\n");
 
+    SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)oldproc);
+
     DestroyWindow(hwnd);
 
     hwnd = CreateWindowA(WC_EDITA, classA, WS_OVERLAPPEDWINDOW,
@@ -768,7 +771,7 @@ static void test_builtinproc(void)
     CallWindowProcW((WNDPROC)GetWindowLongPtrW(hwnd, GWLP_WNDPROC), hwnd, WM_GETTEXT, 120, (LPARAM)buf);
     ok(memcmp(buf, classW, sizeof(classW)) == 0, "WM_GETTEXT invalid return\n");
 
-    SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)ClassTest_WndProc);
+    oldproc = (WNDPROC)SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)ClassTest_WndProc);
     SetWindowTextW(hwnd, unistring);
     CallWindowProcW((WNDPROC)GetWindowLongPtrW(hwnd, GWLP_WNDPROC), hwnd, WM_GETTEXT, 120, (LPARAM)buf);
     ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
@@ -781,6 +784,8 @@ static void test_builtinproc(void)
     CallWindowProcA((WNDPROC)GetWindowLongPtrA(hwnd, GWLP_WNDPROC), hwnd, WM_GETTEXT, 120, (LPARAM)buf);
     ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
 
+    SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)oldproc);
+
     DestroyWindow(hwnd);
 }
 




More information about the wine-cvs mailing list