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
d17b2930
Commit
d17b2930
authored
Jan 04, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Added tests for FindFirstVolume/FindNextVolume.
parent
7f508df2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
volume.c
dlls/kernel32/tests/volume.c
+33
-0
No files found.
dlls/kernel32/tests/volume.c
View file @
d17b2930
...
@@ -24,6 +24,9 @@
...
@@ -24,6 +24,9 @@
static
HINSTANCE
hdll
;
static
HINSTANCE
hdll
;
static
BOOL
(
WINAPI
*
pGetVolumeNameForVolumeMountPointA
)(
LPCSTR
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetVolumeNameForVolumeMountPointA
)(
LPCSTR
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetVolumeNameForVolumeMountPointW
)(
LPCWSTR
,
LPWSTR
,
DWORD
);
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
);
/* ############################### */
/* ############################### */
...
@@ -44,6 +47,32 @@ static void test_query_dos_deviceA(void)
...
@@ -44,6 +47,32 @@ static void test_query_dos_deviceA(void)
todo_wine
ok
(
found
,
"expected at least one devicename to contain HARDDISK or RAMDISK
\n
"
);
todo_wine
ok
(
found
,
"expected at least one devicename to contain HARDDISK or RAMDISK
\n
"
);
}
}
static
void
test_FindFirstVolume
(
void
)
{
char
volume
[
50
];
HANDLE
handle
;
handle
=
pFindFirstVolumeA
(
volume
,
0
);
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"succeeded with short buffer
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILENAME_EXCED_RANGE
,
"wrong error %u
\n
"
,
GetLastError
()
);
handle
=
pFindFirstVolumeA
(
volume
,
49
);
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"succeeded with short buffer
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILENAME_EXCED_RANGE
,
"wrong error %u
\n
"
,
GetLastError
()
);
handle
=
pFindFirstVolumeA
(
volume
,
50
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"failed err %u
\n
"
,
GetLastError
()
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
do
{
ok
(
strlen
(
volume
)
==
49
,
"bad volume name %s
\n
"
,
volume
);
ok
(
!
memcmp
(
volume
,
"
\\\\
?
\\
Volume{"
,
11
),
"bad volume name %s
\n
"
,
volume
);
ok
(
!
memcmp
(
volume
+
47
,
"}
\\
"
,
2
),
"bad volume name %s
\n
"
,
volume
);
}
while
(
pFindNextVolumeA
(
handle
,
volume
,
MAX_PATH
));
ok
(
GetLastError
()
==
ERROR_NO_MORE_FILES
,
"wrong error %u
\n
"
,
GetLastError
()
);
pFindVolumeClose
(
handle
);
}
}
static
void
test_GetVolumeNameForVolumeMountPointA
(
void
)
static
void
test_GetVolumeNameForVolumeMountPointA
(
void
)
{
{
BOOL
ret
;
BOOL
ret
;
...
@@ -103,8 +132,12 @@ START_TEST(volume)
...
@@ -103,8 +132,12 @@ START_TEST(volume)
hdll
=
GetModuleHandleA
(
"kernel32.dll"
);
hdll
=
GetModuleHandleA
(
"kernel32.dll"
);
pGetVolumeNameForVolumeMountPointA
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumeNameForVolumeMountPointA"
);
pGetVolumeNameForVolumeMountPointA
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumeNameForVolumeMountPointA"
);
pGetVolumeNameForVolumeMountPointW
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumeNameForVolumeMountPointW"
);
pGetVolumeNameForVolumeMountPointW
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumeNameForVolumeMountPointW"
);
pFindFirstVolumeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"FindFirstVolumeA"
);
pFindNextVolumeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"FindNextVolumeA"
);
pFindVolumeClose
=
(
void
*
)
GetProcAddress
(
hdll
,
"FindVolumeClose"
);
test_query_dos_deviceA
();
test_query_dos_deviceA
();
test_FindFirstVolume
();
test_GetVolumeNameForVolumeMountPointA
();
test_GetVolumeNameForVolumeMountPointA
();
test_GetVolumeNameForVolumeMountPointW
();
test_GetVolumeNameForVolumeMountPointW
();
}
}
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