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
f45b6486
Commit
f45b6486
authored
Feb 15, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Add a minimal test for the font dialog.
parent
e37bbd60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
0 deletions
+76
-0
Makefile.in
dlls/comdlg32/tests/Makefile.in
+1
-0
fontdlg.c
dlls/comdlg32/tests/fontdlg.c
+75
-0
No files found.
dlls/comdlg32/tests/Makefile.in
View file @
f45b6486
...
...
@@ -7,6 +7,7 @@ IMPORTS = comdlg32 user32 gdi32 kernel32
CTESTS
=
\
filedlg.c
\
fontdlg.c
\
printdlg.c
RC_SRCS
=
rsrc.rc
...
...
dlls/comdlg32/tests/fontdlg.c
0 → 100644
View file @
f45b6486
/*
* Unit test suite for comdlg32 API functions: font dialogs
*
* Copyright 2009 Vincent Povirk for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wingdi.h"
#include "winuser.h"
#include "objbase.h"
#include "commdlg.h"
#include "wine/test.h"
static
UINT_PTR
CALLBACK
CFHookProcOK
(
HWND
hdlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
switch
(
msg
)
{
case
WM_INITDIALOG
:
PostMessageA
(
hdlg
,
WM_COMMAND
,
IDOK
,
FALSE
);
return
0
;
default:
return
0
;
}
}
static
void
test_ChooseFontA
(
void
)
{
LOGFONTA
lfa
;
CHOOSEFONTA
cfa
;
BOOL
ret
;
memset
(
&
lfa
,
0
,
sizeof
(
LOGFONTA
));
lfa
.
lfHeight
=
-
16
;
lfa
.
lfWeight
=
FW_NORMAL
;
strcpy
(
lfa
.
lfFaceName
,
"Tahoma"
);
memset
(
&
cfa
,
0
,
sizeof
(
CHOOSEFONTA
));
cfa
.
lStructSize
=
sizeof
(
cfa
);
cfa
.
lpLogFont
=
&
lfa
;
cfa
.
Flags
=
CF_ENABLEHOOK
|
CF_INITTOLOGFONTSTRUCT
|
CF_SCREENFONTS
;
cfa
.
lpfnHook
=
CFHookProcOK
;
ret
=
ChooseFontA
(
&
cfa
);
ok
(
ret
==
TRUE
,
"ChooseFontA returned FALSE
\n
"
);
ok
(
lfa
.
lfHeight
==
-
16
,
"Expected -16, got %i
\n
"
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %i
\n
"
,
lfa
.
lfWeight
);
ok
(
strcmp
(
lfa
.
lfFaceName
,
"Tahoma"
)
==
0
,
"Expected Arial, got %s
\n
"
,
lfa
.
lfFaceName
);
}
START_TEST
(
fontdlg
)
{
test_ChooseFontA
();
}
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