Module: wine Branch: master Commit: c855459a403d7cff8446ffd057372f4682b6b66c URL: http://source.winehq.org/git/wine.git/?a=commit;h=c855459a403d7cff8446ffd057...
Author: André Hentschel nerv@dawncrow.de Date: Mon Jan 27 22:21:43 2014 +0100
user32/tests: Avoid preprocessor check to ensure it compiles.
---
dlls/user32/tests/broadcast.c | 18 ++++++++++-------- dlls/user32/tests/menu.c | 12 ++++++------ dlls/user32/tests/win.c | 5 +++-- 3 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/dlls/user32/tests/broadcast.c b/dlls/user32/tests/broadcast.c index 0476c99..322fbd0 100644 --- a/dlls/user32/tests/broadcast.c +++ b/dlls/user32/tests/broadcast.c @@ -119,7 +119,8 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname) ok(!ret || broken(ret), "Returned: %d\n", ret); if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError());
-#if 0 /* TODO: Check the hang flags */ +if (0) /* TODO: Check the hang flags */ +{ SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 ); @@ -143,7 +144,7 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname) ret = broadcast( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret); -#endif +}
recips = BSM_APPLICATIONS; ResetEvent(hevent); @@ -204,31 +205,32 @@ static void test_parametersEx(PBROADCASTEX broadcastex) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError()); ok(!ret, "Returned: %d\n", ret);
-#if 0 /* TODO: Check the hang flags */ +if (0) /* TODO: Check the hang flags */ +{ SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret);
SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret);
SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret);
SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret); -#endif +}
recips = BSM_APPLICATIONS; ResetEvent(hevent); diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index d02eb91..3334a8a 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -2498,10 +2498,10 @@ static void check_menu_items(HMENU hmenu, UINT checked_cmd, UINT checked_type, mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_SUBMENU; ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -#if 0 +if (0) trace("item #%u: fType %04x, fState %04x, wID %u, hSubMenu %p\n", i, mii.fType, mii.fState, mii.wID, mii.hSubMenu); -#endif + if (mii.hSubMenu) { ok(mii.wID == (UINT_PTR)mii.hSubMenu, "id %u: wID should be equal to hSubMenu\n", checked_cmd); @@ -2657,10 +2657,10 @@ static void test_menu_resource_layout(void) mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_STRING; ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -#if 0 +if (0) trace("item #%u: fType %04x, fState %04x, wID %u, dwTypeData %s\n", i, mii.fType, mii.fState, mii.wID, (LPCSTR)mii.dwTypeData); -#endif + ok(mii.fType == menu_data[i].type, "%u: expected fType %04x, got %04x\n", i, menu_data[i].type, mii.fType); ok(mii.fState == menu_data[i].state, @@ -2763,10 +2763,10 @@ static void compare_menu_data(HMENU hmenu, const struct menu_data *item, INT ite mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING | MIIM_BITMAP; ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -#if 0 +if (0) trace("item #%u: fType %04x, fState %04x, wID %04x, hbmp %p\n", i, mii.fType, mii.fState, mii.wID, mii.hbmpItem); -#endif + ok(mii.fType == item[i].type, "%u: expected fType %04x, got %04x\n", i, item[i].type, mii.fType); ok(mii.wID == item[i].id, diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index dfcad52..3c63c8a 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -895,14 +895,15 @@ static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *in /* win2k and XP return broken border info in GetWindowInfo most of * the time, so there is no point in testing it. */ -#if 0 +if (0) +{ UINT border; ok(info->cxWindowBorders == (unsigned)(rcClient.left - rcWindow.left), "wrong cxWindowBorders %d != %d\n", info->cxWindowBorders, rcClient.left - rcWindow.left); border = min(rcWindow.bottom - rcClient.bottom, rcClient.top - rcWindow.top); ok(info->cyWindowBorders == border, "wrong cyWindowBorders %d != %d\n", info->cyWindowBorders, border); -#endif +} ok(info->atomWindowType == GetClassLongA(hwnd, GCW_ATOM), "wrong atomWindowType for %p in hook %s\n", hwnd, hook); ok(info->wCreatorVersion == 0x0400 /* NT4, Win2000, XP, Win2003 */ ||