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
7d4bbe9e
Commit
7d4bbe9e
authored
May 08, 2009
by
Guy Albertelli
Committed by
Alexandre Julliard
May 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add more tests for GetVolumeNameForVolumeMountPointA.
parent
cbf4671d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
1 deletion
+47
-1
volume.c
dlls/kernel32/tests/volume.c
+47
-1
No files found.
dlls/kernel32/tests/volume.c
View file @
7d4bbe9e
...
@@ -114,7 +114,8 @@ static void test_GetVolumeNameForVolumeMountPointA(void)
...
@@ -114,7 +114,8 @@ static void test_GetVolumeNameForVolumeMountPointA(void)
{
{
BOOL
ret
;
BOOL
ret
;
char
volume
[
MAX_PATH
],
path
[]
=
"c:
\\
"
;
char
volume
[
MAX_PATH
],
path
[]
=
"c:
\\
"
;
DWORD
len
=
sizeof
(
volume
);
DWORD
len
=
sizeof
(
volume
),
reti
;
char
temp_path
[
MAX_PATH
];
/* not present before w2k */
/* not present before w2k */
if
(
!
pGetVolumeNameForVolumeMountPointA
)
{
if
(
!
pGetVolumeNameForVolumeMountPointA
)
{
...
@@ -122,6 +123,10 @@ static void test_GetVolumeNameForVolumeMountPointA(void)
...
@@ -122,6 +123,10 @@ static void test_GetVolumeNameForVolumeMountPointA(void)
return
;
return
;
}
}
reti
=
GetTempPathA
(
MAX_PATH
,
temp_path
);
ok
(
reti
!=
0
,
"GetTempPathA error %d
\n
"
,
GetLastError
());
ok
(
reti
<
MAX_PATH
,
"temp path should fit into MAX_PATH
\n
"
);
ret
=
pGetVolumeNameForVolumeMountPointA
(
path
,
volume
,
0
);
ret
=
pGetVolumeNameForVolumeMountPointA
(
path
,
volume
,
0
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointA succeeded
\n
"
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointA succeeded
\n
"
);
...
@@ -135,6 +140,47 @@ static void test_GetVolumeNameForVolumeMountPointA(void)
...
@@ -135,6 +140,47 @@ static void test_GetVolumeNameForVolumeMountPointA(void)
ret
=
pGetVolumeNameForVolumeMountPointA
(
path
,
volume
,
len
);
ret
=
pGetVolumeNameForVolumeMountPointA
(
path
,
volume
,
len
);
ok
(
ret
==
TRUE
,
"GetVolumeNameForVolumeMountPointA failed
\n
"
);
ok
(
ret
==
TRUE
,
"GetVolumeNameForVolumeMountPointA failed
\n
"
);
ok
(
!
strncmp
(
volume
,
"
\\\\
?
\\
Volume{"
,
11
),
"GetVolumeNameForVolumeMountPointA failed to return valid string <%s>
\n
"
,
volume
);
/* test with too small buffer */
ret
=
pGetVolumeNameForVolumeMountPointA
(
path
,
volume
,
10
);
todo_wine
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_FILENAME_EXCED_RANGE
,
"GetVolumeNameForVolumeMountPointA failed, wrong error returned, was %d, should be ERROR_FILENAME_EXCED_RANGE
\n
"
,
GetLastError
());
/* Try on a arbitrary directory */
ret
=
pGetVolumeNameForVolumeMountPointA
(
temp_path
,
volume
,
len
);
todo_wine
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_NOT_A_REPARSE_POINT
,
"GetVolumeNameForVolumeMountPointA failed on %s, last=%d
\n
"
,
temp_path
,
GetLastError
());
/* Try on a non-existent dos drive */
path
[
2
]
=
0
;
for
(;
path
[
0
]
<=
'z'
;
path
[
0
]
++
)
{
ret
=
QueryDosDeviceA
(
path
,
volume
,
len
);
if
(
!
ret
)
break
;
}
if
(
path
[
0
]
<=
'z'
)
{
path
[
2
]
=
'\\'
;
ret
=
pGetVolumeNameForVolumeMountPointA
(
path
,
volume
,
len
);
todo_wine
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetVolumeNameForVolumeMountPointA failed on %s, last=%d
\n
"
,
path
,
GetLastError
());
/* Try without trailing \ and on a non-existent dos drive */
path
[
2
]
=
0
;
ret
=
pGetVolumeNameForVolumeMountPointA
(
path
,
volume
,
len
);
todo_wine
ok
(
ret
==
FALSE
&&
GetLastError
()
==
ERROR_INVALID_NAME
,
"GetVolumeNameForVolumeMountPointA failed on %s, last=%d
\n
"
,
path
,
GetLastError
());
}
}
}
static
void
test_GetVolumeNameForVolumeMountPointW
(
void
)
static
void
test_GetVolumeNameForVolumeMountPointW
(
void
)
...
...
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