Author: cwittich Date: Sat Dec 5 20:25:28 2009 New Revision: 44416
URL: http://svn.reactos.org/svn/reactos?rev=44416&view=rev Log: sync user32_winetest with wine 1.1.34
Modified: trunk/rostests/winetests/user32/class.c trunk/rostests/winetests/user32/dde.c trunk/rostests/winetests/user32/edit.c trunk/rostests/winetests/user32/win.c
Modified: trunk/rostests/winetests/user32/class.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/class.c?r... ============================================================================== --- trunk/rostests/winetests/user32/class.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/class.c [iso-8859-1] Sat Dec 5 20:25:28 2009 @@ -572,6 +572,7 @@ SetClassLongPtrA( hwnd, GCLP_HMODULE, 0xdeadbeef ); check_instance( "EDIT", (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0xdeadbeef ); check_thread_instance( "EDIT", (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0xdeadbeef ); + DestroyWindow(hwnd); }
static void test_builtinproc(void) @@ -707,6 +708,7 @@
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 +749,8 @@ 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 +772,7 @@ 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"); @@ -780,6 +784,8 @@ SetWindowTextW(hwnd, classW); 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); }
Modified: trunk/rostests/winetests/user32/dde.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dde.c?rev... ============================================================================== --- trunk/rostests/winetests/user32/dde.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/dde.c [iso-8859-1] Sat Dec 5 20:25:28 2009 @@ -2013,7 +2013,7 @@ broken(hi == 0xbeef), /* win2k */ "Expected 0, got %08lx\n", hi);
- hglobal = GlobalAlloc(GMEM_DDESHARE, 2); + hglobal = GlobalAlloc(GMEM_DDESHARE, 2 * sizeof(*ptr)); ptr = GlobalLock(hglobal); ptr[0] = 0xcafebabe; ptr[1] = 0xdeadbeef; @@ -2067,6 +2067,8 @@ ok(ret == TRUE, "Expected TRUE, got %d\n", ret); ok(lo == 0, "Expected 0, got %08lx\n", lo); ok(hi == 0xcafebabe, "Expected 0xcafebabe, got %08lx\n", hi); + + GlobalFree(hglobal); }
static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV hconv,
Modified: trunk/rostests/winetests/user32/edit.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/edit.c?re... ============================================================================== --- trunk/rostests/winetests/user32/edit.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/edit.c [iso-8859-1] Sat Dec 5 20:25:28 2009 @@ -1236,6 +1236,45 @@ rc.left, rc.top, rc.right, rc.bottom); len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); ok(lstrlenA(str) == len, "text shouldn't have been truncated\n"); + DestroyWindow(hWnd); +} + +/* Test WM_GETTEXT processing + * after destroy messages + */ +static void test_edit_control_6(void) +{ + static const char *str = "test\r\ntest"; + char buf[MAXLEN]; + LONG ret; + HWND hWnd; + + hWnd = CreateWindowEx(0, + "EDIT", + "Test", + 0, + 10, 10, 1, 1, + NULL, NULL, hinst, NULL); + assert(hWnd); + + ret = SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)str); + ok(ret == TRUE, "Expected %d, got %d\n", TRUE, ret); + ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf); + ok(ret == lstrlen(str), "Expected %s, got len %d\n", str, ret); + ok(!lstrcmp(buf, str), "Expected %s, got %s\n", str, buf); + buf[0] = 0; + ret = SendMessageA(hWnd, WM_DESTROY, 0, 0); + ok(ret == 0, "Expected 0, got %d\n", ret); + ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf); + ok(ret == lstrlen(str), "Expected %s, got len %d\n", str, ret); + ok(!lstrcmp(buf, str), "Expected %s, got %s\n", str, buf); + buf[0] = 0; + ret = SendMessageA(hWnd, WM_NCDESTROY, 0, 0); + ok(ret == 0, "Expected 0, got %d\n", ret); + ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf); + ok(ret == 0, "Expected 0, got len %d\n", ret); + ok(!lstrcmp(buf, ""), "Expected empty string, got %s\n", buf); + DestroyWindow(hWnd); }
@@ -2270,6 +2309,7 @@ test_edit_control_3(); test_edit_control_4(); test_edit_control_5(); + test_edit_control_6(); test_edit_control_limittext(); test_margins(); test_margins_font_change();
Modified: trunk/rostests/winetests/user32/win.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?rev... ============================================================================== --- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Sat Dec 5 20:25:28 2009 @@ -2298,7 +2298,7 @@
static void test_SetFocus(HWND hwnd) { - HWND child; + HWND child, child2; WNDPROC old_wnd_proc;
/* check if we can set focus to non-visible windows */ @@ -2325,6 +2325,14 @@ ok( !(GetWindowLong(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); ok( GetFocus() == hwnd, "Focus should be on parent %p, not %p\n", hwnd, GetFocus() ); ShowWindow(child, SW_SHOW); + child2 = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 0, 0, child, 0, 0, NULL); + assert(child2); + ShowWindow(child2, SW_SHOW); + SetFocus(child2); + ShowWindow(child, SW_HIDE); + ok( !(GetWindowLong(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); + ok( GetFocus() == child2, "Focus should be on %p, not %p\n", child2, GetFocus() ); + ShowWindow(child, SW_SHOW); SetFocus(child); ok( GetFocus() == child, "Focus should be on child %p\n", child ); SetWindowPos(child,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_HIDEWINDOW); @@ -2368,6 +2376,7 @@
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)old_wnd_proc);
+ DestroyWindow( child2 ); DestroyWindow( child ); }