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
ceb57b78
Commit
ceb57b78
authored
Nov 26, 2015
by
Joachim Priesner
Committed by
Alexandre Julliard
Nov 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for GetDriveType with invalid drive spec.
Signed-off-by:
Joachim Priesner
<
joachim.priesner@web.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1ea99a8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
drive.c
dlls/kernel32/tests/drive.c
+59
-0
No files found.
dlls/kernel32/tests/drive.c
View file @
ceb57b78
...
@@ -30,6 +30,7 @@ static DWORD (WINAPI *pGetDiskFreeSpaceExA)(LPCSTR, PULARGE_INTEGER, PULARGE_INT
...
@@ -30,6 +30,7 @@ static DWORD (WINAPI *pGetDiskFreeSpaceExA)(LPCSTR, PULARGE_INTEGER, PULARGE_INT
static
void
test_GetDriveTypeA
(
void
)
static
void
test_GetDriveTypeA
(
void
)
{
{
char
drive
[]
=
"?:
\\
"
;
char
drive
[]
=
"?:
\\
"
;
char
existing_drive_letter
=
0
;
DWORD
logical_drives
;
DWORD
logical_drives
;
UINT
type
;
UINT
type
;
...
@@ -46,14 +47,43 @@ static void test_GetDriveTypeA(void)
...
@@ -46,14 +47,43 @@ static void test_GetDriveTypeA(void)
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"GetDriveTypeA should return DRIVE_NO_ROOT_DIR for inexistent drive %c: but not %u
\n
"
,
"GetDriveTypeA should return DRIVE_NO_ROOT_DIR for inexistent drive %c: but not %u
\n
"
,
drive
[
0
],
type
);
drive
[
0
],
type
);
else
if
(
type
!=
DRIVE_NO_ROOT_DIR
)
existing_drive_letter
=
drive
[
0
];
logical_drives
>>=
1
;
logical_drives
>>=
1
;
}
}
if
(
!
existing_drive_letter
)
{
skip
(
"No drives found, skipping drive spec format tests.
\n
"
);
return
;
}
drive
[
0
]
=
existing_drive_letter
;
drive
[
2
]
=
0
;
/* C: */
type
=
GetDriveTypeA
(
drive
);
ok
(
type
>
DRIVE_NO_ROOT_DIR
&&
type
<=
DRIVE_RAMDISK
,
"got %u for drive spec '%s'
\n
"
,
type
,
drive
);
drive
[
1
]
=
'?'
;
/* C? */
type
=
GetDriveTypeA
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
drive
);
drive
[
1
]
=
0
;
/* C */
type
=
GetDriveTypeA
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
drive
);
drive
[
0
]
=
'?'
;
/* the string "?" */
type
=
GetDriveTypeA
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
drive
);
drive
[
0
]
=
0
;
/* the empty string */
type
=
GetDriveTypeA
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
drive
);
}
}
static
void
test_GetDriveTypeW
(
void
)
static
void
test_GetDriveTypeW
(
void
)
{
{
WCHAR
drive
[]
=
{
'?'
,
':'
,
'\\'
,
0
};
WCHAR
drive
[]
=
{
'?'
,
':'
,
'\\'
,
0
};
WCHAR
existing_drive_letter
=
0
;
DWORD
logical_drives
;
DWORD
logical_drives
;
UINT
type
;
UINT
type
;
...
@@ -70,9 +100,38 @@ static void test_GetDriveTypeW(void)
...
@@ -70,9 +100,38 @@ static void test_GetDriveTypeW(void)
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"GetDriveTypeW should return DRIVE_NO_ROOT_DIR for inexistent drive %c: but not %u
\n
"
,
"GetDriveTypeW should return DRIVE_NO_ROOT_DIR for inexistent drive %c: but not %u
\n
"
,
drive
[
0
],
type
);
drive
[
0
],
type
);
else
if
(
type
!=
DRIVE_NO_ROOT_DIR
)
existing_drive_letter
=
drive
[
0
];
logical_drives
>>=
1
;
logical_drives
>>=
1
;
}
}
if
(
!
existing_drive_letter
)
{
skip
(
"No drives found, skipping drive spec format tests.
\n
"
);
return
;
}
drive
[
0
]
=
existing_drive_letter
;
drive
[
2
]
=
0
;
/* C: */
type
=
GetDriveTypeW
(
drive
);
ok
(
type
>
DRIVE_NO_ROOT_DIR
&&
type
<=
DRIVE_RAMDISK
,
"got %u for drive spec '%s'
\n
"
,
type
,
wine_dbgstr_w
(
drive
));
drive
[
1
]
=
'?'
;
/* C? */
type
=
GetDriveTypeW
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
wine_dbgstr_w
(
drive
));
drive
[
1
]
=
0
;
/* C */
type
=
GetDriveTypeW
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
wine_dbgstr_w
(
drive
));
drive
[
0
]
=
'?'
;
/* the string "?" */
type
=
GetDriveTypeW
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
wine_dbgstr_w
(
drive
));
drive
[
0
]
=
0
;
/* the empty string */
type
=
GetDriveTypeW
(
drive
);
ok
(
type
==
DRIVE_NO_ROOT_DIR
,
"got %u for drive spec '%s'
\n
"
,
type
,
wine_dbgstr_w
(
drive
));
}
}
static
void
test_GetDiskFreeSpaceA
(
void
)
static
void
test_GetDiskFreeSpaceA
(
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