From 302872d6cd1eaadd95abcb4d5cceace8ab69c8d9 Mon Sep 17 00:00:00 2001
From: David Adam <david.adam.cnrs@gmail.com>
Date: Mon, 31 May 2010 06:45:31 +0200
Subject: add tests for D3DXFont

---
 dlls/d3dx9_36/tests/core.c |   44 +++++++++++++++++++++-----------------------
 1 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c
index b1379ef..be6b505 100644
--- a/dlls/d3dx9_36/tests/core.c
+++ b/dlls/d3dx9_36/tests/core.c
@@ -389,29 +389,27 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
 
             ret = ID3DXFont_GetTextMetricsA(font, &metrics);
             ok(ret, "ID3DXFont_GetTextMetricsA failed\n");
-            ret = GetTextMetricsA(hdc, &expmetrics);
-            ok(ret, "GetTextMetricsA failed\n");
-
-            ok(metrics.tmHeight == expmetrics.tmHeight, "Returned height %d, expected %d\n", metrics.tmHeight, expmetrics.tmHeight);
-            ok(metrics.tmAscent == expmetrics.tmAscent, "Returned ascent %d, expected %d\n", metrics.tmAscent, expmetrics.tmAscent);
-            ok(metrics.tmDescent == expmetrics.tmDescent, "Returned descent %d, expected %d\n", metrics.tmDescent, expmetrics.tmDescent);
-            ok(metrics.tmInternalLeading == expmetrics.tmInternalLeading, "Returned internal leading %d, expected %d\n", metrics.tmInternalLeading, expmetrics.tmInternalLeading);
-            ok(metrics.tmExternalLeading == expmetrics.tmExternalLeading, "Returned external leading %d, expected %d\n", metrics.tmExternalLeading, expmetrics.tmExternalLeading);
-            ok(metrics.tmAveCharWidth == expmetrics.tmAveCharWidth, "Returned average char width %d, expected %d\n", metrics.tmAveCharWidth, expmetrics.tmAveCharWidth);
-            ok(metrics.tmMaxCharWidth == expmetrics.tmMaxCharWidth, "Returned maximum char width %d, expected %d\n", metrics.tmMaxCharWidth, expmetrics.tmMaxCharWidth);
-            ok(metrics.tmWeight == expmetrics.tmWeight, "Returned weight %d, expected %d\n", metrics.tmWeight, expmetrics.tmWeight);
-            ok(metrics.tmOverhang == expmetrics.tmOverhang, "Returned overhang %d, expected %d\n", metrics.tmOverhang, expmetrics.tmOverhang);
-            ok(metrics.tmDigitizedAspectX == expmetrics.tmDigitizedAspectX, "Returned digitized x aspect %d, expected %d\n", metrics.tmDigitizedAspectX, expmetrics.tmDigitizedAspectX);
-            ok(metrics.tmDigitizedAspectY == expmetrics.tmDigitizedAspectY, "Returned digitized y aspect %d, expected %d\n", metrics.tmDigitizedAspectY, expmetrics.tmDigitizedAspectY);
-            ok(metrics.tmFirstChar == expmetrics.tmFirstChar, "Returned first char %d, expected %d\n", metrics.tmFirstChar, expmetrics.tmFirstChar);
-            ok(metrics.tmLastChar == expmetrics.tmLastChar, "Returned last char %d, expected %d\n", metrics.tmLastChar, expmetrics.tmLastChar);
-            ok(metrics.tmDefaultChar == expmetrics.tmDefaultChar, "Returned default char %d, expected %d\n", metrics.tmDefaultChar, expmetrics.tmDefaultChar);
-            ok(metrics.tmBreakChar == expmetrics.tmBreakChar, "Returned break char %d, expected %d\n", metrics.tmBreakChar, expmetrics.tmBreakChar);
-            ok(metrics.tmItalic == expmetrics.tmItalic, "Returned italic %d, expected %d\n", metrics.tmItalic, expmetrics.tmItalic);
-            ok(metrics.tmUnderlined == expmetrics.tmUnderlined, "Returned underlined %d, expected %d\n", metrics.tmUnderlined, expmetrics.tmUnderlined);
-            ok(metrics.tmStruckOut == expmetrics.tmStruckOut, "Returned struck out %d, expected %d\n", metrics.tmStruckOut, expmetrics.tmStruckOut);
-            ok(metrics.tmPitchAndFamily == expmetrics.tmPitchAndFamily, "Returned pitch and family %d, expected %d\n", metrics.tmPitchAndFamily, expmetrics.tmPitchAndFamily);
-            ok(metrics.tmCharSet == expmetrics.tmCharSet, "Returned charset %d, expected %d\n", metrics.tmCharSet, expmetrics.tmCharSet);
+
+            ok(metrics.tmHeight == 12, "Returned height %d, expected %d\n", metrics.tmHeight, 12);
+            ok(metrics.tmAscent == 9, "Returned ascent %d, expected %d\n", metrics.tmAscent, 9);
+            ok(metrics.tmDescent == 3, "Returned descent %d, expected %d\n", metrics.tmDescent, 3);
+            ok(metrics.tmInternalLeading == 3, "Returned internal leading %d, expected %d\n", metrics.tmInternalLeading, 3);
+            ok(metrics.tmExternalLeading == 0, "Returned external leading %d, expected %d\n", metrics.tmExternalLeading, 0);
+            ok(metrics.tmAveCharWidth == 4, "Returned average char width %d, expected %d\n", metrics.tmAveCharWidth, 4);
+            ok(metrics.tmMaxCharWidth == 24, "Returned maximum char width %d, expected %d\n", metrics.tmMaxCharWidth, 24);
+            ok(metrics.tmWeight == 400, "Returned weight %d, expected %d\n", metrics.tmWeight, 400);
+            ok(metrics.tmOverhang == 0, "Returned overhang %d, expected %d\n", metrics.tmOverhang, 0);
+            ok(metrics.tmDigitizedAspectX == 96, "Returned digitized x aspect %d, expected %d\n", metrics.tmDigitizedAspectX, 96);
+            ok(metrics.tmDigitizedAspectY == 96, "Returned digitized y aspect %d, expected %d\n", metrics.tmDigitizedAspectY, 96);
+            ok(metrics.tmFirstChar == 30, "Returned first char %d, expected %d\n", metrics.tmFirstChar, 30);
+            ok(metrics.tmLastChar == 255, "Returned last char %d, expected %d\n", metrics.tmLastChar, 255);
+            ok(metrics.tmDefaultChar == 31, "Returned default char %d, expected %d\n", metrics.tmDefaultChar, 31);
+            ok(metrics.tmBreakChar == 32, "Returned break char %d, expected %d\n", metrics.tmBreakChar, 32);
+            ok(metrics.tmItalic == 0, "Returned italic %d, expected %d\n", metrics.tmItalic, 0);
+            ok(metrics.tmUnderlined == 0, "Returned underlined %d, expected %d\n", metrics.tmUnderlined, 0);
+            ok(metrics.tmStruckOut == 0, "Returned struck out %d, expected %d\n", metrics.tmStruckOut, 0);
+            ok(metrics.tmPitchAndFamily == 39, "Returned pitch and family %d, expected %d\n", metrics.tmPitchAndFamily, 39);
+            ok(metrics.tmCharSet == 0, "Returned charset %d, expected %d\n", metrics.tmCharSet, 0);
         }
         ID3DXFont_Release(font);
     } else skip("Failed to create a ID3DXFont object\n");
-- 
1.6.4.4

