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
9b0a9c4d
Commit
9b0a9c4d
authored
Jan 28, 2016
by
Joachim Priesner
Committed by
Alexandre Julliard
Jan 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun/tests: Move code to get a fixed drive to a function.
Signed-off-by:
Joachim Priesner
<
joachim.priesner@web.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5b9a11a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
32 deletions
+45
-32
filesystem.c
dlls/scrrun/tests/filesystem.c
+45
-32
No files found.
dlls/scrrun/tests/filesystem.c
View file @
9b0a9c4d
...
...
@@ -59,6 +59,47 @@ static inline void get_temp_path(const WCHAR *prefix, WCHAR *path)
DeleteFileW
(
path
);
}
static
IDrive
*
get_fixed_drive
(
void
)
{
IDriveCollection
*
drives
;
IEnumVARIANT
*
iter
;
IDrive
*
drive
;
HRESULT
hr
;
hr
=
IFileSystem3_get_Drives
(
fs3
,
&
drives
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDriveCollection_get__NewEnum
(
drives
,
(
IUnknown
**
)
&
iter
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDriveCollection_Release
(
drives
);
while
(
1
)
{
DriveTypeConst
type
;
VARIANT
var
;
hr
=
IEnumVARIANT_Next
(
iter
,
1
,
&
var
,
NULL
);
if
(
hr
==
S_FALSE
)
{
drive
=
NULL
;
break
;
}
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDispatch_QueryInterface
(
V_DISPATCH
(
&
var
),
&
IID_IDrive
,
(
void
**
)
&
drive
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantClear
(
&
var
);
hr
=
IDrive_get_DriveType
(
drive
,
&
type
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
type
==
Fixed
)
break
;
IDrive_Release
(
drive
);
}
IEnumVARIANT_Release
(
iter
);
return
drive
;
}
static
void
test_interfaces
(
void
)
{
static
const
WCHAR
nonexistent_dirW
[]
=
{
...
...
@@ -1914,42 +1955,15 @@ static void test_GetDriveName(void)
static
void
test_SerialNumber
(
void
)
{
IDriveCollection
*
drives
;
IEnumVARIANT
*
iter
;
IDrive
*
drive
;
LONG
serial
;
HRESULT
hr
;
BSTR
name
;
hr
=
IFileSystem3_get_Drives
(
fs3
,
&
drives
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDriveCollection_get__NewEnum
(
drives
,
(
IUnknown
**
)
&
iter
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDriveCollection_Release
(
drives
);
while
(
1
)
{
DriveTypeConst
type
;
VARIANT
var
;
hr
=
IEnumVARIANT_Next
(
iter
,
1
,
&
var
,
NULL
);
if
(
hr
==
S_FALSE
)
{
skip
(
"No fixed drive found, skipping test.
\n
"
);
IEnumVARIANT_Release
(
iter
);
return
;
}
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDispatch_QueryInterface
(
V_DISPATCH
(
&
var
),
&
IID_IDrive
,
(
void
**
)
&
drive
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantClear
(
&
var
);
hr
=
IDrive_get_DriveType
(
drive
,
&
type
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
type
==
Fixed
)
break
;
IDrive_Release
(
drive
);
drive
=
get_fixed_drive
();
if
(
!
drive
)
{
skip
(
"No fixed drive found, skipping test.
\n
"
);
return
;
}
hr
=
IDrive_get_SerialNumber
(
drive
,
NULL
);
...
...
@@ -1979,7 +1993,6 @@ static void test_SerialNumber(void)
SysFreeString
(
name
);
IDrive_Release
(
drive
);
IEnumVARIANT_Release
(
iter
);
}
static
const
struct
extension_test
{
...
...
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