Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3535fe25
Commit
3535fe25
authored
Aug 12, 2022
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Aug 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ieframe/tests: Add more IPropertyStorage read/write tests.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
parent
c5d8ebe7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
intshcut.c
dlls/ieframe/tests/intshcut.c
+20
-5
No files found.
dlls/ieframe/tests/intshcut.c
View file @
3535fe25
...
...
@@ -173,12 +173,18 @@ static void test_ReadAndWriteProperties(void)
WCHAR
fileNameW
[
MAX_PATH
];
static
WCHAR
iconPath
[]
=
L"file:///C:/arbitrary/icon/path"
;
char
testurl
[]
=
"http://some/bogus/url.html"
;
PROPVARIANT
pv
[
2
],
pvread
[
2
];
ps
[
0
].
ulKind
=
PRSPEC_PROPID
;
U
(
ps
[
0
]).
propid
=
PID_IS_ICONFILE
;
ps
[
1
].
ulKind
=
PRSPEC_PROPID
;
U
(
ps
[
1
]).
propid
=
PID_IS_ICONINDEX
;
pv
[
0
].
vt
=
VT_LPWSTR
;
U
(
pv
[
0
]).
pwszVal
=
iconPath
;
pv
[
1
].
vt
=
VT_I4
;
U
(
pv
[
1
]).
lVal
=
iconIndex
;
/* Make sure we have a valid temporary directory */
GetTempPathW
(
MAX_PATH
,
fileNameW
);
lstrcatW
(
fileNameW
,
L"testshortcut.url"
);
...
...
@@ -190,7 +196,6 @@ static void test_ReadAndWriteProperties(void)
IPersistFile
*
pf
;
IPropertyStorage
*
pPropStgWrite
;
IPropertySetStorage
*
pPropSetStg
;
PROPVARIANT
pv
[
2
];
/* We need to set a URL -- IPersistFile refuses to save without one. */
hr
=
urlA
->
lpVtbl
->
SetURL
(
urlA
,
testurl
,
0
);
...
...
@@ -205,10 +210,6 @@ static void test_ReadAndWriteProperties(void)
IPersistFile_Release
(
pf
);
pv
[
0
].
vt
=
VT_LPWSTR
;
U
(
pv
[
0
]).
pwszVal
=
iconPath
;
pv
[
1
].
vt
=
VT_I4
;
U
(
pv
[
1
]).
lVal
=
iconIndex
;
hr
=
urlA
->
lpVtbl
->
QueryInterface
(
urlA
,
&
IID_IPropertySetStorage
,
(
void
**
)
&
pPropSetStg
);
ok
(
hr
==
S_OK
,
"Unable to get an IPropertySetStorage, hr=0x%lx
\n
"
,
hr
);
...
...
@@ -218,6 +219,16 @@ static void test_ReadAndWriteProperties(void)
hr
=
IPropertyStorage_WriteMultiple
(
pPropStgWrite
,
2
,
ps
,
pv
,
0
);
ok
(
hr
==
S_OK
,
"Unable to set properties, hr=0x%lx
\n
"
,
hr
);
memset
(
pvread
,
0
,
sizeof
(
pvread
));
hr
=
IPropertyStorage_ReadMultiple
(
pPropStgWrite
,
2
,
ps
,
pvread
);
ok
(
hr
==
S_OK
,
"Unable to read properties, hr=0x%lx
\n
"
,
hr
);
ok
(
pvread
[
1
].
vt
==
VT_I4
,
"got %d
\n
"
,
pvread
[
1
].
vt
);
ok
(
U
(
pvread
[
1
]).
lVal
==
iconIndex
,
"Read wrong icon index: %d
\n
"
,
U
(
pvread
[
1
]).
iVal
);
ok
(
pvread
[
0
].
vt
==
VT_LPWSTR
,
"got %d
\n
"
,
pvread
[
0
].
vt
);
ok
(
lstrcmpW
(
U
(
pvread
[
0
]).
pwszVal
,
iconPath
)
==
0
,
"Wrong icon path read: %s
\n
"
,
wine_dbgstr_w
(
U
(
pvread
[
0
]).
pwszVal
));
PropVariantClear
(
&
pvread
[
0
]);
PropVariantClear
(
&
pvread
[
1
]);
hr
=
IPropertyStorage_Commit
(
pPropStgWrite
,
STGC_DEFAULT
);
ok
(
hr
==
S_OK
,
"Failed to commit properties, hr=0x%lx
\n
"
,
hr
);
...
...
@@ -268,6 +279,10 @@ static void test_ReadAndWriteProperties(void)
}
PropVariantClear
(
&
pvread
[
0
]);
PropVariantClear
(
&
pvread
[
1
]);
hr
=
IPropertyStorage_WriteMultiple
(
pPropStgRead
,
2
,
ps
,
pv
,
0
);
ok
(
hr
==
STG_E_ACCESSDENIED
,
"setting properties should return STG_E_ACCESSDENIED instead of 0x%lx
\n
"
,
hr
);
IPropertyStorage_Release
(
pPropStgRead
);
IPropertySetStorage_Release
(
pPropSetStg
);
urlAFromFile
->
lpVtbl
->
Release
(
urlAFromFile
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment