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
b5b9184d
Commit
b5b9184d
authored
Dec 19, 2011
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test that ToUnicode null-terminates the buffer if it's big enough.
parent
3fa4da76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
input.c
dlls/user32/tests/input.c
+7
-2
No files found.
dlls/user32/tests/input.c
View file @
b5b9184d
...
...
@@ -1540,7 +1540,7 @@ static void test_key_map(void)
static
void
test_ToUnicode
(
void
)
{
WCHAR
wStr
[
2
];
WCHAR
wStr
[
4
];
BYTE
state
[
256
];
const
BYTE
SC_RETURN
=
0x1c
,
SC_TAB
=
0x0f
;
const
BYTE
HIGHEST_BIT
=
0x80
;
...
...
@@ -1548,8 +1548,9 @@ static void test_ToUnicode(void)
for
(
i
=
0
;
i
<
256
;
i
++
)
state
[
i
]
=
0
;
wStr
[
1
]
=
0xAA
;
SetLastError
(
0xdeadbeef
);
ret
=
ToUnicode
(
VK_RETURN
,
SC_RETURN
,
state
,
wStr
,
2
,
0
);
ret
=
ToUnicode
(
VK_RETURN
,
SC_RETURN
,
state
,
wStr
,
4
,
0
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"ToUnicode is not implemented
\n
"
);
...
...
@@ -1558,7 +1559,11 @@ static void test_ToUnicode(void)
ok
(
ret
==
1
,
"ToUnicode for Return key didn't return 1 (was %i)
\n
"
,
ret
);
if
(
ret
==
1
)
{
ok
(
wStr
[
0
]
==
'\r'
,
"ToUnicode for CTRL + Return was %i (expected 13)
\n
"
,
wStr
[
0
]);
ok
(
wStr
[
1
]
==
0
||
broken
(
wStr
[
1
]
!=
0
)
/* nt4 */
,
"ToUnicode didn't null-terminate the buffer when there was room.
\n
"
);
}
state
[
VK_CONTROL
]
|=
HIGHEST_BIT
;
state
[
VK_LCONTROL
]
|=
HIGHEST_BIT
;
...
...
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