gdi32: add a testcase for GetTextMetrics (try 2)

Austin English austinenglish at gmail.com
Thu Jan 29 17:11:07 CST 2009


Testcase was bitrotting in bug 14518. Only thing different is giving
credit to Mikolaj, since it's his code (I only rediffed & added
todo_wine).

Test passes on WinXP & Win2k.

-- 
-Austin
-------------- next part --------------
From 2182d426e489adb49b2c12069b552adcfa20d387 Mon Sep 17 00:00:00 2001
From: Mikolaj Zalewski <mikolaj.zalewski at gmail.com>
Date: Thu, 29 Jan 2009 17:08:35 -0600
Subject: [PATCH] gdi32: add a testcase for GetTextMetrics

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

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 0aa9af6..6e5f246 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -2477,6 +2477,20 @@ static void test_orientation(void)
     DeleteDC(hdc);
 }
 
+void test_tahoma_internal_leading()
+{
+    HFONT hFont = CreateFont(32, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET,
+        OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, "Tahoma");
+    HDC hdc = GetDC(NULL);
+    TEXTMETRIC tm;
+    HFONT hOldFont = (HFONT)SelectObject(hdc, hFont);
+
+    GetTextMetrics(hdc, &tm);
+    todo_wine ok(tm.tmInternalLeading == 6, "Invalid tmInternalLeading - %d instead of 6\n", tm.tmInternalLeading);
+    DeleteObject(SelectObject(hdc, hOldFont));
+    ReleaseDC(NULL, hdc);
+}
+
 START_TEST(font)
 {
     init();
@@ -2496,6 +2510,7 @@ START_TEST(font)
     test_GetFontUnicodeRanges();
     test_nonexistent_font();
     test_orientation();
+    test_tahoma_internal_leading();
 
     /* On Windows Arial has a lot of default charset aliases such as Arial Cyr,
      * I'd like to avoid them in this test.
-- 
1.5.6.3


More information about the wine-patches mailing list