From c369759cc5aac2a686cf812603a5b2d316044690 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 20 Nov 2008 22:56:52 +0100 Subject: [PATCH] shell32/tests: Fix the systray tests on Win9x and NT4. --- dlls/shell32/tests/systray.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/dlls/shell32/tests/systray.c b/dlls/shell32/tests/systray.c index 56758068453..23a6614b55c 100644 --- a/dlls/shell32/tests/systray.c +++ b/dlls/shell32/tests/systray.c @@ -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)