comctl32/tests: Don't crash if adding the tooltip failed.

This commit is contained in:
Francois Gouget 2008-09-28 18:41:02 +02:00 committed by Alexandre Julliard
parent d1ab3b097d
commit 1177bbaa9e
1 changed files with 8 additions and 6 deletions

View File

@ -257,12 +257,14 @@ static void test_gettext(void)
GetClientRect(hwnd, &toolinfoA.rect);
r = SendMessageA(hwnd, TTM_ADDTOOL, 0, (LPARAM)&toolinfoA);
ok(r, "Adding the tool to the tooltip failed\n");
toolinfoA.hwnd = NULL;
toolinfoA.uId = (UINT_PTR)0x1234ABCD;
toolinfoA.lpszText = bufA;
SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(strcmp(toolinfoA.lpszText, "") == 0, "lpszText should be an empty string\n");
if (r)
{
toolinfoA.hwnd = NULL;
toolinfoA.uId = (UINT_PTR)0x1234ABCD;
toolinfoA.lpszText = bufA;
SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
ok(strcmp(toolinfoA.lpszText, "") == 0, "lpszText should be an empty string\n");
}
DestroyWindow(hwnd);