Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
07325c7d
Commit
07325c7d
authored
May 19, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
May 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Add tests for output parameters in MkParseDisplayName.
parent
7bdf023e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
moniker.c
dlls/ole32/tests/moniker.c
+24
-2
No files found.
dlls/ole32/tests/moniker.c
View file @
07325c7d
...
...
@@ -817,7 +817,7 @@ static void test_MkParseDisplayName(void)
static
const
WCHAR
wszEmpty
[]
=
{
0
};
char
szDisplayNameFile
[
256
];
WCHAR
wszDisplayNameFile
[
256
];
int
i
;
int
i
,
len
;
const
struct
{
...
...
@@ -861,15 +861,23 @@ static void test_MkParseDisplayName(void)
ok
(
pmk
==
(
IMoniker
*
)
0xdeadbeef
,
"[%d] Output moniker pointer should have been 0xdeadbeef instead of %p
\n
"
,
i
,
pmk
);
}
eaten
=
0xdeadbeef
;
pmk
=
(
IMoniker
*
)
0xdeadbeef
;
hr
=
MkParseDisplayName
(
pbc
,
wszNonExistentProgId
,
&
eaten
,
&
pmk
);
ok
(
hr
==
MK_E_SYNTAX
||
hr
==
MK_E_CANTOPENFILE
/* Win9x */
,
"MkParseDisplayName should have failed with MK_E_SYNTAX or MK_E_CANTOPENFILE instead of 0x%08x
\n
"
,
hr
);
ok
(
eaten
==
0
,
"Processed character count should have been 0 instead of %u
\n
"
,
eaten
);
ok
(
pmk
==
NULL
,
"Output moniker pointer should have been NULL instead of %p
\n
"
,
pmk
);
/* no special handling of "clsid:" without the string form of the clsid
* following */
eaten
=
0xdeadbeef
;
pmk
=
(
IMoniker
*
)
0xdeadbeef
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameClsid
,
&
eaten
,
&
pmk
);
ok
(
hr
==
MK_E_SYNTAX
||
hr
==
MK_E_CANTOPENFILE
/* Win9x */
,
"MkParseDisplayName should have failed with MK_E_SYNTAX or MK_E_CANTOPENFILE instead of 0x%08x
\n
"
,
hr
);
ok
(
eaten
==
0
,
"Processed character count should have been 0 instead of %u
\n
"
,
eaten
);
ok
(
pmk
==
NULL
,
"Output moniker pointer should have been NULL instead of %p
\n
"
,
pmk
);
/* shows clsid has higher precedence than a running object */
hr
=
CreateFileMoniker
(
wszDisplayName
,
&
pmk
);
...
...
@@ -882,6 +890,8 @@ static void test_MkParseDisplayName(void)
pmk
=
NULL
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayName
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayName
)
/
sizeof
(
WCHAR
)
-
1
,
"Processed character count should have been 43 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
IMoniker_IsSystemMoniker
(
pmk
,
&
moniker_type
);
...
...
@@ -902,6 +912,8 @@ static void test_MkParseDisplayName(void)
pmk
=
NULL
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameRunning
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayNameRunning
)
/
sizeof
(
WCHAR
)
-
1
,
"Processed character count should have been 15 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
IMoniker_IsSystemMoniker
(
pmk
,
&
moniker_type
);
...
...
@@ -918,6 +930,8 @@ static void test_MkParseDisplayName(void)
expected_display_name
=
wszDisplayNameProgId1
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameProgId1
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayNameProgId1
)
/
sizeof
(
WCHAR
)
-
1
,
"Processed character count should have been 8 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
IMoniker_IsSystemMoniker
(
pmk
,
&
moniker_type
);
...
...
@@ -928,6 +942,8 @@ static void test_MkParseDisplayName(void)
expected_display_name
=
wszDisplayNameProgId2
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameProgId2
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayNameProgId2
)
/
sizeof
(
WCHAR
)
-
1
,
"Processed character count should have been 8 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
IMoniker_IsSystemMoniker
(
pmk
,
&
moniker_type
);
...
...
@@ -935,18 +951,23 @@ static void test_MkParseDisplayName(void)
IMoniker_Release
(
pmk
);
}
eaten
=
0xdeadbeef
;
pmk
=
(
IMoniker
*
)
0xdeadbeef
;
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameProgIdFail
,
&
eaten
,
&
pmk
);
ok
(
hr
==
MK_E_SYNTAX
||
hr
==
MK_E_CANTOPENFILE
/* Win9x */
,
"MkParseDisplayName with ProgId without marker should fail with MK_E_SYNTAX or MK_E_CANTOPENFILE instead of 0x%08x
\n
"
,
hr
);
ok
(
eaten
==
0
,
"Processed character count should have been 0 instead of %u
\n
"
,
eaten
);
ok
(
pmk
==
NULL
,
"Output moniker pointer should have been NULL instead of %p
\n
"
,
pmk
);
hr
=
CoRevokeClassObject
(
pdwReg1
);
ok_ole_success
(
hr
,
CoRevokeClassObject
);
GetSystemDirectoryA
(
szDisplayNameFile
,
sizeof
(
szDisplayNameFile
));
strcat
(
szDisplayNameFile
,
"
\\
kernel32.dll"
);
MultiByteToWideChar
(
CP_ACP
,
0
,
szDisplayNameFile
,
-
1
,
wszDisplayNameFile
,
sizeof
(
wszDisplayNameFile
)
/
sizeof
(
wszDisplayNameFile
[
0
]));
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szDisplayNameFile
,
-
1
,
wszDisplayNameFile
,
sizeof
(
wszDisplayNameFile
)
/
sizeof
(
wszDisplayNameFile
[
0
]));
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayNameFile
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
len
-
1
,
"Processed character count should have been %d instead of %u
\n
"
,
len
-
1
,
eaten
);
if
(
pmk
)
{
IMoniker_IsSystemMoniker
(
pmk
,
&
moniker_type
);
...
...
@@ -956,6 +977,7 @@ static void test_MkParseDisplayName(void)
hr
=
MkParseDisplayName
(
pbc
,
wszDisplayName
,
&
eaten
,
&
pmk
);
ok_ole_success
(
hr
,
MkParseDisplayName
);
ok
(
eaten
==
sizeof
(
wszDisplayName
)
/
sizeof
(
WCHAR
)
-
1
,
"Processed character count should have been 43 instead of %u
\n
"
,
eaten
);
if
(
pmk
)
{
...
...
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