user32/tests: Avoid preprocessor checks to ensure it compiles

André Hentschel nerv at dawncrow.de
Wed Jan 22 15:32:27 CST 2014


---
 dlls/user32/tests/broadcast.c | 10 ++++++----
 dlls/user32/tests/menu.c      | 12 ++++++------
 dlls/user32/tests/win.c       |  5 +++--
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/dlls/user32/tests/broadcast.c b/dlls/user32/tests/broadcast.c
index 0476c99..6f0c90f 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,7 +205,8 @@ 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 );
@@ -228,7 +230,7 @@ static void test_parametersEx(PBROADCASTEX broadcastex)
     ret = broadcast( 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 20126d4..2f68e72 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -2485,10 +2485,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);
@@ -2644,10 +2644,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,
@@ -2750,10 +2750,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 */ ||
-- 
1.8.1.2




More information about the wine-patches mailing list