ReactOS
0.4.16-dev-237-gd6eebaa
CreateFont.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS api tests
3
* LICENSE: GPL - See COPYING in the top level directory
4
* PURPOSE: Test for CreateFont
5
* PROGRAMMERS: Timo Kreuzer
6
*/
7
8
#include "
precomp.h
"
9
10
#define INVALIDFONT "ThisFontDoesNotExist"
11
12
void
Test_CreateFontA
()
13
{
14
HFONT
hFont
;
15
LOGFONTA
logfonta;
16
INT
result
;
17
18
/* Test invalid font name */
19
hFont
=
CreateFontA
(15, 0, 0, 0,
FW_DONTCARE
,
FALSE
,
FALSE
,
FALSE
,
20
DEFAULT_CHARSET
,
OUT_DEFAULT_PRECIS
,
CLIP_DEFAULT_PRECIS
,
21
DEFAULT_QUALITY
,
DEFAULT_PITCH
,
INVALIDFONT
);
22
ok
(
hFont
!= 0,
"CreateFontA failed\n"
);
23
24
result
=
GetObjectA
(
hFont
,
sizeof
(
LOGFONTA
), &logfonta);
25
ok
(
result
==
sizeof
(
LOGFONTA
),
"result = %d"
,
result
);
26
27
ok
(
memcmp
(logfonta.
lfFaceName
,
INVALIDFONT
,
strlen
(
INVALIDFONT
)) == 0,
"not equal\n"
);
28
ok
(logfonta.
lfWeight
==
FW_DONTCARE
,
"lfWeight=%ld\n"
, logfonta.
lfWeight
);
29
30
}
31
32
START_TEST
(
CreateFont
)
33
{
34
Test_CreateFontA
();
35
}
36
INVALIDFONT
#define INVALIDFONT
Definition:
CreateFont.c:10
Test_CreateFontA
void Test_CreateFontA()
Definition:
CreateFont.c:12
memcmp
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition:
utclib.c:112
strlen
ACPI_SIZE strlen(const char *String)
Definition:
utclib.c:269
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
hFont
HFONT hFont
Definition:
main.c:53
FALSE
#define FALSE
Definition:
types.h:117
result
GLuint64EXT * result
Definition:
glext.h:11304
HFONT
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
LOGFONTA
Definition:
dimm.idl:41
LOGFONTA::lfWeight
LONG lfWeight
Definition:
dimm.idl:46
LOGFONTA::lfFaceName
CHAR lfFaceName[LF_FACESIZE]
Definition:
dimm.idl:55
INT
int32_t INT
Definition:
typedefs.h:58
precomp.h
DEFAULT_PITCH
#define DEFAULT_PITCH
Definition:
wingdi.h:443
FW_DONTCARE
#define FW_DONTCARE
Definition:
wingdi.h:368
GetObjectA
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
DEFAULT_QUALITY
#define DEFAULT_QUALITY
Definition:
wingdi.h:436
DEFAULT_CHARSET
#define DEFAULT_CHARSET
Definition:
wingdi.h:384
OUT_DEFAULT_PRECIS
#define OUT_DEFAULT_PRECIS
Definition:
wingdi.h:415
CreateFont
#define CreateFont
Definition:
wingdi.h:4443
CLIP_DEFAULT_PRECIS
#define CLIP_DEFAULT_PRECIS
Definition:
wingdi.h:426
CreateFontA
HFONT WINAPI CreateFontA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR)
modules
rostests
apitests
gdi32
CreateFont.c
Generated on Mon Nov 4 2024 06:06:52 for ReactOS by
1.9.6