* Addendum to r58214.
[reactos.git] / rostests / apitests / gdi32 / CreateFont.c
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 <wine/test.h>
9 #include <wingdi.h>
10
11 #define INVALIDFONT "ThisFontDoesNotExist"
12
13 void Test_CreateFontA()
14 {
15 HFONT hFont;
16 LOGFONTA logfonta;
17 INT result;
18
19 /* Test invalid font name */
20 hFont = CreateFontA(15, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,
21 DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
22 DEFAULT_QUALITY, DEFAULT_PITCH, INVALIDFONT);
23 ok(hFont != 0, "CreateFontA failed\n");
24
25 result = GetObjectA(hFont, sizeof(LOGFONTA), &logfonta);
26 ok(result == sizeof(LOGFONTA), "result = %d", result);
27
28 ok(memcmp(logfonta.lfFaceName, INVALIDFONT, strlen(INVALIDFONT)) == 0, "not equal\n");
29 ok(logfonta.lfWeight == FW_DONTCARE, "lfWeight=%ld\n", logfonta.lfWeight);
30
31 }
32
33 START_TEST(CreateFont)
34 {
35 Test_CreateFontA();
36 }
37