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
77a75d74
Commit
77a75d74
authored
Oct 29, 2015
by
Hugh McMaster
Committed by
Alexandre Julliard
Nov 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for GetConsoleFontSize.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4925f758
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
console.c
dlls/kernel32/tests/console.c
+55
-0
No files found.
dlls/kernel32/tests/console.c
View file @
77a75d74
...
...
@@ -2627,6 +2627,60 @@ static void test_GetCurrentConsoleFont(HANDLE std_output)
"got %d, expected %d
\n
"
,
cfi
.
dwFontSize
.
Y
,
height
);
}
static
void
test_GetConsoleFontSize
(
HANDLE
std_output
)
{
COORD
c
;
DWORD
index
=
0
;
CONSOLE_FONT_INFO
cfi
;
RECT
r
;
CONSOLE_SCREEN_BUFFER_INFO
csbi
;
LONG
font_width
,
font_height
;
HMODULE
hmod
;
DWORD
(
WINAPI
*
pGetNumberOfConsoleFonts
)(
void
);
memset
(
&
c
,
10
,
sizeof
(
COORD
));
SetLastError
(
0xdeadbeef
);
c
=
GetConsoleFontSize
(
NULL
,
index
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"got %u, expected 6
\n
"
,
GetLastError
());
ok
(
!
c
.
X
,
"got %d, expected 0
\n
"
,
c
.
X
);
ok
(
!
c
.
Y
,
"got %d, expected 0
\n
"
,
c
.
Y
);
memset
(
&
c
,
10
,
sizeof
(
COORD
));
SetLastError
(
0xdeadbeef
);
c
=
GetConsoleFontSize
(
GetStdHandle
(
STD_INPUT_HANDLE
),
index
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"got %u, expected 6
\n
"
,
GetLastError
());
ok
(
!
c
.
X
,
"got %d, expected 0
\n
"
,
c
.
X
);
ok
(
!
c
.
Y
,
"got %d, expected 0
\n
"
,
c
.
Y
);
GetCurrentConsoleFont
(
std_output
,
FALSE
,
&
cfi
);
memset
(
&
c
,
10
,
sizeof
(
COORD
));
SetLastError
(
0xdeadbeef
);
c
=
GetConsoleFontSize
(
std_output
,
cfi
.
nFont
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"got %u, expected 0xdeadbeef
\n
"
,
GetLastError
());
GetClientRect
(
GetConsoleWindow
(),
&
r
);
GetConsoleScreenBufferInfo
(
std_output
,
&
csbi
);
font_width
=
(
r
.
right
-
r
.
left
+
1
)
/
csbi
.
srWindow
.
Right
;
font_height
=
(
r
.
bottom
-
r
.
top
+
1
)
/
csbi
.
srWindow
.
Bottom
;
ok
(
c
.
X
==
font_width
,
"got %d, expected %d
\n
"
,
c
.
X
,
font_width
);
ok
(
c
.
Y
==
font_height
,
"got %d, expected %d
\n
"
,
c
.
Y
,
font_height
);
hmod
=
GetModuleHandleA
(
"kernel32.dll"
);
pGetNumberOfConsoleFonts
=
(
void
*
)
GetProcAddress
(
hmod
,
"GetNumberOfConsoleFonts"
);
if
(
!
pGetNumberOfConsoleFonts
)
{
win_skip
(
"GetNumberOfConsoleFonts is not available
\n
"
);
return
;
}
index
=
pGetNumberOfConsoleFonts
();
memset
(
&
c
,
10
,
sizeof
(
COORD
));
SetLastError
(
0xdeadbeef
);
c
=
GetConsoleFontSize
(
std_output
,
index
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %u, expected 87
\n
"
,
GetLastError
());
ok
(
!
c
.
X
,
"got %d, expected 0
\n
"
,
c
.
X
);
ok
(
!
c
.
Y
,
"got %d, expected 0
\n
"
,
c
.
Y
);
}
START_TEST
(
console
)
{
static
const
char
font_name
[]
=
"Lucida Console"
;
...
...
@@ -2760,4 +2814,5 @@ START_TEST(console)
test_ReadConsoleOutputCharacterW
(
hConOut
);
test_ReadConsoleOutputAttribute
(
hConOut
);
test_GetCurrentConsoleFont
(
hConOut
);
test_GetConsoleFontSize
(
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