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
642180d3
Commit
642180d3
authored
Sep 01, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a basic GDI LOGFONT test, fix a couple of failures.
parent
7db2149f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
0 deletions
+82
-0
font.c
dlls/gdi/font.c
+2
-0
.cvsignore
dlls/gdi/tests/.cvsignore
+1
-0
Makefile.in
dlls/gdi/tests/Makefile.in
+1
-0
gdiobj.c
dlls/gdi/tests/gdiobj.c
+78
-0
No files found.
dlls/gdi/font.c
View file @
642180d3
...
...
@@ -213,6 +213,7 @@ static void FONT_LogFontAToW( const LOGFONTA *fontA, LPLOGFONTW fontW )
memcpy
(
fontW
,
fontA
,
sizeof
(
LOGFONTA
)
-
LF_FACESIZE
);
MultiByteToWideChar
(
CP_ACP
,
0
,
fontA
->
lfFaceName
,
-
1
,
fontW
->
lfFaceName
,
LF_FACESIZE
);
fontW
->
lfFaceName
[
LF_FACESIZE
-
1
]
=
0
;
}
static
void
FONT_LogFontWToA
(
const
LOGFONTW
*
fontW
,
LPLOGFONTA
fontA
)
...
...
@@ -220,6 +221,7 @@ static void FONT_LogFontWToA( const LOGFONTW *fontW, LPLOGFONTA fontA )
memcpy
(
fontA
,
fontW
,
sizeof
(
LOGFONTA
)
-
LF_FACESIZE
);
WideCharToMultiByte
(
CP_ACP
,
0
,
fontW
->
lfFaceName
,
-
1
,
fontA
->
lfFaceName
,
LF_FACESIZE
,
NULL
,
NULL
);
fontA
->
lfFaceName
[
LF_FACESIZE
-
1
]
=
0
;
}
static
void
FONT_EnumLogFontExWTo16
(
const
ENUMLOGFONTEXW
*
fontW
,
LPENUMLOGFONTEX16
font16
)
...
...
dlls/gdi/tests/.cvsignore
View file @
642180d3
Makefile
gdiobj.ok
generated.ok
metafile.ok
testlist.c
dlls/gdi/tests/Makefile.in
View file @
642180d3
...
...
@@ -6,6 +6,7 @@ TESTDLL = gdi32.dll
IMPORTS
=
user32 gdi32
CTESTS
=
\
gdiobj.c
\
generated.c
\
metafile.c
...
...
dlls/gdi/tests/gdiobj.c
0 → 100644
View file @
642180d3
/*
* Unit test suite for GDI objects
*
* Copyright 2002 Mike McCormack
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/test.h"
static
void
test_logfont
(
void
)
{
LOGFONTA
lf
,
lfout
;
HFONT
hfont
;
memset
(
&
lf
,
0
,
sizeof
lf
);
lf
.
lfCharSet
=
ANSI_CHARSET
;
lf
.
lfClipPrecision
=
CLIP_DEFAULT_PRECIS
;
lf
.
lfWeight
=
FW_DONTCARE
;
lf
.
lfHeight
=
16
;
lf
.
lfWidth
=
16
;
lf
.
lfQuality
=
DEFAULT_QUALITY
;
lstrcpyA
(
lf
.
lfFaceName
,
"Arial"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirect failed
\n
"
);
ok
(
GetObjectA
(
hfont
,
sizeof
(
lfout
),
&
lfout
)
==
sizeof
(
lfout
),
"GetObject returned wrong size
\n
"
);
ok
(
!
memcmp
(
&
lfout
,
&
lf
,
FIELD_OFFSET
(
LOGFONTA
,
lfFaceName
)),
"fonts don't match
\n
"
);
ok
(
!
lstrcmpA
(
lfout
.
lfFaceName
,
lf
.
lfFaceName
),
"font names don't match: %s != %s
\n
"
,
lfout
.
lfFaceName
,
lf
.
lfFaceName
);
DeleteObject
(
hfont
);
memset
(
&
lf
,
'A'
,
sizeof
(
lf
));
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirectA with strange LOGFONT failed
\n
"
);
ok
(
GetObjectA
(
hfont
,
sizeof
(
lfout
),
NULL
)
==
sizeof
(
lfout
),
"GetObjectA with NULL failed
\n
"
);
ok
(
GetObjectA
(
hfont
,
sizeof
(
lfout
),
&
lfout
)
==
sizeof
(
lfout
),
"GetObjectA failed
\n
"
);
ok
(
!
memcmp
(
&
lfout
,
&
lf
,
FIELD_OFFSET
(
LOGFONTA
,
lfFaceName
)),
"fonts don't match
\n
"
);
lf
.
lfFaceName
[
LF_FACESIZE
-
1
]
=
0
;
ok
(
!
lstrcmpA
(
lfout
.
lfFaceName
,
lf
.
lfFaceName
),
"font names don't match: %s != %s
\n
"
,
lfout
.
lfFaceName
,
lf
.
lfFaceName
);
DeleteObject
(
hfont
);
}
START_TEST
(
gdiobj
)
{
test_logfont
();
}
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