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
0c4acb61
Commit
0c4acb61
authored
Mar 28, 2019
by
Gijs Vermeulen
Committed by
Alexandre Julliard
Mar 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun/tests: Add more Clone() tests.
Signed-off-by:
Gijs Vermeulen
<
gijsvrm@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8e16ab9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
20 deletions
+55
-20
filesystem.c
dlls/scrrun/tests/filesystem.c
+55
-20
No files found.
dlls/scrrun/tests/filesystem.c
View file @
0c4acb61
...
...
@@ -973,6 +973,52 @@ static void test_GetFolder(void)
IFolder_Release
(
folder
);
}
static
void
test_clone
(
IEnumVARIANT
*
enumvar
,
BOOL
position_inherited
)
{
HRESULT
hr
;
IEnumVARIANT
*
clone
;
ULONG
fetched
;
VARIANT
var
,
var2
;
hr
=
IEnumVARIANT_Reset
(
enumvar
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantInit
(
&
var
);
fetched
=
-
1
;
hr
=
IEnumVARIANT_Next
(
enumvar
,
1
,
&
var
,
&
fetched
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fetched
==
1
,
"got %d
\n
"
,
fetched
);
/* clone enumerator */
hr
=
IEnumVARIANT_Clone
(
enumvar
,
&
clone
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
clone
!=
enumvar
,
"got %p, %p
\n
"
,
enumvar
,
clone
);
/* check if clone inherits position */
VariantInit
(
&
var2
);
fetched
=
-
1
;
hr
=
IEnumVARIANT_Next
(
clone
,
1
,
&
var2
,
&
fetched
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fetched
==
1
,
"got %d
\n
"
,
fetched
);
if
(
!
position_inherited
)
todo_wine
ok
(
V_DISPATCH
(
&
var
)
==
V_DISPATCH
(
&
var2
),
"values don't match
\n
"
);
else
{
fetched
=
-
1
;
hr
=
IEnumVARIANT_Next
(
enumvar
,
1
,
&
var
,
&
fetched
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
fetched
==
1
,
"got %d
\n
"
,
fetched
);
todo_wine
ok
(
V_DISPATCH
(
&
var
)
==
V_DISPATCH
(
&
var2
),
"values don't match
\n
"
);
}
VariantClear
(
&
var2
);
VariantClear
(
&
var
);
IEnumVARIANT_Release
(
clone
);
hr
=
IEnumVARIANT_Reset
(
enumvar
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
}
/* Please keep the tests for IFolderCollection and IFileCollection in sync */
static
void
test_FolderCollection
(
void
)
{
...
...
@@ -982,7 +1028,7 @@ static void test_FolderCollection(void)
static
const
WCHAR
cW
[]
=
{
'\\'
,
'c'
,
0
};
IFolderCollection
*
folders
;
WCHAR
buffW
[
MAX_PATH
],
pathW
[
MAX_PATH
];
IEnumVARIANT
*
enumvar
,
*
clone
;
IEnumVARIANT
*
enumvar
;
LONG
count
,
ref
,
ref2
,
i
;
IUnknown
*
unk
,
*
unk2
;
IFolder
*
folder
;
...
...
@@ -1068,14 +1114,7 @@ static void test_FolderCollection(void)
ref2
=
GET_REFCOUNT
(
folders
);
ok
(
ref2
==
ref
,
"got %d, %d
\n
"
,
ref2
,
ref
);
/* clone enumerator */
hr
=
IEnumVARIANT_Clone
(
enumvar
,
&
clone
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
clone
!=
enumvar
,
"got %p, %p
\n
"
,
enumvar
,
clone
);
IEnumVARIANT_Release
(
clone
);
hr
=
IEnumVARIANT_Reset
(
enumvar
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
test_clone
(
enumvar
,
FALSE
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -1165,7 +1204,7 @@ static void test_FileCollection(void)
IFolder
*
folder
;
IFileCollection
*
files
;
IFile
*
file
;
IEnumVARIANT
*
enumvar
,
*
clone
;
IEnumVARIANT
*
enumvar
;
LONG
count
,
ref
,
ref2
,
i
;
IUnknown
*
unk
,
*
unk2
;
ULONG
fetched
;
...
...
@@ -1245,14 +1284,7 @@ static void test_FileCollection(void)
ref2
=
GET_REFCOUNT
(
files
);
ok
(
ref2
==
ref
,
"got %d, %d
\n
"
,
ref2
,
ref
);
/* clone enumerator */
hr
=
IEnumVARIANT_Clone
(
enumvar
,
&
clone
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
clone
!=
enumvar
,
"got %p, %p
\n
"
,
enumvar
,
clone
);
IEnumVARIANT_Release
(
clone
);
hr
=
IEnumVARIANT_Reset
(
enumvar
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
test_clone
(
enumvar
,
FALSE
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -1329,7 +1361,7 @@ static void test_FileCollection(void)
static
void
test_DriveCollection
(
void
)
{
IDriveCollection
*
drives
;
IEnumVARIANT
*
enumvar
;
IEnumVARIANT
*
enumvar
,
*
clone
;
ULONG
fetched
;
VARIANT
var
;
HRESULT
hr
;
...
...
@@ -1366,10 +1398,13 @@ static void test_DriveCollection(void)
hr
=
IEnumVARIANT_Skip
(
enumvar
,
1
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
/* reset and iterate again */
hr
=
IEnumVARIANT_Reset
(
enumvar
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IEnumVARIANT_Clone
(
enumvar
,
&
clone
);
if
(
hr
==
S_OK
)
test_clone
(
enumvar
,
TRUE
);
while
(
IEnumVARIANT_Next
(
enumvar
,
1
,
&
var
,
&
fetched
)
==
S_OK
)
{
IDrive
*
drive
=
(
IDrive
*
)
V_DISPATCH
(
&
var
);
DriveTypeConst
type
;
...
...
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