user32/tests: Remove unnecessary char array and add additional test in test_FindWindowEx.

This commit is contained in:
Sebastian Lackner 2014-11-18 04:46:08 +01:00 committed by Alexandre Julliard
parent 9f36db8fa5
commit 0cf86baf65
1 changed files with 5 additions and 6 deletions

View File

@ -6931,24 +6931,23 @@ todo_wine
static void test_FindWindowEx(void)
{
HWND hwnd, found;
CHAR title[1];
hwnd = CreateWindowExA( 0, "MainWindowClass", "caption", WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
title[0] = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", title );
found = FindWindowExA( 0, 0, "MainWindowClass", "" );
ok( found == NULL, "expected a NULL hwnd\n" );
found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
found = FindWindowExA( 0, 0, "MainWindowClass", "caption" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
DestroyWindow( hwnd );
hwnd = CreateWindowExA( 0, "MainWindowClass", NULL, WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
found = FindWindowExA( 0, 0, "MainWindowClass", title );
found = FindWindowExA( 0, 0, "MainWindowClass", "" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
@ -6956,7 +6955,7 @@ static void test_FindWindowEx(void)
DestroyWindow( hwnd );
/* test behaviour with a window title that is an empty character */
found = FindWindowExA( 0, 0, "Shell_TrayWnd", title );
found = FindWindowExA( 0, 0, "Shell_TrayWnd", "" );
ok( found != NULL, "found is NULL, expected a valid hwnd\n" );
found = FindWindowExA( 0, 0, "Shell_TrayWnd", NULL );
ok( found != NULL, "found is NULL, expected a valid hwnd\n" );