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 37