Commit be287422 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32/tests: Test that otmfsType field is cleaned up from reserved bits.

parent a36e1c84
......@@ -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");
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment