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
d01c135a
Commit
d01c135a
authored
Sep 02, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jun 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add a lot of picky GetVolumePathName tests.
parent
ed151a5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
volume.c
dlls/kernel32/tests/volume.c
+95
-0
No files found.
dlls/kernel32/tests/volume.c
View file @
d01c135a
...
@@ -683,6 +683,94 @@ static void test_GetVolumePathNameA(void)
...
@@ -683,6 +683,94 @@ static void test_GetVolumePathNameA(void)
"
\\
??
\\
ReallyBogus"
,
"%CurrentDrive%
\\
"
,
sizeof
(
volume_path
),
"
\\
??
\\
ReallyBogus"
,
"%CurrentDrive%
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
NO_ERROR
,
NO_ERROR
},
},
{
/* test 20 */
"C:"
,
"C:"
,
2
,
ERROR_FILENAME_EXCED_RANGE
,
NO_ERROR
},
{
/* test 21 */
"C:"
,
"C:"
,
3
,
NO_ERROR
,
ERROR_FILENAME_EXCED_RANGE
},
{
/* test 22 */
"C:
\\
"
,
"C:"
,
2
,
ERROR_FILENAME_EXCED_RANGE
,
NO_ERROR
},
{
/* test 23 */
"C:
\\
"
,
"C:"
,
3
,
NO_ERROR
,
ERROR_FILENAME_EXCED_RANGE
},
{
/* test 24 */
"C::"
,
"C:"
,
2
,
ERROR_FILENAME_EXCED_RANGE
,
NO_ERROR
},
{
/* test 25 */
"C::"
,
"C:"
,
3
,
NO_ERROR
,
ERROR_FILENAME_EXCED_RANGE
},
{
/* test 26 */
"C::"
,
"C:
\\
"
,
4
,
NO_ERROR
,
ERROR_MORE_DATA
},
{
/* test 27 */
"C:
\\
windows
\\
system32
\\
AnInvalidFolder"
,
"C:"
,
3
,
NO_ERROR
,
ERROR_FILENAME_EXCED_RANGE
},
{
/* test 28 */
"
\\\\
?
\\
C:
\\
AnInvalidFolder"
,
"
\\\\
?
\\
C:"
,
3
,
ERROR_FILENAME_EXCED_RANGE
,
NO_ERROR
},
{
/* test 29 */
"
\\\\
?
\\
C:
\\
AnInvalidFolder"
,
"
\\\\
?
\\
C:"
,
6
,
ERROR_FILENAME_EXCED_RANGE
,
NO_ERROR
},
{
/* test 30 */
"
\\\\
?
\\
C:
\\
AnInvalidFolder"
,
"
\\\\
?
\\
C:"
,
7
,
NO_ERROR
,
ERROR_FILENAME_EXCED_RANGE
},
{
/* test 31 */
"
\\\\
?
\\
c:
\\
AnInvalidFolder"
,
"
\\\\
?
\\
c:"
,
7
,
NO_ERROR
,
ERROR_FILENAME_EXCED_RANGE
},
{
/* test 32 */
"C:/"
,
"C:
\\
"
,
4
,
NO_ERROR
,
ERROR_MORE_DATA
},
{
/* test 33 */
"M:/"
,
""
,
4
,
ERROR_FILE_NOT_FOUND
,
ERROR_MORE_DATA
},
{
/* test 34 */
"C:ABC:DEF:
\\
AnInvalidFolder"
,
"C:
\\
"
,
4
,
NO_ERROR
,
ERROR_MORE_DATA
},
{
/* test 35 */
"?:ABC:DEF:
\\
AnInvalidFolder"
,
"?:
\\
"
/* win2k, winxp */
,
sizeof
(
volume_path
),
ERROR_FILE_NOT_FOUND
,
NO_ERROR
},
{
/* test 36 */
"relative/path"
,
"%CurrentDrive%
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
},
{
/* test 37 */
"/unix-style/absolute/path"
,
"%CurrentDrive%
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
},
{
/* test 38 */
"
\\
??
\\
C:
\\
NonExistent"
,
"%CurrentDrive%
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
},
{
/* test 39 */
"
\\
??
\\
M:
\\
NonExistent"
,
"%CurrentDrive%
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
},
{
/* test 40 */
"somefile:def"
,
"%CurrentDrive%
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
},
{
/* test 41 */
"s:omefile"
,
"S:
\\
"
/* win2k, winxp */
,
sizeof
(
volume_path
),
ERROR_FILE_NOT_FOUND
,
NO_ERROR
},
};
};
BOOL
ret
,
success
;
BOOL
ret
,
success
;
DWORD
error
;
DWORD
error
;
...
@@ -709,6 +797,9 @@ static void test_GetVolumePathNameA(void)
...
@@ -709,6 +797,9 @@ static void test_GetVolumePathNameA(void)
BOOL
expected_ret
=
test_paths
[
i
].
error
==
NO_ERROR
?
TRUE
:
FALSE
;
BOOL
expected_ret
=
test_paths
[
i
].
error
==
NO_ERROR
?
TRUE
:
FALSE
;
volume_path
[
0
]
=
0
;
volume_path
[
0
]
=
0
;
if
(
test_paths
[
i
].
path_len
<
sizeof
(
volume_path
))
volume_path
[
test_paths
[
i
].
path_len
]
=
0x11
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetVolumePathNameA
(
test_paths
[
i
].
file_name
,
output
,
test_paths
[
i
].
path_len
);
ret
=
pGetVolumePathNameA
(
test_paths
[
i
].
file_name
,
output
,
test_paths
[
i
].
path_len
);
error
=
GetLastError
();
error
=
GetLastError
();
...
@@ -734,6 +825,10 @@ static void test_GetVolumePathNameA(void)
...
@@ -734,6 +825,10 @@ static void test_GetVolumePathNameA(void)
ok
(
success
,
"GetVolumePathName test %d unexpectedly returned error 0x%x (expected 0x%x).
\n
"
,
ok
(
success
,
"GetVolumePathName test %d unexpectedly returned error 0x%x (expected 0x%x).
\n
"
,
i
,
error
,
test_paths
[
i
].
error
);
i
,
error
,
test_paths
[
i
].
error
);
}
}
if
(
test_paths
[
i
].
path_len
<
sizeof
(
volume_path
))
ok
(
volume_path
[
test_paths
[
i
].
path_len
]
==
0x11
,
"GetVolumePathName test %d corrupted byte after end of buffer.
\n
"
,
i
);
}
}
}
}
...
...
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