Paul Vriens : riched20/tests: Fix a test failure on Win9x.

Alexandre Julliard julliard at winehq.org
Tue Jan 20 08:27:32 CST 2009


Module: wine
Branch: master
Commit: bd607b64fdf8adfca5df83ca02b0c4095675e141
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bd607b64fdf8adfca5df83ca02b0c4095675e141

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Mon Jan 19 18:10:53 2009 +0100

riched20/tests: Fix a test failure on Win9x.

---

 dlls/riched20/tests/txtsrv.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c
index cb11469..05976ef 100644
--- a/dlls/riched20/tests/txtsrv.c
+++ b/dlls/riched20/tests/txtsrv.c
@@ -673,6 +673,7 @@ static void test_TxSetText(void)
 
 void test_TxGetNaturalSize() {
     HRESULT result;
+    BOOL ret;
 
     /* This value is used when calling TxGetNaturalSize.  MSDN says
        that this is not supported however a null pointer cannot be
@@ -702,7 +703,14 @@ void test_TxGetNaturalSize() {
     /* Populate the metric strucs */
     SetMapMode(hdcDraw,MM_TEXT);
     GetTextMetrics(hdcDraw, &tmInfo_text);
-    GetCharWidth32(hdcDraw,'A','Z',charwidth_caps_text);
+    SetLastError(0xdeadbeef);
+    ret = GetCharWidth32(hdcDraw,'A','Z',charwidth_caps_text);
+    if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) {
+        win_skip("GetCharWidth32 is not available\n");
+        RestoreDC(hdcDraw,1);
+        ReleaseDC(NULL,hdcDraw);
+        return;
+    }
 
     /* Make measurements in MM_TEXT */
     SetMapMode(hdcDraw,MM_TEXT);




More information about the wine-cvs mailing list