Matteo Bruni : gdi32/tests: Add a test for GetGlyphOutline with an insufficient buffer.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Oct 9 13:14:34 CDT 2014


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

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Thu Oct  9 18:00:56 2014 +0200

gdi32/tests: Add a test for GetGlyphOutline with an insufficient buffer.

---

 dlls/gdi32/tests/font.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 852c858..eff1793 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4365,7 +4365,11 @@ static void test_GetGlyphOutline(void)
     SetLastError(0xdeadbeef);
     ret = GetGlyphOutlineW(hdc, ' ', GGO_NATIVE, &gm, 0, NULL, &mat);
     if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+    {
         ok(ret == 0, "GetGlyphOutlineW should return 0 buffer size for space char\n");
+        ok(gm.gmBlackBoxX == 1, "Expected 1, got %u\n", gm.gmBlackBoxX);
+        ok(gm.gmBlackBoxY == 1, "Expected 1, got %u\n", gm.gmBlackBoxY);
+    }
 
     /* requesting buffer size for space char + error */
     memset(&gm, 0, sizeof(gm));
@@ -4375,8 +4379,16 @@ static void test_GetGlyphOutline(void)
     {
        ok(ret == GDI_ERROR, "GetGlyphOutlineW should return GDI_ERROR\n");
        ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError());
+       ok(gm.gmBlackBoxX == 0, "Expected 0, got %u\n", gm.gmBlackBoxX);
+       ok(gm.gmBlackBoxY == 0, "Expected 0, got %u\n", gm.gmBlackBoxY);
     }
 
+    /* test GetGlyphOutline with a buffer too small */
+    SetLastError(0xdeadbeef);
+    ret = GetGlyphOutlineA(hdc, 'A', GGO_NATIVE, &gm, sizeof(i), &i, &mat);
+    if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+        ok(ret == GDI_ERROR, "GetGlyphOutlineW should return an error when the buffer size is too small.\n");
+
     for (i = 0; i < sizeof(fmt) / sizeof(fmt[0]); ++i)
     {
         DWORD dummy;




More information about the wine-cvs mailing list