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
591cb80d
Commit
591cb80d
authored
Oct 15, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add more FlushConsoleInputBuffer tests.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d91a82ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
console.c
dlls/kernel32/tests/console.c
+58
-0
No files found.
dlls/kernel32/tests/console.c
View file @
591cb80d
...
...
@@ -1970,6 +1970,63 @@ static void test_WriteConsoleInputW(HANDLE input_handle)
ok
(
ret
==
TRUE
,
"Expected SetConsoleMode to return TRUE, got %d
\n
"
,
ret
);
}
static
void
test_FlushConsoleInputBuffer
(
HANDLE
input
,
HANDLE
output
)
{
INPUT_RECORD
record
;
DWORD
count
;
BOOL
ret
;
ret
=
FlushConsoleInputBuffer
(
input
);
ok
(
ret
,
"FlushConsoleInputBuffer failed: %u
\n
"
,
GetLastError
());
ret
=
GetNumberOfConsoleInputEvents
(
input
,
&
count
);
ok
(
ret
,
"GetNumberOfConsoleInputEvents failed: %u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"Expected count to be 0, got %u
\n
"
,
count
);
record
.
EventType
=
KEY_EVENT
;
record
.
Event
.
KeyEvent
.
bKeyDown
=
1
;
record
.
Event
.
KeyEvent
.
wRepeatCount
=
1
;
record
.
Event
.
KeyEvent
.
wVirtualKeyCode
=
VK_RETURN
;
record
.
Event
.
KeyEvent
.
wVirtualScanCode
=
VK_RETURN
;
record
.
Event
.
KeyEvent
.
uChar
.
UnicodeChar
=
'\r'
;
record
.
Event
.
KeyEvent
.
dwControlKeyState
=
0
;
ret
=
WriteConsoleInputW
(
input
,
&
record
,
1
,
&
count
);
ok
(
ret
,
"WriteConsoleInputW failed: %u
\n
"
,
GetLastError
());
ret
=
GetNumberOfConsoleInputEvents
(
input
,
&
count
);
ok
(
ret
,
"GetNumberOfConsoleInputEvents failed: %u
\n
"
,
GetLastError
());
ok
(
count
==
1
,
"Expected count to be 0, got %u
\n
"
,
count
);
ret
=
FlushConsoleInputBuffer
(
input
);
ok
(
ret
,
"FlushConsoleInputBuffer failed: %u
\n
"
,
GetLastError
());
ret
=
GetNumberOfConsoleInputEvents
(
input
,
&
count
);
ok
(
ret
,
"GetNumberOfConsoleInputEvents failed: %u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"Expected count to be 0, got %u
\n
"
,
count
);
ret
=
WriteConsoleInputW
(
input
,
&
record
,
1
,
&
count
);
ok
(
ret
,
"WriteConsoleInputW failed: %u
\n
"
,
GetLastError
());
ret
=
GetNumberOfConsoleInputEvents
(
input
,
&
count
);
ok
(
ret
,
"GetNumberOfConsoleInputEvents failed: %u
\n
"
,
GetLastError
());
ok
(
count
==
1
,
"Expected count to be 0, got %u
\n
"
,
count
);
ret
=
FlushFileBuffers
(
input
);
ok
(
ret
,
"FlushFileBuffers failed: %u
\n
"
,
GetLastError
());
ret
=
GetNumberOfConsoleInputEvents
(
input
,
&
count
);
ok
(
ret
,
"GetNumberOfConsoleInputEvents failed: %u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"Expected count to be 0, got %u
\n
"
,
count
);
ret
=
FlushConsoleInputBuffer
(
output
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"FlushConsoleInputBuffer returned: %x(%u)
\n
"
,
ret
,
GetLastError
());
ret
=
FlushFileBuffers
(
output
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"FlushFileBuffers returned: %x(%u)
\n
"
,
ret
,
GetLastError
());
}
static
void
test_WriteConsoleOutputCharacterA
(
HANDLE
output_handle
)
{
static
const
char
output
[]
=
{
'a'
,
0
};
...
...
@@ -4269,6 +4326,7 @@ START_TEST(console)
test_GetNumberOfConsoleInputEvents
(
hConIn
);
test_WriteConsoleInputA
(
hConIn
);
test_WriteConsoleInputW
(
hConIn
);
test_FlushConsoleInputBuffer
(
hConIn
,
hConOut
);
test_WriteConsoleOutputCharacterA
(
hConOut
);
test_WriteConsoleOutputCharacterW
(
hConOut
);
test_WriteConsoleOutputAttribute
(
hConOut
);
...
...
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