shell32/tests: Fix the systray tests on Win9x and NT4.

This commit is contained in:
Alexandre Julliard 2008-11-20 22:56:52 +01:00
parent f1d0f81d26
commit c369759cc5
1 changed files with 18 additions and 12 deletions

View File

@ -31,6 +31,7 @@ static BOOL (WINAPI *pShell_NotifyIconW)(DWORD,PNOTIFYICONDATAW);
void test_cbsize(void)
{
NOTIFYICONDATAA nidA;
BOOL ret;
if (pShell_NotifyIconW)
{
@ -43,16 +44,20 @@ void test_cbsize(void)
nidW.uFlags = NIF_ICON|NIF_MESSAGE;
nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION);
nidW.uCallbackMessage = WM_USER+17;
ok(pShell_NotifyIconW(NIM_ADD, &nidW), "NIM_ADD failed!\n");
/* using an invalid cbSize does work */
nidW.cbSize = 3;
nidW.hWnd = hMainWnd;
nidW.uID = 1;
ok(pShell_NotifyIconW(NIM_DELETE, &nidW), "NIM_DELETE failed!\n");
/* as icon doesn't exist anymore - now there will be an error */
nidW.cbSize = sizeof(nidW);
ok(!pShell_NotifyIconW(NIM_DELETE, &nidW), "The icon was not deleted\n");
ret = pShell_NotifyIconW(NIM_ADD, &nidW);
if (ret)
{
/* using an invalid cbSize does work */
nidW.cbSize = 3;
nidW.hWnd = hMainWnd;
nidW.uID = 1;
ret = pShell_NotifyIconW(NIM_DELETE, &nidW);
ok( ret || broken(!ret), /* nt4 */ "NIM_DELETE failed!\n");
/* as icon doesn't exist anymore - now there will be an error */
nidW.cbSize = sizeof(nidW);
ok(!pShell_NotifyIconW(NIM_DELETE, &nidW) != !ret, "The icon was not deleted\n");
}
else win_skip( "Shell_NotifyIconW not working\n" ); /* win9x */
}
/* same for Shell_NotifyIconA */
@ -69,10 +74,11 @@ void test_cbsize(void)
nidA.cbSize = 3;
nidA.hWnd = hMainWnd;
nidA.uID = 1;
ok(Shell_NotifyIconA(NIM_DELETE, &nidA), "NIM_DELETE failed!\n");
ret = Shell_NotifyIconA(NIM_DELETE, &nidA);
ok( ret || broken(!ret), /* win9x */ "NIM_DELETE failed!\n");
/* as icon doesn't exist anymore - now there will be an error */
nidA.cbSize = sizeof(nidA);
ok(!Shell_NotifyIconA(NIM_DELETE, &nidA), "The icon was not deleted\n");
ok(!Shell_NotifyIconA(NIM_DELETE, &nidA) != !ret, "The icon was not deleted\n");
}
START_TEST(systray)