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
296bbde1
Commit
296bbde1
authored
Jun 24, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add some tests for GetConsoleCursorInfo.
parent
732a0795
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
console.c
dlls/kernel32/tests/console.c
+48
-0
No files found.
dlls/kernel32/tests/console.c
View file @
296bbde1
...
...
@@ -130,6 +130,52 @@ static void testCursor(HANDLE hCon, COORD sbSize)
ERROR_INVALID_PARAMETER
,
GetLastError
());
}
static
void
testCursorInfo
(
HANDLE
hCon
)
{
BOOL
ret
;
CONSOLE_CURSOR_INFO
info
;
SetLastError
(
0xdeadbeef
);
ret
=
GetConsoleCursorInfo
(
NULL
,
NULL
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"GetLastError: expecting %u got %u
\n
"
,
ERROR_INVALID_HANDLE
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
info
.
dwSize
=
-
1
;
ret
=
GetConsoleCursorInfo
(
NULL
,
&
info
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
info
.
dwSize
==
-
1
,
"Expected no change for dwSize
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"GetLastError: expecting %u got %u
\n
"
,
ERROR_INVALID_HANDLE
,
GetLastError
());
/* Test the correct call first to distinguish between win9x and the rest */
SetLastError
(
0xdeadbeef
);
ret
=
GetConsoleCursorInfo
(
hCon
,
&
info
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
info
.
dwSize
==
25
||
info
.
dwSize
==
12
/* win9x */
,
"Expected 12 or 25, got %d
\n
"
,
info
.
dwSize
);
ok
(
info
.
bVisible
,
"Expected the cursor to be visible
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError: expecting %u got %u
\n
"
,
0xdeadbeef
,
GetLastError
());
if
(
info
.
dwSize
==
12
)
{
skip
(
"NULL CONSOLE_CURSOR_INFO will crash on win9x
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
GetConsoleCursorInfo
(
hCon
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_ACCESS
,
"GetLastError: expecting %u got %u
\n
"
,
ERROR_INVALID_ACCESS
,
GetLastError
());
}
}
static
void
testWriteSimple
(
HANDLE
hCon
,
COORD
sbSize
)
{
COORD
c
;
...
...
@@ -863,6 +909,8 @@ START_TEST(console)
/* Non interactive tests */
testCursor
(
hConOut
,
sbi
.
dwSize
);
/* test parameters (FIXME: test functionality) */
testCursorInfo
(
hConOut
);
/* will test wrapped (on/off) & processed (on/off) strings output */
testWrite
(
hConOut
,
sbi
.
dwSize
);
/* will test line scrolling at the bottom of the screen */
...
...
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