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

This commit is contained in:
Nikolay Sivov 2009-12-02 23:03:21 +03:00 committed by Alexandre Julliard
parent 941d69e544
commit 48cb3a30b5
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}