Alexandre Julliard : shell32/tests: Fix the systray tests on Win9x and NT4.
Alexandre Julliard
julliard at winehq.org
Fri Nov 21 06:54:40 CST 2008
Module: wine
Branch: master
Commit: c369759cc5aac2a686cf812603a5b2d316044690
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c369759cc5aac2a686cf812603a5b2d316044690
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Nov 20 22:56:52 2008 +0100
shell32/tests: Fix the systray tests on Win9x and NT4.
---
dlls/shell32/tests/systray.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/dlls/shell32/tests/systray.c b/dlls/shell32/tests/systray.c
index 5675806..23a6614 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)
More information about the wine-cvs
mailing list