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
45b31a9f
Commit
45b31a9f
authored
Jul 25, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun/tests: Add IFileSystem3::GetFile tests.
parent
a29d7708
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
filesystem.c
dlls/scrrun/tests/filesystem.c
+44
-0
No files found.
dlls/scrrun/tests/filesystem.c
View file @
45b31a9f
...
...
@@ -461,6 +461,49 @@ static void test_GetAbsolutePathName(void)
RemoveDirectoryW
(
dir2
);
}
static
void
test_GetFile
(
void
)
{
static
const
WCHAR
get_file
[]
=
{
'g'
,
'e'
,
't'
,
'_'
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
't'
,
's'
,
't'
,
0
};
BSTR
path
=
SysAllocString
(
get_file
);
IFile
*
file
;
HRESULT
hr
;
HANDLE
hf
;
hr
=
IFileSystem3_GetFile
(
fs3
,
path
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetFile returned %x, expected E_POINTER
\n
"
,
hr
);
hr
=
IFileSystem3_GetFile
(
fs3
,
NULL
,
&
file
);
ok
(
hr
==
E_INVALIDARG
,
"GetFile returned %x, expected E_INVALIDARG
\n
"
,
hr
);
hf
=
CreateFileW
(
path
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hf
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
hf
);
skip
(
"File already exists, skipping GetFile tests
\n
"
);
SysFreeString
(
path
);
return
;
}
file
=
(
IFile
*
)
0xdeadbeef
;
hr
=
IFileSystem3_GetFile
(
fs3
,
path
,
&
file
);
ok
(
!
file
,
"file != NULL
\n
"
);
ok
(
hr
==
CTL_E_FILENOTFOUND
,
"GetFile returned %x, expected CTL_E_FILENOTFOUND
\n
"
,
hr
);
hf
=
CreateFileW
(
path
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hf
==
INVALID_HANDLE_VALUE
)
{
skip
(
"Can't create temporary file
\n
"
);
SysFreeString
(
path
);
return
;
}
CloseHandle
(
hf
);
hr
=
IFileSystem3_GetFile
(
fs3
,
path
,
&
file
);
ok
(
hr
==
S_OK
,
"GetFile returned %x, expected S_OK
\n
"
,
hr
);
IFile_Release
(
file
);
DeleteFileW
(
path
);
SysFreeString
(
path
);
}
START_TEST
(
filesystem
)
{
HRESULT
hr
;
...
...
@@ -482,6 +525,7 @@ START_TEST(filesystem)
test_GetFileName
();
test_GetBaseName
();
test_GetAbsolutePathName
();
test_GetFile
();
IFileSystem3_Release
(
fs3
);
...
...
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