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
e7a415b3
Commit
e7a415b3
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::GetAbsolutePathName tests.
parent
1027c20c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
filesystem.c
dlls/scrrun/tests/filesystem.c
+71
-0
No files found.
dlls/scrrun/tests/filesystem.c
View file @
e7a415b3
...
...
@@ -391,6 +391,76 @@ static void test_GetBaseName(void)
}
}
static
void
test_GetAbsolutePathName
(
void
)
{
static
const
WCHAR
dir1
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'_'
,
'd'
,
'i'
,
'r'
,
'1'
,
0
};
static
const
WCHAR
dir2
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'_'
,
'd'
,
'i'
,
'r'
,
'2'
,
0
};
static
const
WCHAR
dir_match1
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'_'
,
'd'
,
'i'
,
'r'
,
'*'
,
0
};
static
const
WCHAR
dir_match2
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'_'
,
'd'
,
'i'
,
'*'
,
0
};
static
const
WCHAR
cur_dir
[]
=
{
'.'
,
0
};
WIN32_FIND_DATAW
fdata
;
HANDLE
find
;
WCHAR
buf
[
MAX_PATH
];
BSTR
path
,
result
;
HRESULT
hr
;
hr
=
IFileSystem3_GetAbsolutePathName
(
fs3
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetAbsolutePathName returned %x, expected E_POINTER
\n
"
,
hr
);
hr
=
IFileSystem3_GetAbsolutePathName
(
fs3
,
NULL
,
&
result
);
ok
(
hr
==
S_OK
,
"GetAbsolutePathName returned %x, expected S_OK
\n
"
,
hr
);
GetFullPathNameW
(
cur_dir
,
MAX_PATH
,
buf
,
NULL
);
ok
(
!
lstrcmpW
(
buf
,
result
),
"result = %s, expected %s
\n
"
,
wine_dbgstr_w
(
result
),
wine_dbgstr_w
(
buf
));
SysFreeString
(
result
);
find
=
FindFirstFileW
(
dir_match2
,
&
fdata
);
if
(
find
!=
INVALID_HANDLE_VALUE
)
{
skip
(
"GetAbsolutePathName tests
\n
"
);
FindClose
(
find
);
return
;
}
path
=
SysAllocString
(
dir_match1
);
hr
=
IFileSystem3_GetAbsolutePathName
(
fs3
,
path
,
&
result
);
ok
(
hr
==
S_OK
,
"GetAbsolutePathName returned %x, expected S_OK
\n
"
,
hr
);
GetFullPathNameW
(
dir_match1
,
MAX_PATH
,
buf
,
NULL
);
ok
(
!
lstrcmpW
(
buf
,
result
),
"result = %s, expected %s
\n
"
,
wine_dbgstr_w
(
result
),
wine_dbgstr_w
(
buf
));
SysFreeString
(
result
);
ok
(
CreateDirectoryW
(
dir1
,
NULL
),
"CreateDirectory(%s) failed
\n
"
,
wine_dbgstr_w
(
dir1
));
hr
=
IFileSystem3_GetAbsolutePathName
(
fs3
,
path
,
&
result
);
ok
(
hr
==
S_OK
,
"GetAbsolutePathName returned %x, expected S_OK
\n
"
,
hr
);
GetFullPathNameW
(
dir1
,
MAX_PATH
,
buf
,
NULL
);
ok
(
!
lstrcmpW
(
buf
,
result
),
"result = %s, expected %s
\n
"
,
wine_dbgstr_w
(
result
),
wine_dbgstr_w
(
buf
));
SysFreeString
(
result
);
ok
(
CreateDirectoryW
(
dir2
,
NULL
),
"CreateDirectory(%s) failed
\n
"
,
wine_dbgstr_w
(
dir2
));
hr
=
IFileSystem3_GetAbsolutePathName
(
fs3
,
path
,
&
result
);
ok
(
hr
==
S_OK
,
"GetAbsolutePathName returned %x, expected S_OK
\n
"
,
hr
);
if
(
!
lstrcmpW
(
buf
,
result
))
{
ok
(
!
lstrcmpW
(
buf
,
result
),
"result = %s, expected %s
\n
"
,
wine_dbgstr_w
(
result
),
wine_dbgstr_w
(
buf
));
}
else
{
GetFullPathNameW
(
dir2
,
MAX_PATH
,
buf
,
NULL
);
ok
(
!
lstrcmpW
(
buf
,
result
),
"result = %s, expected %s
\n
"
,
wine_dbgstr_w
(
result
),
wine_dbgstr_w
(
buf
));
}
SysFreeString
(
result
);
SysFreeString
(
path
);
path
=
SysAllocString
(
dir_match2
);
hr
=
IFileSystem3_GetAbsolutePathName
(
fs3
,
path
,
&
result
);
ok
(
hr
==
S_OK
,
"GetAbsolutePathName returned %x, expected S_OK
\n
"
,
hr
);
GetFullPathNameW
(
dir_match2
,
MAX_PATH
,
buf
,
NULL
);
ok
(
!
lstrcmpW
(
buf
,
result
),
"result = %s, expected %s
\n
"
,
wine_dbgstr_w
(
result
),
wine_dbgstr_w
(
buf
));
SysFreeString
(
result
);
SysFreeString
(
path
);
RemoveDirectoryW
(
dir1
);
RemoveDirectoryW
(
dir2
);
}
START_TEST
(
filesystem
)
{
HRESULT
hr
;
...
...
@@ -411,6 +481,7 @@ START_TEST(filesystem)
test_GetParentFolderName
();
test_GetFileName
();
test_GetBaseName
();
test_GetAbsolutePathName
();
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