[PATCH 2/2] Test for GetLogFontA

Adam Petaccia adam at tpetaccia.com
Tue Nov 11 10:24:23 CST 2008


---
 dlls/gdiplus/tests/font.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index ab6d28c..1ce3b2c 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -25,6 +25,7 @@
 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
 
 static const WCHAR arial[] = {'A','r','i','a','l','\0'};
+static const CHAR MultiByteArial[] = {'A','r','i','a','l','\0'};
 static const WCHAR nonexistent[] = {'T','h','i','s','F','o','n','t','s','h','o','u','l','d','N','o','t','E','x','i','s','t','\0'};
 static const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
 static const WCHAR MicrosoftSansSerif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
@@ -98,6 +99,7 @@ static void test_createfont(void)
 static void test_logfont(void)
 {
     LOGFONTW lfw, lfw2;
+    LOGFONTA lfa;
     GpFont *font;
     GpStatus stat;
     GpGraphics *graphics;
@@ -170,6 +172,23 @@ static void test_logfont(void)
     expect(0, lfw2.lfQuality);
     expect(0, lfw2.lfPitchAndFamily);
 
+    stat = GdipGetLogFontA(font, graphics, &lfa);
+    expect(Ok, stat);
+    ok(lstrcmpiA(lfa.lfFaceName, MultiByteArial) == 0, "Expected FaceName to be Arial, got %s\n",
+            lfa.lfFaceName);
+    expect(0, lfw2.lfWidth);
+    expect(0, lfw2.lfEscapement);
+    expect(0, lfw2.lfOrientation);
+    ok((lfw2.lfWeight >= 100) && (lfw2.lfWeight <= 900), "Expected weight to be set\n");
+    expect(TRUE, lfw2.lfItalic);
+    expect(TRUE, lfw2.lfUnderline);
+    expect(TRUE, lfw2.lfStrikeOut);
+    expect(0, lfw2.lfCharSet);
+    expect(0, lfw2.lfOutPrecision);
+    expect(0, lfw2.lfClipPrecision);
+    expect(0, lfw2.lfQuality);
+    expect(0, lfw2.lfPitchAndFamily);
+
     stat = GdipGetFontStyle(font, &style);
     expect(Ok, stat);
     ok (style == (FontStyleItalic | FontStyleUnderline | FontStyleStrikeout),
-- 
1.5.6.3




More information about the wine-patches mailing list