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
a849136d
Commit
a849136d
authored
Oct 15, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Added GetLogicalDriveStrings tests.
parent
2e9aa16d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
volume.c
dlls/kernel32/tests/volume.c
+74
-0
No files found.
dlls/kernel32/tests/volume.c
View file @
a849136d
...
...
@@ -27,6 +27,8 @@ static BOOL (WINAPI * pGetVolumeNameForVolumeMountPointW)(LPCWSTR, LPWSTR, DWORD
static
HANDLE
(
WINAPI
*
pFindFirstVolumeA
)(
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pFindNextVolumeA
)(
HANDLE
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pFindVolumeClose
)(
HANDLE
);
static
UINT
(
WINAPI
*
pGetLogicalDriveStringsA
)(
UINT
,
LPSTR
);
static
UINT
(
WINAPI
*
pGetLogicalDriveStringsW
)(
UINT
,
LPWSTR
);
/* ############################### */
...
...
@@ -139,6 +141,74 @@ static void test_GetVolumeNameForVolumeMountPointW(void)
ok
(
ret
==
TRUE
,
"GetVolumeNameForVolumeMountPointW failed
\n
"
);
}
static
void
test_GetLogicalDriveStringsA
(
void
)
{
UINT
size
,
size2
;
char
*
buf
,
*
ptr
;
if
(
!
pGetLogicalDriveStringsA
)
{
win_skip
(
"GetLogicalDriveStringsA not available
\n
"
);
return
;
}
size
=
pGetLogicalDriveStringsA
(
0
,
NULL
);
ok
(
size
%
4
==
1
,
"size = %d
\n
"
,
size
);
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
*
buf
=
0
;
size2
=
pGetLogicalDriveStringsA
(
2
,
buf
);
ok
(
size2
==
size
,
"size2 = %d
\n
"
,
size2
);
ok
(
!*
buf
,
"buf changed
\n
"
);
size2
=
pGetLogicalDriveStringsA
(
size
,
buf
);
ok
(
size2
==
size
-
1
,
"size2 = %d
\n
"
,
size2
);
for
(
ptr
=
buf
;
ptr
<
buf
+
size2
;
ptr
+=
4
)
{
ok
(
'A'
<=
*
ptr
&&
*
ptr
<=
'Z'
,
"device name '%c' is not uppercase
\n
"
,
*
ptr
);
ok
(
ptr
[
1
]
==
':'
,
"ptr[1] = %c, expected ':'
\n
"
,
ptr
[
1
]);
ok
(
ptr
[
2
]
==
'\\'
,
"ptr[2] = %c expected '
\\
'
\n
"
,
ptr
[
2
]);
ok
(
!
ptr
[
3
],
"ptr[3] = %c expected nullbyte
\n
"
,
ptr
[
3
]);
}
ok
(
!*
ptr
,
"buf[size2] is not nullbyte
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
static
void
test_GetLogicalDriveStringsW
(
void
)
{
UINT
size
,
size2
;
WCHAR
*
buf
,
*
ptr
;
if
(
!
pGetLogicalDriveStringsW
)
{
win_skip
(
"GetLogicalDriveStringsW not available
\n
"
);
return
;
}
size
=
pGetLogicalDriveStringsW
(
0
,
NULL
);
ok
(
size
%
4
==
1
,
"size = %d
\n
"
,
size
);
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
*
buf
=
0
;
size2
=
pGetLogicalDriveStringsW
(
2
,
buf
);
ok
(
size2
==
size
,
"size2 = %d
\n
"
,
size2
);
ok
(
!*
buf
,
"buf changed
\n
"
);
size2
=
pGetLogicalDriveStringsW
(
size
,
buf
);
ok
(
size2
==
size
-
1
,
"size2 = %d
\n
"
,
size2
);
for
(
ptr
=
buf
;
ptr
<
buf
+
size2
;
ptr
+=
4
)
{
ok
(
'A'
<=
*
ptr
&&
*
ptr
<=
'Z'
,
"device name '%c' is not uppercase
\n
"
,
*
ptr
);
ok
(
ptr
[
1
]
==
':'
,
"ptr[1] = %c, expected ':'
\n
"
,
ptr
[
1
]);
ok
(
ptr
[
2
]
==
'\\'
,
"ptr[2] = %c expected '
\\
'
\n
"
,
ptr
[
2
]);
ok
(
!
ptr
[
3
],
"ptr[3] = %c expected nullbyte
\n
"
,
ptr
[
3
]);
}
ok
(
!*
ptr
,
"buf[size2] is not nullbyte
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
START_TEST
(
volume
)
{
hdll
=
GetModuleHandleA
(
"kernel32.dll"
);
...
...
@@ -147,9 +217,13 @@ START_TEST(volume)
pFindFirstVolumeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"FindFirstVolumeA"
);
pFindNextVolumeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"FindNextVolumeA"
);
pFindVolumeClose
=
(
void
*
)
GetProcAddress
(
hdll
,
"FindVolumeClose"
);
pGetLogicalDriveStringsA
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetLogicalDriveStringsA"
);
pGetLogicalDriveStringsW
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetLogicalDriveStringsW"
);
test_query_dos_deviceA
();
test_FindFirstVolume
();
test_GetVolumeNameForVolumeMountPointA
();
test_GetVolumeNameForVolumeMountPointW
();
test_GetLogicalDriveStringsA
();
test_GetLogicalDriveStringsW
();
}
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