[2/2] shell32/tests: Get rid of redundant lok_todo_N macros

Frédéric Delanoy frederic.delanoy at gmail.com
Sat Feb 20 07:04:31 CST 2016


They just basically replicate todo_wine_if behaviour and add an unneeded level of indirection

Signed-off-by: Frédéric Delanoy <frederic.delanoy at gmail.com>
---
 dlls/shell32/tests/shelllink.c | 48 ++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index f22cb36..f7c091e 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -351,8 +351,6 @@ static void test_get_set(void)
  */
 
 #define lok                   ok_(__FILE__, line)
-#define lok_todo_4(todo_flag,a,b,c,d) todo_wine_if ((todo & todo_flag) != 0) lok((a), (b), (c), (d));
-#define lok_todo_2(todo_flag,a,b) todo_wine_if ((todo & todo_flag) != 0) lok((a), (b));
 #define check_lnk(a,b,c)        check_lnk_(__LINE__, (a), (b), (c))
 
 void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int save_fails)
@@ -521,44 +519,44 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
         strcpy(buffer,"garbage");
         r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
         lok(r == S_OK, "GetDescription failed (0x%08x)\n", r);
-        lok_todo_4(0x1, strcmp(buffer, desc->description)==0,
-           "GetDescription returned '%s' instead of '%s'\n",
-           buffer, desc->description);
+        todo_wine_if ((todo & 0x1) != 0)
+            lok(strcmp(buffer, desc->description)==0, "GetDescription returned '%s' instead of '%s'\n",
+                buffer, desc->description);
     }
     if (desc->workdir)
     {
         strcpy(buffer,"garbage");
         r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
         lok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r);
-        lok_todo_4(0x2, lstrcmpiA(buffer, desc->workdir)==0,
-           "GetWorkingDirectory returned '%s' instead of '%s'\n",
-           buffer, desc->workdir);
+        todo_wine_if ((todo & 0x2) != 0)
+            lok(lstrcmpiA(buffer, desc->workdir)==0, "GetWorkingDirectory returned '%s' instead of '%s'\n",
+                buffer, desc->workdir);
     }
     if (desc->path)
     {
         strcpy(buffer,"garbage");
         r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
         lok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
-        lok_todo_4(0x4, lstrcmpiA(buffer, desc->path)==0,
-           "GetPath returned '%s' instead of '%s'\n",
-           buffer, desc->path);
+        todo_wine_if ((todo & 0x4) != 0)
+            lok(lstrcmpiA(buffer, desc->path)==0, "GetPath returned '%s' instead of '%s'\n",
+                buffer, desc->path);
     }
     if (desc->pidl)
     {
         LPITEMIDLIST pidl=NULL;
         r = IShellLinkA_GetIDList(sl, &pidl);
         lok(r == S_OK, "GetIDList failed (0x%08x)\n", r);
-        lok_todo_2(0x8, pILIsEqual(pidl, desc->pidl),
-           "GetIDList returned an incorrect pidl\n");
+        todo_wine_if ((todo & 0x8) != 0)
+            lok(pILIsEqual(pidl, desc->pidl), "GetIDList returned an incorrect pidl\n");
     }
     if (desc->showcmd)
     {
         int i=0xdeadbeef;
         r = IShellLinkA_GetShowCmd(sl, &i);
         lok(r == S_OK, "GetShowCmd failed (0x%08x)\n", r);
-        lok_todo_4(0x10, i==desc->showcmd,
-           "GetShowCmd returned 0x%0x instead of 0x%0x\n",
-           i, desc->showcmd);
+        todo_wine_if ((todo & 0x10) != 0)
+            lok(i==desc->showcmd, "GetShowCmd returned 0x%0x instead of 0x%0x\n",
+                i, desc->showcmd);
     }
     if (desc->icon)
     {
@@ -566,21 +564,21 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
         strcpy(buffer,"garbage");
         r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
         lok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r);
-        lok_todo_4(0x20, lstrcmpiA(buffer, desc->icon)==0,
-           "GetIconLocation returned '%s' instead of '%s'\n",
-           buffer, desc->icon);
-        lok_todo_4(0x20, i==desc->icon_id,
-           "GetIconLocation returned 0x%0x instead of 0x%0x\n",
-           i, desc->icon_id);
+        todo_wine_if ((todo & 0x20) != 0) {
+            lok(lstrcmpiA(buffer, desc->icon)==0, "GetIconLocation returned '%s' instead of '%s'\n",
+                buffer, desc->icon);
+            lok(i==desc->icon_id, "GetIconLocation returned 0x%0x instead of 0x%0x\n",
+                i, desc->icon_id);
+        }
     }
     if (desc->hotkey)
     {
         WORD i=0xbeef;
         r = IShellLinkA_GetHotkey(sl, &i);
         lok(r == S_OK, "GetHotkey failed (0x%08x)\n", r);
-        lok_todo_4(0x40, i==desc->hotkey,
-           "GetHotkey returned 0x%04x instead of 0x%04x\n",
-           i, desc->hotkey);
+        todo_wine_if ((todo & 0x40) != 0)
+            lok(i==desc->hotkey, "GetHotkey returned 0x%04x instead of 0x%04x\n",
+                i, desc->hotkey);
     }
 
     IShellLinkA_Release(sl);
-- 
2.7.1




More information about the wine-patches mailing list