[PATCH 1/2] gdi32/tests: Test that otmfsType field is cleaned up from reserved bits
Nikolay Sivov
nsivov at codeweavers.com
Sun Mar 5 04:44:58 CST 2017
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/gdi32/tests/font.c | 41 +++++++++++++++++++++++++++++++++++++++++
dlls/gdi32/tests/wine_test.sfd | 2 +-
dlls/gdi32/tests/wine_test.ttf | Bin 1776 -> 1776 bytes
3 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 91ea932308..834078e5a9 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -5646,6 +5646,46 @@ todo_wine
ReleaseDC(NULL, hdc);
}
+static void test_fstype_fixup(void)
+{
+ HDC hdc;
+ LOGFONTA lf;
+ HFONT hfont, hfont_prev;
+ DWORD ret;
+ OUTLINETEXTMETRICA *otm;
+ DWORD otm_size;
+
+ memset(&lf, 0, sizeof(lf));
+ lf.lfHeight = 72;
+ lstrcpyA(lf.lfFaceName, "wine_test");
+
+ SetLastError(0xdeadbeef);
+ hfont = CreateFontIndirectA(&lf);
+ ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError());
+
+ hdc = GetDC(NULL);
+
+ hfont_prev = SelectObject(hdc, hfont);
+ ok(hfont_prev != NULL, "SelectObject failed\n");
+
+ otm_size = GetOutlineTextMetricsA(hdc, 0, NULL);
+ otm = HeapAlloc(GetProcessHeap(), 0, otm_size);
+ otm->otmSize = sizeof(*otm);
+ ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm);
+ ok(ret == otm->otmSize, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError());
+
+ /* Test font has fsType set to 0x7fff, test that reserved bits are filtered out,
+ valid bits are 1, 2, 3, 8, 9. */
+todo_wine
+ ok((otm->otmfsType & ~0x30e) == 0, "fsType %#x\n", otm->otmfsType);
+
+ HeapFree(GetProcessHeap(), 0, otm);
+
+ SelectObject(hdc, hfont_prev);
+ DeleteObject(hfont);
+ ReleaseDC(NULL, hdc);
+}
+
static void test_CreateScalableFontResource(void)
{
char ttf_name[MAX_PATH];
@@ -5729,6 +5769,7 @@ static void test_CreateScalableFontResource(void)
test_GetGlyphOutline_empty_contour();
test_GetGlyphOutline_metric_clipping();
+ test_fstype_fixup();
ret = pRemoveFontResourceExA(fot_name, FR_PRIVATE, 0);
ok(!ret, "RemoveFontResourceEx() with not matching flags should fail\n");
diff --git a/dlls/gdi32/tests/wine_test.sfd b/dlls/gdi32/tests/wine_test.sfd
index c985b433d6..79a0a4d409 100644
--- a/dlls/gdi32/tests/wine_test.sfd
+++ b/dlls/gdi32/tests/wine_test.sfd
@@ -15,7 +15,7 @@ LayerCount: 2
Layer: 0 1 "Back" 1
Layer: 1 1 "Fore" 0
XUID: [1021 905 592216984 1247726]
-FSType: 0
+FSType: 32767
OS2Version: 2
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
diff --git a/dlls/gdi32/tests/wine_test.ttf b/dlls/gdi32/tests/wine_test.ttf
index 1562a326ac7e4fd1dc72639fa3716b3084758bd6..d09ae3da5ecfa715630e637b2e5ae2691fc23f4a 100644
GIT binary patch
delta 25
hcmeys`+;|Y0TXZkM5DuuHWR;9G1dRyT*O$%3IK-!3Pu0`
delta 25
hcmeys`+;|Y0aNdUiAIMRttNh}Vq##}T*O$%3IK+P2}b|`
--
2.11.0
More information about the wine-patches
mailing list