Misha Koshelev : shell32/tests:
Allow individual tests in check_lnk to be todo_wine'd.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Jun 29 08:14:57 CDT 2007
Module: wine
Branch: master
Commit: f8eabe0d37592958a8b19da0748ce0a7cf2a9c5b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f8eabe0d37592958a8b19da0748ce0a7cf2a9c5b
Author: Misha Koshelev <mk144210 at bcm.edu>
Date: Thu Jun 28 19:55:56 2007 -0500
shell32/tests: Allow individual tests in check_lnk to be todo_wine'd.
---
dlls/shell32/tests/shelllink.c | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 473aae7..c9b1ec4 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -306,7 +306,13 @@ static void test_get_set(void)
*/
#define lok ok_(__FILE__, line)
-#define check_lnk(a,b) check_lnk_(__LINE__, (a), (b))
+#define lok_todo_4(todo_flag,a,b,c,d) \
+ if ((todo & todo_flag) == 0) lok((a), (b), (c), (d)); \
+ else todo_wine lok((a), (b), (c), (d));
+#define lok_todo_2(todo_flag,a,b) \
+ if ((todo & todo_flag) == 0) lok((a), (b)); \
+ else todo_wine 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)
{
@@ -382,7 +388,7 @@ void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int save_fails)
IShellLinkA_Release(sl);
}
-static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
+static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo)
{
HRESULT r;
IShellLinkA *sl;
@@ -417,7 +423,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
strcpy(buffer,"garbage");
r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer));
lok(SUCCEEDED(r), "GetDescription failed (0x%08x)\n", r);
- lok(lstrcmp(buffer, desc->description)==0,
+ lok_todo_4(0x1, lstrcmp(buffer, desc->description)==0,
"GetDescription returned '%s' instead of '%s'\n",
buffer, desc->description);
}
@@ -426,7 +432,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
strcpy(buffer,"garbage");
r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer));
lok(SUCCEEDED(r), "GetWorkingDirectory failed (0x%08x)\n", r);
- lok(lstrcmpi(buffer, desc->workdir)==0,
+ lok_todo_4(0x2, lstrcmpi(buffer, desc->workdir)==0,
"GetWorkingDirectory returned '%s' instead of '%s'\n",
buffer, desc->workdir);
}
@@ -435,7 +441,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
lok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
- lok(lstrcmpi(buffer, desc->path)==0,
+ lok_todo_4(0x4, lstrcmpi(buffer, desc->path)==0,
"GetPath returned '%s' instead of '%s'\n",
buffer, desc->path);
}
@@ -444,7 +450,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
LPITEMIDLIST pidl=NULL;
r = IShellLinkA_GetIDList(sl, &pidl);
lok(SUCCEEDED(r), "GetIDList failed (0x%08x)\n", r);
- lok(pILIsEqual(pidl, desc->pidl),
+ lok_todo_2(0x8, pILIsEqual(pidl, desc->pidl),
"GetIDList returned an incorrect pidl\n");
}
if (desc->showcmd)
@@ -452,7 +458,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
int i=0xdeadbeef;
r = IShellLinkA_GetShowCmd(sl, &i);
lok(SUCCEEDED(r), "GetShowCmd failed (0x%08x)\n", r);
- lok(i==desc->showcmd,
+ lok_todo_4(0x10, i==desc->showcmd,
"GetShowCmd returned 0x%0x instead of 0x%0x\n",
i, desc->showcmd);
}
@@ -462,10 +468,10 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
strcpy(buffer,"garbage");
r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i);
lok(SUCCEEDED(r), "GetIconLocation failed (0x%08x)\n", r);
- lok(lstrcmpi(buffer, desc->icon)==0,
+ lok_todo_4(0x20, lstrcmpi(buffer, desc->icon)==0,
"GetIconLocation returned '%s' instead of '%s'\n",
buffer, desc->icon);
- lok(i==desc->icon_id,
+ lok_todo_4(0x20, i==desc->icon_id,
"GetIconLocation returned 0x%0x instead of 0x%0x\n",
i, desc->icon_id);
}
@@ -474,7 +480,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc)
WORD i=0xbeef;
r = IShellLinkA_GetHotkey(sl, &i);
lok(SUCCEEDED(r), "GetHotkey failed (0x%08x)\n", r);
- lok(i==desc->hotkey,
+ lok_todo_4(0x40, i==desc->hotkey,
"GetHotkey returned 0x%04x instead of 0x%04x\n",
i, desc->hotkey);
}
@@ -501,7 +507,7 @@ static void test_load_save(void)
desc.path="";
desc.arguments="";
desc.icon="";
- check_lnk(lnkfile, &desc);
+ check_lnk(lnkfile, &desc, 0x0);
/* Point a .lnk file to nonexistent files */
desc.description="";
@@ -514,7 +520,7 @@ static void test_load_save(void)
desc.icon_id=1234;
desc.hotkey=0;
create_lnk(lnkfile, &desc, 0);
- check_lnk(lnkfile, &desc);
+ check_lnk(lnkfile, &desc, 0x0);
r=GetModuleFileName(NULL, mypath, sizeof(mypath));
ok(r>=0 && r<sizeof(mypath), "GetModuleFileName failed (%d)\n", r);
@@ -534,7 +540,7 @@ static void test_load_save(void)
desc.icon_id=0;
desc.hotkey=0x1234;
create_lnk(lnkfile, &desc, 0);
- check_lnk(lnkfile, &desc);
+ check_lnk(lnkfile, &desc, 0x0);
/* Overwrite the existing lnk file and test link to a command on the path */
desc.description="command on path";
@@ -550,7 +556,7 @@ static void test_load_save(void)
/* Check that link is created to proper location */
SearchPathA( NULL, desc.path, NULL, MAX_PATH, realpath, NULL);
desc.path=realpath;
- check_lnk(lnkfile, &desc);
+ check_lnk(lnkfile, &desc, 0x0);
/* FIXME: Also test saving a .lnk pointing to a pidl that cannot be
* represented as a path.
More information about the wine-cvs
mailing list