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