Joris Huizer : user32/tests: Don' t test function directly when reporting GetLastError().
Alexandre Julliard
julliard at winehq.org
Mon Feb 7 16:06:35 CST 2011
Module: wine
Branch: master
Commit: 26f753aec8c81e09938cc39383322aae3fdc4e72
URL: http://source.winehq.org/git/wine.git/?a=commit;h=26f753aec8c81e09938cc39383322aae3fdc4e72
Author: Joris Huizer <joris_huizer at yahoo.com>
Date: Fri Feb 4 17:10:17 2011 +0100
user32/tests: Don't test function directly when reporting GetLastError().
---
dlls/user32/tests/dde.c | 7 +++++--
dlls/user32/tests/menu.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/dde.c b/dlls/user32/tests/dde.c
index ea010e6..f6a0844 100644
--- a/dlls/user32/tests/dde.c
+++ b/dlls/user32/tests/dde.c
@@ -1571,6 +1571,7 @@ static void test_dde_aw_transaction( BOOL client_unicode, BOOL server_unicode )
CONVINFO info;
HDDEDATA hdata;
BOOL conv_unicode = client_unicode;
+ BOOL got;
static char test_cmd[] = "test dde command";
if (!(hwnd_server = create_dde_server( server_unicode ))) return;
@@ -1709,7 +1710,8 @@ todo_wine {
ok(err == DMLERR_NOTPROCESSED, "DdeClientTransaction returned error %x\n", err);
}
- ok(DdeDisconnect(hconv), "DdeDisconnect error %x\n", DdeGetLastError(dde_inst));
+ got = DdeDisconnect(hconv);
+ ok(got, "DdeDisconnect error %x\n", DdeGetLastError(dde_inst));
info.cb = sizeof(info);
ret = DdeQueryConvInfo(hconv, QID_SYNC, &info);
@@ -1719,7 +1721,8 @@ todo_wine {
ok(err == DMLERR_INVALIDPARAMETER, "wrong dde error %x\n", err);
}
- ok(DdeFreeStringHandle(dde_inst, hsz_server), "DdeFreeStringHandle error %x\n", DdeGetLastError(dde_inst));
+ got = DdeFreeStringHandle(dde_inst, hsz_server);
+ ok(got, "DdeFreeStringHandle error %x\n", DdeGetLastError(dde_inst));
/* This call hangs on win2k SP4 and XP SP1.
DdeUninitialize(dde_inst);*/
diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c
index aa7ebde..6a831a8 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -660,6 +660,7 @@ static void test_menu_bmp_and_string(void)
MENUINFO mi= {sizeof(MENUINFO)};
MENUITEMINFOA mii= {sizeof(MENUITEMINFOA)};
int count, szidx, txtidx, bmpidx, hassub, mnuopt, ispop;
+ BOOL got;
if( !pGetMenuInfo)
{
@@ -681,12 +682,14 @@ static void test_menu_bmp_and_string(void)
ok( hsysmenu != NULL, "GetSystemMenu failed with error %d\n", GetLastError());
mi.fMask = MIM_STYLE;
mi.dwStyle = 0;
- ok( pGetMenuInfo( hsysmenu, &mi), "GetMenuInfo failed gle=%d\n", GetLastError());
+ got = pGetMenuInfo( hsysmenu, &mi);
+ ok( got, "GetMenuInfo failed gle=%d\n", GetLastError());
ok( MNS_CHECKORBMP == mi.dwStyle, "System Menu Style is %08x, without the bit %08x\n",
mi.dwStyle, MNS_CHECKORBMP);
mii.fMask = MIIM_BITMAP;
mii.hbmpItem = NULL;
- ok( GetMenuItemInfoA( hsysmenu, SC_CLOSE, FALSE, &mii), "GetMenuItemInfoA failed gle=%d\n", GetLastError());
+ got = GetMenuItemInfoA( hsysmenu, SC_CLOSE, FALSE, &mii);
+ ok( got, "GetMenuItemInfoA failed gle=%d\n", GetLastError());
ok( HBMMENU_POPUP_CLOSE == mii.hbmpItem, "Item info did not get the right hbitmap: got %p expected %p\n",
mii.hbmpItem, HBMMENU_POPUP_CLOSE);
More information about the wine-cvs
mailing list