Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
f8eabe0d
Commit
f8eabe0d
authored
17 years ago
by
Misha Koshelev
Committed by
Alexandre Julliard
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
shell32/tests: Allow individual tests in check_lnk to be todo_wine'd.
parent
860aa699
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/shell32/tests/shelllink.c
+20
-14
20 additions, 14 deletions
dlls/shell32/tests/shelllink.c
with
20 additions
and
14 deletions
dlls/shell32/tests/shelllink.c
+
20
−
14
View file @
f8eabe0d
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment