From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
v3: fix broken ok()'s.
dlls/dwrite/tests/Makefile.in | 1 - dlls/dwrite/tests/analyzer.c | 196 ++-- dlls/dwrite/tests/font.c | 1885 ++++++++++++++++----------------- dlls/dwrite/tests/layout.c | 1428 ++++++++++++------------- 4 files changed, 1753 insertions(+), 1757 deletions(-)
diff --git a/dlls/dwrite/tests/Makefile.in b/dlls/dwrite/tests/Makefile.in index 3df59bf08b3..7fbf9e36c7e 100644 --- a/dlls/dwrite/tests/Makefile.in +++ b/dlls/dwrite/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = dwrite.dll IMPORTS = dwrite gdi32 user32
diff --git a/dlls/dwrite/tests/analyzer.c b/dlls/dwrite/tests/analyzer.c index d1d44c94012..a712e677624 100644 --- a/dlls/dwrite/tests/analyzer.c +++ b/dlls/dwrite/tests/analyzer.c @@ -487,7 +487,7 @@ static IDWriteFontFace *create_fontface(void) HRESULT hr;
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -497,10 +497,10 @@ static IDWriteFontFace *create_fontface(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font); IDWriteGdiInterop_Release(interop); @@ -520,7 +520,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename) lstrcatW(pathW, filename);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW), + ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW), GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA); @@ -537,7 +537,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename) static void _delete_testfontfile(const WCHAR *filename, int line) { BOOL ret = DeleteFileW(filename); - ok_(__FILE__,line)(ret, "failed to delete file %s, error %d\n", wine_dbgstr_w(filename), GetLastError()); + ok_(__FILE__,line)(ret, "failed to delete file %s, error %ld\n", wine_dbgstr_w(filename), GetLastError()); }
static IDWriteFontFace *create_testfontface(const WCHAR *filename) @@ -547,11 +547,11 @@ static IDWriteFontFace *create_testfontface(const WCHAR *filename) HRESULT hr;
hr = IDWriteFactory_CreateFontFileReference(factory, filename, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
return face; @@ -1041,11 +1041,11 @@ static void get_script_analysis(const WCHAR *str, DWRITE_SCRIPT_ANALYSIS *sa)
init_textsource(&analysissource, str, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0, lstrlenW(analysissource.text), &analysissink2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
*sa = g_sa; } @@ -1057,7 +1057,7 @@ static void test_AnalyzeScript(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (*ptr->string) { @@ -1066,7 +1066,7 @@ static void test_AnalyzeScript(void) init_expected_sa(expected_seq, ptr); hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0, lstrlenW(ptr->string), &analysissink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, ANALYZER_ID, expected_seq[0]->sequence, wine_dbgstr_w(ptr->string), FALSE); ptr++; } @@ -1169,12 +1169,12 @@ static void test_AnalyzeLineBreakpoints(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
init_textsource(&analysissource, L"", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0, 0, &analysissink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (*ptr->text) { @@ -1193,7 +1193,7 @@ static void test_AnalyzeLineBreakpoints(void) memset(g_actual_bp, 0, sizeof(g_actual_bp)); hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0, len, &analysissink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); compare_breakpoints(ptr, g_actual_bp);
i++; @@ -1212,7 +1212,7 @@ static void test_GetScriptProperties(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1); IDWriteTextAnalyzer_Release(analyzer); @@ -1223,14 +1223,14 @@ static void test_GetScriptProperties(void)
sa.script = 1000; hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, &props); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */ hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, NULL);
sa.script = 0; hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, &props); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextAnalyzer1_Release(analyzer1); } @@ -1277,7 +1277,7 @@ static void test_GetTextComplexity(void) int i;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1); IDWriteTextAnalyzer_Release(analyzer); @@ -1297,7 +1297,7 @@ if (0) { /* crashes on native */ len = 1; simple = TRUE; hr = IDWriteTextAnalyzer1_GetTextComplexity(analyzer1, NULL, 0, NULL, &simple, &len, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(len == 0, "got %d\n", len); ok(simple == FALSE, "got %d\n", simple);
@@ -1305,7 +1305,7 @@ if (0) { /* crashes on native */ simple = TRUE; indices[0] = 1; hr = IDWriteTextAnalyzer1_GetTextComplexity(analyzer1, L"ABC", 3, NULL, &simple, &len, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(len == 0, "got %d\n", len); ok(simple == FALSE, "got %d\n", simple); ok(indices[0] == 1, "got %d\n", indices[0]); @@ -1318,7 +1318,7 @@ if (0) { /* crashes on native */ simple = !ptr->simple; indices[0] = 0; hr = IDWriteTextAnalyzer1_GetTextComplexity(analyzer1, ptr->text, ptr->length, fontface, &simple, &len, indices); - ok(hr == S_OK, "%d: got 0x%08x\n", i, hr); + ok(hr == S_OK, "%d: Unexpected hr %#lx.\n", i, hr); ok(len == ptr->len_read, "%d: read length: got %d, expected %d\n", i, len, ptr->len_read); ok(simple == ptr->simple, "%d: simple: got %d, expected %d\n", i, simple, ptr->simple); if (simple && ptr->length) @@ -1338,43 +1338,43 @@ static void test_numbersubstitution(void)
/* locale is not specified, method does not require it */ hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, NULL, FALSE, &substitution); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteNumberSubstitution_Release(substitution);
/* invalid locale name, method does not require it */ hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, L"dummy", FALSE, &substitution); - ok(hr == S_OK, "Failed to create number substitution, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create number substitution, hr %#lx.\n", hr); IDWriteNumberSubstitution_Release(substitution);
/* invalid method */ hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL+1, NULL, FALSE, &substitution); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid method */ hr = IDWriteFactory_CreateNumberSubstitution(factory, -1, NULL, FALSE, &substitution); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid locale */ hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL, NULL, FALSE, &substitution); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL, L"dummy", FALSE, &substitution); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL, L"dummy", FALSE, &substitution); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL, L"dummy", FALSE, &substitution); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid locale, but it's not needed for this method */ hr = IDWriteFactory_CreateNumberSubstitution(factory, DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, L"dummy", FALSE, &substitution); - ok(hr == S_OK, "Failed to create number substitution, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create number substitution, hr %#lx.\n", hr); IDWriteNumberSubstitution_Release(substitution); }
@@ -1385,7 +1385,7 @@ static void get_fontface_glyphs(IDWriteFontFace *fontface, const WCHAR *str, UIN HRESULT hr;
hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, glyphs++); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); str++; } } @@ -1401,7 +1401,7 @@ static void get_fontface_advances(IDWriteFontFace *fontface, FLOAT emsize, const HRESULT hr;
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, glyphs + i, 1, &metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
advances[i] = (FLOAT)metrics.advanceWidth * emsize / (FLOAT)fontmetrics.designUnitsPerEm; } @@ -1504,14 +1504,14 @@ static void get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, unsig HRESULT hr;
hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-us", &index, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Not all fonts have an en-us name! */ if (!exists) index = 0;
hr = IDWriteLocalizedStrings_GetString(strings, index, buff, size); - ok(hr == S_OK, "Failed to get name string, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get name string, hr %#lx.\n", hr); }
static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family, const WCHAR *face, @@ -1526,7 +1526,7 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family,
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_GDEF_TAG, (const void **)&gdef.data, &gdef.size, &gdef.context, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists) return; @@ -1545,12 +1545,12 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family, }
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0, NULL, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ranges = malloc(count * sizeof(*ranges));
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, count, ranges, &count); - ok(hr == S_OK, "Failed to get ranges, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get ranges, hr %#lx.\n", hr);
for (i = 0; i < count; ++i) { @@ -1567,7 +1567,7 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family, WCHAR text[1];
hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &ch, 1, &glyph); - ok(hr == S_OK, "Failed to get glyph index, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get glyph index, hr %#lx.\n", hr);
if (!glyph) continue; @@ -1578,7 +1578,7 @@ static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family, memset(glyph_props, 0, sizeof(glyph_props)); hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, text, 1, fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, ARRAY_SIZE(glyphs), clustermap, text_props, glyphs, glyph_props, &actual_count); - ok(hr == S_OK, "Failed to shape, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to shape, hr %#lx.\n", hr); if (actual_count > 1) continue;
@@ -1631,7 +1631,7 @@ static void test_GetGlyphs(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface = create_fontface();
@@ -1640,7 +1640,7 @@ static void test_GetGlyphs(void) sa.shapes = DWRITE_SCRIPT_SHAPES_DEFAULT; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
if (0) { /* NULL fontface - crashes on Windows */ @@ -1655,7 +1655,7 @@ if (0) { sa.shapes = DWRITE_SCRIPT_SHAPES_DEFAULT; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 4, "got %d\n", actual_count); ok(sa.script == 999, "got %u\n", sa.script);
@@ -1664,13 +1664,13 @@ if (0) { actual_count = 0; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 4, "got %d\n", actual_count);
actual_count = 0; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test2W, lstrlenW(test2W), fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs2, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 4, "got %d\n", actual_count); ok(glyphs1[2] != glyphs2[2], "got %d\n", glyphs1[2]);
@@ -1679,13 +1679,13 @@ if (0) { actual_count = 0; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 4, "got %d\n", actual_count);
actual_count = 0; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, TRUE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs2, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 4, "got %d\n", actual_count); ok(glyphs1[0] != glyphs2[0], "got %d\n", glyphs1[0]);
@@ -1696,7 +1696,7 @@ if (0) { actual_count = 0; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test3W, lstrlenW(test3W), fontface, FALSE, TRUE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 2, "got %d\n", actual_count); ok(glyphs1[0] == glyphs2[0], "got %u, expected %u\n", glyphs1[0], glyphs2[0]); ok(glyphs1[1] == glyphs2[1], "got %u, expected %u\n", glyphs1[1], glyphs2[1]); @@ -1711,7 +1711,7 @@ if (0) { hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap, props, lstrlenW(test3W), glyphs1, shapingprops, actual_count, fontface, 10.0, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == advances2[0], "got %.2f, expected %.2f\n", advances[0], advances2[0]); ok(advances[1] == advances2[1], "got %.2f, expected %.2f\n", advances[1], advances2[1]);
@@ -1722,7 +1722,7 @@ if (0) { actual_count = 0; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test3W, lstrlenW(test3W), fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 2, "got %d\n", actual_count); ok(glyphs1[0] == glyphs2[0], "got %u, expected %u\n", glyphs1[0], glyphs2[0]); ok(glyphs1[1] == glyphs2[1], "got %u, expected %u\n", glyphs1[1], glyphs2[1]); @@ -1737,7 +1737,7 @@ if (0) { hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap, props, lstrlenW(test3W), glyphs1, shapingprops, actual_count, fontface, 10.0, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == advances2[0], "got %.2f, expected %.2f\n", advances[0], advances2[0]); ok(advances[1] == advances2[1], "got %.2f, expected %.2f\n", advances[1], advances2[1]);
@@ -1748,7 +1748,7 @@ if (0) { sa.shapes = DWRITE_SCRIPT_SHAPES_NO_VISUAL; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, test1W, lstrlenW(test1W), fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, maxglyphcount, clustermap, props, glyphs1, shapingprops, &actual_count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(actual_count == 4, "got %d\n", actual_count); ok(sa.script == 0, "got %u\n", sa.script); ok(!shapingprops[0].isZeroWidthSpace, "got %d\n", shapingprops[0].isZeroWidthSpace); @@ -1757,7 +1757,7 @@ if (0) {
/* Test setting glyph properties from GDEF. */ hr = IDWriteFactory_GetSystemFontCollection(factory, &syscoll, FALSE); - ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
for (i = 0; i < IDWriteFontCollection_GetFontFamilyCount(syscoll); ++i) { @@ -1766,10 +1766,10 @@ if (0) { WCHAR familyW[256];
hr = IDWriteFontCollection_GetFontFamily(syscoll, i, &family); - ok(hr == S_OK, "Failed to get font family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr); get_enus_string(names, familyW, ARRAY_SIZE(familyW)); IDWriteLocalizedStrings_Release(names);
@@ -1779,13 +1779,13 @@ if (0) { WCHAR faceW[256];
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "Failed to get font instance, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font instance, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names); - ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr); get_enus_string(names, faceW, ARRAY_SIZE(faceW)); IDWriteLocalizedStrings_Release(names);
@@ -1815,7 +1815,7 @@ static void test_GetTypographicFeatures(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer2, (void**)&analyzer2); IDWriteTextAnalyzer_Release(analyzer); @@ -1829,14 +1829,14 @@ static void test_GetTypographicFeatures(void) get_script_analysis(L"abc", &sa); count = 0; hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, NULL, 0, &count, NULL); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(!!count, "Unexpected count %u.\n", count);
/* invalid locale name is ignored */ get_script_analysis(L"abc", &sa); count = 0; hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, L"cadabra", 0, &count, NULL); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(!!count, "Unexpected count %u.\n", count);
/* Make some calls for different scripts. */ @@ -1845,14 +1845,14 @@ static void test_GetTypographicFeatures(void) memset(tags, 0, sizeof(tags)); count = 0; hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, NULL, ARRAY_SIZE(tags), &count, tags); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!count, "Unexpected count %u.\n", count);
get_script_analysis(L"abc", &sa); memset(tags, 0, sizeof(tags)); count = 0; hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer2, fontface, sa, NULL, ARRAY_SIZE(tags), &count, tags); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!count, "Unexpected count %u.\n", count);
IDWriteFontFace_Release(fontface); @@ -1875,7 +1875,7 @@ static void test_GetGlyphPlacements(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
path = create_testfontfile(L"wine_test_font.ttf"); fontface = create_testfontface(path); @@ -1885,7 +1885,7 @@ static void test_GetGlyphPlacements(void) len = lstrlenW(aW); hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, aW, len, fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, len, clustermap, textprops, glyphs, glyphprops, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count);
/* just return on zero glyphs */ @@ -1894,7 +1894,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, 0, fontface, 0.0, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 1.0, "got %.2f\n", advances[0]); ok(offsets[0].advanceOffset == 2.0 && offsets[0].ascenderOffset == 2.0, "got %.2f,%.2f\n", offsets[0].advanceOffset, offsets[0].ascenderOffset); @@ -1905,7 +1905,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, len, fontface, 0.0, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 0.0, "got %.2f\n", advances[0]); ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n", offsets[0].advanceOffset, offsets[0].ascenderOffset); @@ -1915,7 +1915,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, len, fontface, 2048.0, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 1000.0, "got %.2f\n", advances[0]); ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n", offsets[0].advanceOffset, offsets[0].ascenderOffset); @@ -1925,7 +1925,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, len, fontface, 1024.0, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 500.0, "got %.2f\n", advances[0]); ok(advances[1] == 500.0, "got %.2f\n", advances[1]); ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n", @@ -1936,7 +1936,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, len, fontface, 20.48, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 10.0, "got %.2f\n", advances[0]); ok(advances[1] == 10.0, "got %.2f\n", advances[1]); ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n", @@ -1947,7 +1947,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, NULL, textprops, len, glyphs, glyphprops, len, fontface, 1024.0, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 500.0, "got %.2f\n", advances[0]); ok(advances[1] == 500.0, "got %.2f\n", advances[1]);
@@ -1957,7 +1957,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, len, fontface, -10.24, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == -5.0, "got %.2f\n", advances[0]); ok(offsets[0].advanceOffset == 0.0 && offsets[0].ascenderOffset == 0.0, "got %.2f,%.2f\n", offsets[0].advanceOffset, offsets[0].ascenderOffset); @@ -1969,7 +1969,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, len, fontface, 2048.0f, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 1000.0f, "got %.2f\n", advances[0]); ok(advances[1] == 1000.0f, "got %.2f\n", advances[1]); ok(offsets[0].advanceOffset == 0.0f && offsets[0].ascenderOffset == 0.0f, "got %.2f,%.2f\n", @@ -1983,7 +1983,7 @@ static void test_GetGlyphPlacements(void) hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, aW, clustermap, textprops, len, glyphs, glyphprops, len, fontface, 2048.0f, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, advances, offsets); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advances[0] == 0.0f, "got %.2f\n", advances[0]); ok(advances[1] == 1000.0f, "got %.2f\n", advances[1]); ok(offsets[0].advanceOffset == 0.0f && offsets[0].ascenderOffset == 0.0f, "got %.2f,%.2f\n", @@ -2160,7 +2160,7 @@ static void test_ApplyCharacterSpacing(void) int i;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1); IDWriteTextAnalyzer_Release(analyzer); @@ -2216,7 +2216,7 @@ static void test_ApplyCharacterSpacing(void) props, advances, offsets); - ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#x.\n", hr); + ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#lx.\n", hr);
if (hr == S_OK) { ok(ptr->modified_advances[0] == advances[0], "Got advance[0] %.2f, expected %.2f.\n", advances[0], ptr->modified_advances[0]); @@ -2270,7 +2270,7 @@ static void test_ApplyCharacterSpacing(void) props, advances, offsets); - ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#x.\n", hr); + ok(hr == (ptr->min_advance < 0.0f ? E_INVALIDARG : S_OK), "Unexpected hr %#lx.\n", hr);
if (hr == S_OK) { @@ -2346,7 +2346,7 @@ static void test_GetGlyphOrientationTransform(void) int i;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1); IDWriteTextAnalyzer_Release(analyzer); @@ -2359,14 +2359,14 @@ static void test_GetGlyphOrientationTransform(void) memset(&m, 0xcc, sizeof(m)); hr = IDWriteTextAnalyzer1_GetGlyphOrientationTransform(analyzer1, DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES + 1, FALSE, &m); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(m.m11 == 0.0, "got %.2f\n", m.m11);
for (i = 0; i < ARRAY_SIZE(ot_tests); i++) { memset(&m, 0, sizeof(m)); hr = IDWriteTextAnalyzer1_GetGlyphOrientationTransform(analyzer1, ot_tests[i].angle, ot_tests[i].is_sideways, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!memcmp(&ot_tests[i].m, &m, sizeof(m)), "%d: wrong matrix %s\n", i, dbgstr_matrix(&m)); }
@@ -2381,7 +2381,7 @@ static void test_GetGlyphOrientationTransform(void) memset(&m, 0xcc, sizeof(m)); hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2, DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES + 1, FALSE, 0.0, 0.0, &m); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(m.m11 == 0.0, "got %.2f\n", m.m11);
originx = 50.0; @@ -2395,13 +2395,13 @@ static void test_GetGlyphOrientationTransform(void) /* zero offset gives same result as a call from IDWriteTextAnalyzer1 */ hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2, ot_tests[i].angle, ot_tests[i].is_sideways, 0.0, 0.0, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!memcmp(&ot_tests[i].m, &m, sizeof(m)), "%d: wrong matrix %s\n", i, dbgstr_matrix(&m));
m_exp = ot_tests[i].m; hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2, ot_tests[i].angle, ot_tests[i].is_sideways, originx, originy, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* 90 degrees more for sideways */ if (ot_tests[i].is_sideways) { @@ -2464,7 +2464,7 @@ static void test_GetBaseline(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1); IDWriteTextAnalyzer_Release(analyzer); @@ -2481,7 +2481,7 @@ static void test_GetBaseline(void) baseline = 456; hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_DEFAULT, FALSE, TRUE, sa, NULL, &baseline, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!baseline, "Unexpected baseline %d.\n", baseline); ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2489,7 +2489,7 @@ static void test_GetBaseline(void) baseline = 456; hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_DEFAULT, FALSE, FALSE, sa, NULL, &baseline, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!baseline, "Unexpected baseline %d.\n", baseline); ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2497,7 +2497,7 @@ static void test_GetBaseline(void) baseline = 0; hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_CENTRAL, FALSE, TRUE, sa, NULL, &baseline, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(baseline != 0, "Unexpected baseline %d.\n", baseline); ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2505,7 +2505,7 @@ static void test_GetBaseline(void) baseline = 0; hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_CENTRAL, FALSE, FALSE, sa, NULL, &baseline, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!baseline, "Unexpected baseline %d.\n", baseline); ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2513,7 +2513,7 @@ static void test_GetBaseline(void) baseline = 456; hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, fontface, DWRITE_BASELINE_DEFAULT + 100, FALSE, TRUE, sa, NULL, &baseline, &exists); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(!baseline, "Unexpected baseline %d.\n", baseline); ok(!exists, "Unexpected flag %d.\n", exists);
@@ -2551,7 +2551,7 @@ static void test_GetGdiCompatibleGlyphPlacements(void) float emsize;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface = create_fontface();
@@ -2560,7 +2560,7 @@ static void test_GetGdiCompatibleGlyphPlacements(void) count = 0; hr = IDWriteTextAnalyzer_GetGlyphs(analyzer, L"A", 1, fontface, FALSE, FALSE, &sa, NULL, NULL, NULL, NULL, 0, 1, clustermap, textprops, glyphs, glyphprops, &count); - ok(hr == S_OK, "Failed to get glyphs, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get glyphs, hr %#lx.\n", hr); ok(count == 1, "got %u\n", count);
for (emsize = 12.0f; emsize <= 20.0f; emsize += 1.0f) @@ -2570,20 +2570,20 @@ static void test_GetGdiCompatibleGlyphPlacements(void)
hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, L"A", clustermap, textprops, 1, glyphs, glyphprops, count, fontface, emsize, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, &advance, offsets); - ok(hr == S_OK, "Failed to get glyph placements, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get glyph placements, hr %#lx.\n", hr); ok(advance > 0.0f, "Unexpected advance %f.\n", advance);
/* 1 ppdip, no transform */ ppdip = 1.0; hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip, NULL, FALSE, glyphs, 1, &metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
expected = floorf(metrics.advanceWidth * emsize * ppdip / fontmetrics.designUnitsPerEm + 0.5f) / ppdip; hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer, L"A", clustermap, textprops, 1, glyphs, glyphprops, count, fontface, emsize, ppdip, NULL, FALSE, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, &compatadvance, offsets); - ok(hr == S_OK, "Failed to get glyph placements, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get glyph placements, hr %#lx.\n", hr); ok(compatadvance == expected, "%.0f: got advance %f, expected %f, natural %f\n", emsize, compatadvance, expected, advance);
@@ -2591,13 +2591,13 @@ static void test_GetGdiCompatibleGlyphPlacements(void) ppdip = 1.2f; hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip, NULL, FALSE, glyphs, 1, &metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
expected = floorf(metrics.advanceWidth * emsize * ppdip / fontmetrics.designUnitsPerEm + 0.5f) / ppdip; hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer, L"A", clustermap, textprops, 1, glyphs, glyphprops, count, fontface, emsize, ppdip, NULL, FALSE, FALSE, FALSE, &sa, NULL, NULL, NULL, 0, &compatadvance, offsets); - ok(hr == S_OK, "Failed to get glyph placements, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get glyph placements, hr %#lx.\n", hr); ok(float_eq(compatadvance, expected), "%.0f: got advance %f, expected %f, natural %f\n", emsize, compatadvance, expected, advance); } @@ -2783,7 +2783,7 @@ static void test_AnalyzeBidi(void) HRESULT hr;
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (*ptr->text) { @@ -2803,7 +2803,7 @@ static void test_AnalyzeBidi(void) memset(g_resolved_levels, 0, sizeof(g_resolved_levels)); hr = IDWriteTextAnalyzer_AnalyzeBidi(analyzer, &analysissource.IDWriteTextAnalysisSource_iface, 0, len, &analysissink); - ok(hr == S_OK, "%u: got 0x%08x\n", i, hr); + ok(hr == S_OK, "%u: unexpected hr %#lx.\n", i, hr); compare_bidi_levels(i, ptr, len, g_explicit_levels, g_resolved_levels);
i++; @@ -2818,7 +2818,7 @@ START_TEST(analyzer) HRESULT hr;
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&factory); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (hr != S_OK) { win_skip("failed to create factory\n"); diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index bb70c6f2320..0a02ba1236d 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -71,9 +71,6 @@ #define GET_LE_DWORD(x) (x) #endif
-#define EXPECT_HR(hr,hr_exp) \ - ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) - #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
@@ -109,7 +106,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line) ULONG rc; IUnknown_AddRef(obj); rc = IUnknown_Release(obj); - ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); + ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc); }
#define EXPECT_REF_BROKEN(obj,ref,brokenref) _expect_ref_broken((IUnknown*)obj, ref, brokenref, __LINE__) @@ -118,7 +115,7 @@ static void _expect_ref_broken(IUnknown* obj, ULONG ref, ULONG brokenref, int li ULONG rc; IUnknown_AddRef(obj); rc = IUnknown_Release(obj); - ok_(__FILE__,line)(rc == ref || broken(rc == brokenref), "expected refcount %d, got %d\n", ref, rc); + ok_(__FILE__,line)(rc == ref || broken(rc == brokenref), "expected refcount %ld, got %ld\n", ref, rc); }
static BOOL (WINAPI *pGetFontRealizationInfo)(HDC hdc, void *); @@ -475,7 +472,7 @@ static IDWriteFontFace *create_fontface(IDWriteFactory *factory) HRESULT hr;
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -485,10 +482,10 @@ static IDWriteFontFace *create_fontface(IDWriteFactory *factory) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font); IDWriteGdiInterop_Release(interop); @@ -506,20 +503,20 @@ static IDWriteFont *get_font(IDWriteFactory *factory, const WCHAR *name, DWRITE_ HRESULT hr;
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
index = ~0; exists = FALSE; hr = IDWriteFontCollection_FindFamilyName(collection, name, &index, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (!exists) goto not_found;
hr = IDWriteFontCollection_GetFontFamily(collection, index, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, style, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFamily_Release(family); not_found: @@ -546,7 +543,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename) lstrcatW(pathW, filename);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW), + ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW), GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA); @@ -563,7 +560,7 @@ static WCHAR *create_testfontfile(const WCHAR *filename) static void _delete_testfontfile(const WCHAR *filename, int line) { BOOL ret = DeleteFileW(filename); - ok_(__FILE__,line)(ret, "failed to delete file %s, error %d\n", wine_dbgstr_w(filename), GetLastError()); + ok_(__FILE__,line)(ret, "failed to delete file %s, error %ld\n", wine_dbgstr_w(filename), GetLastError()); }
static void get_combined_font_name(const WCHAR *familyW, const WCHAR *faceW, WCHAR *nameW) @@ -731,10 +728,10 @@ static HRESULT WINAPI resourcecollectionloader_CreateEnumeratorFromKey(IDWriteFo HRESULT hr;
hr = IDWriteFactory_CreateCustomFontFileReference(factory, collectionKey, collectionKeySize, This->loader, &font_file); - ok(hr == S_OK, "Failed to create custom file reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create custom file reference, hr %#lx.\n", hr);
hr = create_enumerator(font_file, fontFileEnumerator); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(font_file); return hr; @@ -1057,7 +1054,7 @@ static void test_CreateFontFromLOGFONT(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
if (0) /* null out parameter crashes this call */ @@ -1065,7 +1062,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, NULL, &font); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(font == NULL, "got %p\n", font);
memset(&logfont, 0, sizeof(logfont)); @@ -1076,7 +1073,7 @@ static void test_CreateFontFromLOGFONT(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hfont = CreateFontIndirectW(&logfont); hdc = CreateCompatibleDC(0); @@ -1090,12 +1087,12 @@ static void test_CreateFontFromLOGFONT(void)
exists = TRUE; hr = IDWriteFont_HasCharacter(font, 0xd800, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists == FALSE, "got %d\n", exists);
exists = FALSE; hr = IDWriteFont_HasCharacter(font, 0x20, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists == TRUE, "got %d\n", exists);
/* now check properties */ @@ -1121,11 +1118,11 @@ static void test_CreateFontFromLOGFONT(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
weight = IDWriteFont_GetWeight(font); ok(weight == weights[i][1], - "%d: got %d, expected %d\n", i, weight, weights[i][1]); + "%d: got %d, expected %ld\n", i, weight, weights[i][1]);
IDWriteFont_Release(font); } @@ -1139,7 +1136,7 @@ static void test_CreateFontFromLOGFONT(void)
font = NULL; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
weight = IDWriteFont_GetWeight(font); ok(weight == DWRITE_FONT_WEIGHT_NORMAL || weight == DWRITE_FONT_WEIGHT_BOLD, @@ -1156,7 +1153,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr); ok(font == NULL, "got %p\n", font);
/* Try with name 'Tahoma ' */ @@ -1168,7 +1165,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr); ok(font == NULL, "got %p\n", font);
/* empty string as a facename */ @@ -1179,7 +1176,7 @@ static void test_CreateFontFromLOGFONT(void)
font = (void*)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr); ok(font == NULL, "got %p\n", font);
/* IDWriteGdiInterop1::CreateFontFromLOGFONT() */ @@ -1193,7 +1190,7 @@ static void test_CreateFontFromLOGFONT(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop1_CreateFontFromLOGFONT(interop1, &logfont, NULL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font); IDWriteGdiInterop1_Release(interop1); @@ -1202,9 +1199,9 @@ static void test_CreateFontFromLOGFONT(void) win_skip("IDWriteGdiInterop1 is not supported, skipping CreateFontFromLOGFONT() tests.\n");
ref = IDWriteGdiInterop_Release(interop); - ok(ref == 0, "interop is not released, %u\n", ref); + ok(ref == 0, "interop is not released, %lu\n", ref); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory is not released, %u\n", ref); + ok(ref == 0, "factory is not released, %lu\n", ref); }
static void test_CreateBitmapRenderTarget(void) @@ -1233,24 +1230,24 @@ static void test_CreateBitmapRenderTarget(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
target = NULL; hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop, NULL, 0, 0, &target); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */ hr = IDWriteBitmapRenderTarget_GetSize(target, NULL);
size.cx = size.cy = -1; hr = IDWriteBitmapRenderTarget_GetSize(target, &size); - EXPECT_HR(hr, S_OK); - ok(size.cx == 0, "got %d\n", size.cx); - ok(size.cy == 0, "got %d\n", size.cy); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size.cx == 0, "got %ld\n", size.cx); + ok(size.cy == 0, "got %ld\n", size.cy);
target2 = NULL; hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop, NULL, 0, 0, &target2); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(target != target2, "got %p, %p\n", target2, target); IDWriteBitmapRenderTarget_Release(target2);
@@ -1280,18 +1277,18 @@ static void test_CreateBitmapRenderTarget(void)
target = NULL; hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop, NULL, 10, 5, &target); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hdc = IDWriteBitmapRenderTarget_GetMemoryDC(target); ok(hdc != NULL, "got %p\n", hdc);
/* test context settings */ c = GetTextColor(hdc); - ok(c == RGB(0, 0, 0), "got 0x%08x\n", c); + ok(c == RGB(0, 0, 0), "got 0x%08lx\n", c); ret = GetBkMode(hdc); ok(ret == OPAQUE, "got %d\n", ret); c = GetBkColor(hdc); - ok(c == RGB(255, 255, 255), "got 0x%08x\n", c); + ok(c == RGB(255, 255, 255), "got 0x%08lx\n", c);
hbm = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm != NULL, "got %p\n", hbm); @@ -1307,50 +1304,50 @@ static void test_CreateBitmapRenderTarget(void)
size.cx = size.cy = -1; hr = IDWriteBitmapRenderTarget_GetSize(target, &size); - EXPECT_HR(hr, S_OK); - ok(size.cx == 10, "got %d\n", size.cx); - ok(size.cy == 5, "got %d\n", size.cy); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size.cx == 10, "got %ld\n", size.cx); + ok(size.cy == 5, "got %ld\n", size.cy);
/* resize to same size */ hr = IDWriteBitmapRenderTarget_Resize(target, 10, 5); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 == hbm, "got %p, %p\n", hbm2, hbm);
/* shrink */ hr = IDWriteBitmapRenderTarget_Resize(target, 5, 5); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1; hr = IDWriteBitmapRenderTarget_GetSize(target, &size); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(size.cx == 5, "got %d\n", size.cx); - ok(size.cy == 5, "got %d\n", size.cy); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size.cx == 5, "got %ld\n", size.cx); + ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm);
hr = IDWriteBitmapRenderTarget_Resize(target, 20, 5); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1; hr = IDWriteBitmapRenderTarget_GetSize(target, &size); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(size.cx == 20, "got %d\n", size.cx); - ok(size.cy == 5, "got %d\n", size.cy); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size.cx == 20, "got %ld\n", size.cx); + ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm);
hr = IDWriteBitmapRenderTarget_Resize(target, 1, 5); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1; hr = IDWriteBitmapRenderTarget_GetSize(target, &size); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(size.cx == 1, "got %d\n", size.cx); - ok(size.cy == 5, "got %d\n", size.cy); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size.cx == 1, "got %ld\n", size.cx); + ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); @@ -1365,13 +1362,13 @@ static void test_CreateBitmapRenderTarget(void)
/* empty rectangle */ hr = IDWriteBitmapRenderTarget_Resize(target, 0, 5); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size.cx = size.cy = -1; hr = IDWriteBitmapRenderTarget_GetSize(target, &size); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(size.cx == 0, "got %d\n", size.cx); - ok(size.cy == 5, "got %d\n", size.cy); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(size.cx == 0, "got %ld\n", size.cx); + ok(size.cy == 5, "got %ld\n", size.cy);
hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); @@ -1390,7 +1387,7 @@ static void test_CreateBitmapRenderTarget(void)
memset(&m, 0xcc, sizeof(m)); hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(m.m11 == 1.0 && m.m22 == 1.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21); ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy); ret = GetWorldTransform(hdc, &xform); @@ -1400,11 +1397,11 @@ static void test_CreateBitmapRenderTarget(void)
memset(&m, 0, sizeof(m)); hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&m, 0xcc, sizeof(m)); hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(m.m11 == 0.0 && m.m22 == 0.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21); ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy); ret = GetWorldTransform(hdc, &xform); @@ -1415,18 +1412,18 @@ static void test_CreateBitmapRenderTarget(void) memset(&m, 0, sizeof(m)); m.m11 = 2.0; m.m22 = 1.0; hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ret = GetWorldTransform(hdc, &xform); ok(ret, "got %d\n", ret); ok(xform.eM11 == 1.0 && xform.eM22 == 1.0 && xform.eM12 == 0.0 && xform.eM21 == 0.0, "got wrong transform\n"); ok(xform.eDx == 0.0 && xform.eDy == 0.0, "got %.1f,%.1f\n", xform.eDx, xform.eDy);
hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&m, 0xcc, sizeof(m)); hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(m.m11 == 1.0 && m.m22 == 1.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21); ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy);
@@ -1435,13 +1432,13 @@ static void test_CreateBitmapRenderTarget(void) ok(pdip == 1.0, "got %.2f\n", pdip);
hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(target, 2.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(target, -1.0); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(target, 0.0); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
pdip = IDWriteBitmapRenderTarget_GetPixelsPerDip(target); ok(pdip == 2.0, "got %.2f\n", pdip); @@ -1454,13 +1451,13 @@ static void test_CreateBitmapRenderTarget(void) ok(mode == DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, "got %d\n", mode);
hr = IDWriteBitmapRenderTarget1_SetTextAntialiasMode(target1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE+1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
mode = IDWriteBitmapRenderTarget1_GetTextAntialiasMode(target1); ok(mode == DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, "got %d\n", mode);
hr = IDWriteBitmapRenderTarget1_SetTextAntialiasMode(target1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = IDWriteBitmapRenderTarget1_GetTextAntialiasMode(target1); ok(mode == DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, "got %d\n", mode); @@ -1472,14 +1469,14 @@ static void test_CreateBitmapRenderTarget(void)
/* DrawGlyphRun() argument validation. */ hr = IDWriteBitmapRenderTarget_Resize(target, 16, 16); - ok(hr == S_OK, "Failed to resize target, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to resize target, hr %#lx.\n", hr);
fontface = create_fontface(factory);
ch = 'A'; glyphs[0] = 0; hr = IDWriteFontFace_GetGlyphIndices(fontface, &ch, 1, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyphs[0] > 0, "got %u\n", glyphs[0]); glyphs[1] = glyphs[0];
@@ -1491,46 +1488,46 @@ static void test_CreateBitmapRenderTarget(void)
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 1.0f, 0.0f, 0.0f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_DEFAULT, ¶ms); - ok(hr == S_OK, "Failed to create rendering params, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create rendering params, hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_NATURAL, &run, NULL, RGB(255, 0, 0), NULL); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1, &run, NULL, RGB(255, 0, 0), NULL); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1, &run, params, RGB(255, 0, 0), NULL); - ok(hr == E_INVALIDARG || broken(hr == S_OK) /* Vista */, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG || broken(hr == S_OK) /* Vista */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL, &run, params, RGB(255, 0, 0), NULL); - ok(hr == S_OK, "Failed to draw a run, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to draw a run, hr %#lx.\n", hr);
IDWriteRenderingParams_Release(params);
/* Zero sized target returns earlier. */ hr = IDWriteBitmapRenderTarget_Resize(target, 0, 16); - ok(hr == S_OK, "Failed to resize target, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to resize target, hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_NATURAL, &run, NULL, RGB(255, 0, 0), NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, 0.0f, 0.0f, DWRITE_MEASURING_MODE_GDI_NATURAL + 1, &run, params, RGB(255, 0, 0), NULL); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface);
ref = IDWriteBitmapRenderTarget_Release(target); - ok(ref == 0, "render target not released, %u\n", ref); + ok(ref == 0, "render target not released, %lu\n", ref); ref = IDWriteGdiInterop_Release(interop); - ok(ref == 0, "interop not released, %u\n", ref); + ok(ref == 0, "interop not released, %lu\n", ref); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetFontFamily(void) @@ -1550,10 +1547,10 @@ static void test_GetFontFamily(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscoll, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -1563,10 +1560,10 @@ static void test_GetFontFamily(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(font2 != font, "got %p, %p\n", font2, font);
if (0) /* crashes on native */ @@ -1574,32 +1571,32 @@ static void test_GetFontFamily(void)
EXPECT_REF(font, 1); hr = IDWriteFont_GetFontFamily(font, &family); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(font, 1); EXPECT_REF(family, 2);
hr = IDWriteFont_GetFontFamily(font, &family2); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(family2 == family, "got %p, previous %p\n", family2, family); EXPECT_REF(font, 1); EXPECT_REF(family, 3); IDWriteFontFamily_Release(family2);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFontFamily, (void**)&family2); - EXPECT_HR(hr, E_NOINTERFACE); + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr); ok(family2 == NULL, "got %p\n", family2);
hr = IDWriteFont_GetFontFamily(font2, &family2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(family2 != family, "got %p, %p\n", family2, family);
collection = NULL; hr = IDWriteFontFamily_GetFontCollection(family, &collection); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
collection2 = NULL; hr = IDWriteFontFamily_GetFontCollection(family2, &collection2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(collection == collection2, "got %p, %p\n", collection, collection2); ok(collection == syscoll, "got %p, %p\n", collection, syscoll);
@@ -1617,25 +1614,25 @@ static void test_GetFontFamily(void)
font3 = (void*)0xdeadbeef; hr = IDWriteFontFamily1_GetFont(family1, ~0u, &font3); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(font3 == NULL, "got %p\n", font3);
hr = IDWriteFontFamily1_GetFont(family1, 0, &font3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont3_QueryInterface(font3, &IID_IDWriteFont, (void**)&font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFont3_QueryInterface(font3, &IID_IDWriteFont1, (void**)&font1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont1_Release(font1);
hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList1, (void **)&fontlist1); - ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Failed to get interface, hr %#lx.\n", hr); if (hr == S_OK) { hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList, (void **)&fontlist); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontlist == (IDWriteFontList *)fontlist1, "Unexpected interface pointer.\n"); ok(fontlist != (IDWriteFontList *)family1, "Unexpected interface pointer.\n"); ok(fontlist != (IDWriteFontList *)family, "Unexpected interface pointer.\n"); @@ -1647,10 +1644,10 @@ static void test_GetFontFamily(void) ok(fontlist == (IDWriteFontList *)fontlist2, "Unexpected interface pointer.\n");
hr = IDWriteFontList2_GetFontSet(fontlist2, &fontset); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontList2_GetFontSet(fontlist2, &fontset2); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontset != fontset2, "Unexpected instance.\n");
IDWriteFontSet1_Release(fontset2); @@ -1666,16 +1663,16 @@ static void test_GetFontFamily(void) }
hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList, (void**)&fontlist); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontList_Release(fontlist);
IDWriteFont3_Release(font3);
hr = IDWriteFontFamily1_GetFontFaceReference(family1, 0, &ref); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily1_GetFontFaceReference(family1, 0, &ref1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(ref != ref1, "got %p, %p\n", ref, ref1);
IDWriteFontFaceReference_Release(ref); @@ -1696,11 +1693,11 @@ static void test_GetFontFamily(void)
family2 = (void *)0xdeadbeef; hr = IDWriteFontCollection2_GetFontFamily(coll2, count, &family2); - ok(hr == E_FAIL, "Unexpected hr %#x.\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(!family2, "Unexpected pointer.\n");
hr = IDWriteFontCollection2_GetFontFamily(coll2, 0, &family2); - ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr); IDWriteFontFamily2_Release(family2);
IDWriteFontCollection2_Release(coll2); @@ -1715,7 +1712,7 @@ static void test_GetFontFamily(void) IDWriteFontFamily_Release(family); IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetFamilyNames(void) @@ -1736,7 +1733,7 @@ static void test_GetFamilyNames(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -1746,20 +1743,20 @@ static void test_GetFamilyNames(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFontFamily(font, &family); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */ hr = IDWriteFontFamily_GetFamilyNames(family, NULL);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(names, 1);
hr = IDWriteFontFamily_GetFamilyNames(family, &names2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(names2, 1); ok(names != names2, "got %p, was %p\n", names2, names);
@@ -1771,58 +1768,58 @@ static void test_GetFamilyNames(void)
len = 100; hr = IDWriteLocalizedStrings_GetStringLength(names, 10, &len); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(len == (UINT32)-1, "got %u\n", len);
len = 0; hr = IDWriteLocalizedStrings_GetStringLength(names, 0, &len); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(len > 0, "got %u\n", len);
/* GetString */ hr = IDWriteLocalizedStrings_GetString(names, 0, NULL, 0); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteLocalizedStrings_GetString(names, 10, NULL, 0); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
if (0) hr = IDWriteLocalizedStrings_GetString(names, 0, NULL, 100);
buffer[0] = 1; hr = IDWriteLocalizedStrings_GetString(names, 10, buffer, 100); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(buffer[0] == 0, "got %x\n", buffer[0]);
buffer[0] = 1; hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len-1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(buffer[0] == 0 || broken(buffer[0] == 'T'), "Unexpected buffer contents, %#x.\n", buffer[0]);
buffer[0] = 1; hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(buffer[0] == 0 || broken(buffer[0] == 'T'), "Unexpected buffer contents, %#x.\n", buffer[0]);
buffer[0] = 0; hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len+1); - ok(hr == S_OK, "Failed to get a string, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get a string, hr %#lx.\n", hr); ok(!lstrcmpW(buffer, L"Tahoma"), "Unexpected family name %s.\n", wine_dbgstr_w(buffer));
IDWriteLocalizedStrings_Release(names);
/* GetFamilyNames() on font face */ hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
if (SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3))) { hr = IDWriteFontFace3_GetFamilyNames(fontface3, &names); - ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr);
buffer[0] = 0; hr = IDWriteLocalizedStrings_GetString(names, 0, buffer, len+1); - ok(hr == S_OK, "Failed to get a string, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get a string, hr %#lx.\n", hr); ok(!lstrcmpW(buffer, L"Tahoma"), "Unexpected family name %s.\n", wine_dbgstr_w(buffer));
IDWriteLocalizedStrings_Release(names); @@ -1837,7 +1834,7 @@ static void test_GetFamilyNames(void) IDWriteFont_Release(font); IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_CreateFontFace(void) @@ -1862,7 +1859,7 @@ static void test_CreateFontFace(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -1873,32 +1870,32 @@ static void test_CreateFontFace(void)
font = NULL; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font2 = NULL; hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(font != font2, "got %p, %p\n", font, font2);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFontFace, (void**)&fontface); - ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */ hr = IDWriteFont_CreateFontFace(font, NULL);
fontface = NULL; hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface2 = NULL; hr = IDWriteFont_CreateFontFace(font, &fontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontface == fontface2, "got %p, was %p\n", fontface2, fontface); IDWriteFontFace_Release(fontface2);
fontface2 = NULL; hr = IDWriteFont_CreateFontFace(font2, &fontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontface == fontface2, "got %p, was %p\n", fontface2, fontface); IDWriteFontFace_Release(fontface2);
@@ -1906,36 +1903,36 @@ static void test_CreateFontFace(void) IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFont, (void**)&font); - ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL), "got 0x%08x\n", hr); + ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL), "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fontface); IDWriteGdiInterop_Release(interop);
/* Create from system collection */ hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font = NULL; hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font2 = NULL; hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(font != font2, "got %p, %p\n", font, font2);
fontface = NULL; hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontface2 = NULL; hr = IDWriteFont_CreateFontFace(font2, &fontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontface == fontface2, "got %p, was %p\n", fontface2, fontface);
/* Trivial equality test */ @@ -1953,21 +1950,21 @@ static void test_CreateFontFace(void) IDWriteFontFamily_Release(family); IDWriteFontCollection_Release(collection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u.\n", ref); + ok(ref == 0, "factory not released, %lu.\n", ref);
/* IDWriteFactory::CreateFontFace() */ path = create_testfontfile(test_fontfile); factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
supported = FALSE; file_type = DWRITE_FONT_FILE_TYPE_UNKNOWN; face_type = DWRITE_FONT_FACE_TYPE_CFF; count = 0; hr = IDWriteFontFile_Analyze(file, &supported, &file_type, &face_type, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(supported == TRUE, "got %i\n", supported); ok(file_type == DWRITE_FONT_FILE_TYPE_TRUETYPE, "got %i\n", file_type); ok(face_type == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %i\n", face_type); @@ -1975,42 +1972,42 @@ static void test_CreateFontFace(void)
/* invalid simulation flags */ hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, ~0u, &fontface); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, 0xf, &fontface); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* try mismatching face type, the one that's not supported */ hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == DWRITE_E_FILEFORMAT, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_FILEFORMAT, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* < win10 */, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* < win10 */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_RAW_CFF, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); todo_wine - ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == E_INVALIDARG) /* older versions */, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == E_INVALIDARG) /* older versions */, "Unexpected hr %#lx.\n", hr);
fontface = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TYPE1, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(fontface == NULL, "got %p\n", fontface);
fontface = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_VECTOR, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(fontface == NULL, "got %p\n", fontface);
fontface = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_BITMAP, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(fontface == NULL, "got %p\n", fontface);
fontface = NULL; hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_UNKNOWN, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); todo_wine - ok(hr == S_OK || broken(hr == E_INVALIDARG) /* < win10 */, "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* < win10 */, "Unexpected hr %#lx.\n", hr); if (hr == S_OK) { ok(fontface != NULL, "got %p\n", fontface); face_type = IDWriteFontFace_GetType(fontface); @@ -2020,7 +2017,7 @@ static void test_CreateFontFace(void)
IDWriteFontFile_Release(file); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u.\n", ref); + ok(ref == 0, "factory not released, %lu.\n", ref); DELETE_FONTFILE(path); }
@@ -2038,13 +2035,13 @@ static void get_expected_font_metrics(IDWriteFontFace *fontface, DWRITE_FONT_MET memset(metrics, 0, sizeof(*metrics));
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HEAD_TAG, (const void**)&tt_head, &size, &head_context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HHEA_TAG, (const void**)&tt_hhea, &size, &hhea_context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFontFace_TryGetFontTable(fontface, MS_POST_TAG, (const void**)&tt_post, &size, &post_context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_head) { metrics->designUnitsPerEm = GET_BE_WORD(tt_head->unitsPerEm); @@ -2199,11 +2196,11 @@ static void get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, UINT3 HRESULT hr;
hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-us", &index, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (!exists) index = 0; hr = IDWriteLocalizedStrings_GetString(strings, index, buff, size); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); }
static void test_GetMetrics(void) @@ -2228,7 +2225,7 @@ static void test_GetMetrics(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - EXPECT_HR(hr, S_OK); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -2238,7 +2235,7 @@ static void test_GetMetrics(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hfont = CreateFontIndirectW(&logfont); hdc = CreateCompatibleDC(0); @@ -2268,7 +2265,7 @@ static void test_GetMetrics(void) ok(metrics.strikethroughThickness != 0, "strikethroughThickness %u\n", metrics.strikethroughThickness);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&metrics, 0, sizeof(metrics)); IDWriteFontFace_GetMetrics(fontface, &metrics); @@ -2315,7 +2312,7 @@ static void test_GetMetrics(void) ok(!metrics1.hasTypographicMetrics, "hasTypographicMetrics %d\n", metrics1.hasTypographicMetrics);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&metrics1, 0, sizeof(metrics1)); IDWriteFontFace1_GetMetrics(fontface1, &metrics1); @@ -2357,11 +2354,11 @@ static void test_GetMetrics(void)
/* create regulat Tahoma with bold simulation */ hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 1; hr = IDWriteFontFace_GetFiles(fontface, &count, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_GetMetrics(fontface, &metrics); ok(IDWriteFontFace_GetSimulations(fontface) == 0, "wrong simulations flags\n"); @@ -2369,7 +2366,7 @@ static void test_GetMetrics(void)
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_BOLD, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFace_GetMetrics(fontface, &metrics2); ok(IDWriteFontFace_GetSimulations(fontface) == DWRITE_FONT_SIMULATIONS_BOLD, "wrong simulations flags\n");
@@ -2393,7 +2390,7 @@ static void test_GetMetrics(void)
/* test metrics for whole system collection */ hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) { @@ -2405,12 +2402,12 @@ static void test_GetMetrics(void) IDWriteFont *font;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fontcount = IDWriteFontFamily_GetFontCount(family);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr); get_enus_string(names, familyW, ARRAY_SIZE(familyW)); IDWriteLocalizedStrings_Release(names);
@@ -2418,13 +2415,13 @@ static void test_GetMetrics(void) WCHAR nameW[256];
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "Failed to get a font, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get a font, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create face instance, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create face instance, hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names); - ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr); get_enus_string(names, faceW, ARRAY_SIZE(faceW)); IDWriteLocalizedStrings_Release(names);
@@ -2451,7 +2448,7 @@ static void test_GetMetrics(void) } IDWriteFontCollection_Release(syscollection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_system_fontcollection(void) @@ -2476,16 +2473,16 @@ static void test_system_fontcollection(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_GetSystemFontCollection(factory, &coll2, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(coll2 == collection, "got %p, was %p\n", coll2, collection); IDWriteFontCollection_Release(coll2);
factory2 = create_factory(); hr = IDWriteFactory_GetSystemFontCollection(factory2, &coll2, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(coll2 != collection, "got %p, was %p\n", coll2, collection); IDWriteFontCollection_Release(coll2); IDWriteFactory_Release(factory2); @@ -2496,74 +2493,74 @@ static void test_system_fontcollection(void) /* invalid index */ family = (void*)0xdeadbeef; hr = IDWriteFontCollection_GetFontFamily(collection, i, &family); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(family == NULL, "got %p\n", family);
ret = FALSE; i = (UINT32)-1; hr = IDWriteFontCollection_FindFamilyName(collection, L"Tahoma", &i, &ret); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(ret, "got %d\n", ret); ok(i != (UINT32)-1, "got %u\n", i);
ret = FALSE; i = (UINT32)-1; hr = IDWriteFontCollection_FindFamilyName(collection, L"TAHOMA", &i, &ret); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(ret, "got %d\n", ret); ok(i != (UINT32)-1, "got %u\n", i);
ret = FALSE; i = (UINT32)-1; hr = IDWriteFontCollection_FindFamilyName(collection, L"tAhOmA", &i, &ret); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(ret, "got %d\n", ret); ok(i != (UINT32)-1, "got %u\n", i);
/* get back local file loader */ hr = IDWriteFontCollection_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFamily_Release(family);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
i = 1; file = NULL; hr = IDWriteFontFace_GetFiles(fontface, &i, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(file != NULL, "got %p\n", file); IDWriteFontFace_Release(fontface);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteLocalFontFileLoader_Release(localloader);
/* local loader is not registered by default */ hr = IDWriteFactory_RegisterFontFileLoader(factory, loader); - ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontFileLoader(factory, loader); - ok(hr == S_OK || broken(hr == E_INVALIDARG), "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG), "Unexpected hr %#lx.\n", hr);
/* try with a different factory */ factory2 = create_factory(); hr = IDWriteFactory_RegisterFontFileLoader(factory2, loader); - ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == DWRITE_E_ALREADYREGISTERED), "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_RegisterFontFileLoader(factory2, loader); - ok(hr == DWRITE_E_ALREADYREGISTERED, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontFileLoader(factory2, loader); - ok(hr == S_OK || broken(hr == E_INVALIDARG), "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG), "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontFileLoader(factory2, loader); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); IDWriteFactory_Release(factory2);
IDWriteFontFileLoader_Release(loader); @@ -2571,7 +2568,7 @@ static void test_system_fontcollection(void) ret = TRUE; i = 0; hr = IDWriteFontCollection_FindFamilyName(collection, L"Blah!", &i, &ret); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!ret, "got %d\n", ret); ok(i == (UINT32)-1, "got %u\n", i);
@@ -2582,17 +2579,17 @@ static void test_system_fontcollection(void) IDWriteFactory3 *factory3;
hr = IDWriteFontCollection1_QueryInterface(collection1, &IID_IDWriteFontCollection, (void**)&coll2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(coll2 == collection, "got %p, %p\n", collection, coll2); IDWriteFontCollection_Release(coll2);
family1 = (void*)0xdeadbeef; hr = IDWriteFontCollection1_GetFontFamily(collection1, ~0u, &family1); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(family1 == NULL, "got %p\n", family1);
hr = IDWriteFontCollection1_GetFontFamily(collection1, 0, &family1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFamily1_Release(family1);
/* system fontset */ @@ -2600,24 +2597,24 @@ static void test_system_fontcollection(void) EXPECT_REF(factory, 2); hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset); todo_wine - ok(hr == S_OK, "Failed to get fontset, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get fontset, hr %#lx.\n", hr); if (hr == S_OK) { EXPECT_REF(collection1, 2); EXPECT_REF(factory, 2); EXPECT_REF(fontset, 1);
hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset2); - ok(hr == S_OK, "Failed to get fontset, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get fontset, hr %#lx.\n", hr); ok(fontset != fontset2, "Expected new fontset instance.\n"); EXPECT_REF(fontset2, 1); IDWriteFontSet_Release(fontset2);
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void **)&factory3); - ok(hr == S_OK, "Failed to get IDWriteFactory3 interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get IDWriteFactory3 interface, hr %#lx.\n", hr);
EXPECT_REF(factory, 3); hr = IDWriteFactory3_GetSystemFontSet(factory3, &fontset2); - ok(hr == S_OK, "Failed to get system font set, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get system font set, hr %#lx.\n", hr); ok(fontset != fontset2, "Expected new fontset instance.\n"); EXPECT_REF(fontset2, 1); EXPECT_REF(factory, 4); @@ -2657,18 +2654,18 @@ static void test_system_fontcollection(void) hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC, &collection2); todo_wine - ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get collection, hr %#lx.\n", hr); if (SUCCEEDED(hr)) { hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC, &c2); - ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get collection, hr %#lx.\n", hr); ok(c2 == collection2 && collection != (IDWriteFontCollection *)c2, "Unexpected collection instance.\n"); IDWriteFontCollection2_Release(c2); IDWriteFontCollection2_Release(collection2);
hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE, &collection2); - ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get collection, hr %#lx.\n", hr); IDWriteFontCollection2_Release(collection2); } IDWriteFactory6_Release(factory6); @@ -2677,9 +2674,9 @@ static void test_system_fontcollection(void) win_skip("IDWriteFactory6 is not supported.\n");
ref = IDWriteFontCollection_Release(collection); - ok(!ref, "Collection wasn't released, %u.\n", ref); + ok(!ref, "Collection wasn't released, %lu.\n", ref); ref = IDWriteFactory_Release(factory); - ok(!ref, "Factory wasn't released, %u.\n", ref); + ok(!ref, "Factory wasn't released, %lu.\n", ref); }
static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) @@ -2708,15 +2705,15 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) logfont->lfItalic = 0;
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create font face, %#x\n", hr); + ok(hr == S_OK, "Failed to create font face, %#lx\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists); - ok(hr == S_OK, "Failed to get OS/2 table, %#x\n", hr); + ok(hr == S_OK, "Failed to get OS/2 table, %#lx\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HEAD_TAG, (const void **)&tt_head, &size, &head_context, &exists); - ok(hr == S_OK, "Failed to get head table, %#x\n", hr); + ok(hr == S_OK, "Failed to get head table, %#lx\n", hr);
sim = IDWriteFont_GetSimulations(font);
@@ -2781,7 +2778,7 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) if (exists) { nameW[0] = 0; hr = IDWriteLocalizedStrings_GetString(names, index, nameW, ARRAY_SIZE(nameW)); - ok(hr == S_OK, "Failed to get name string, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get name string, hr %#lx.\n", hr); lstrcpynW(logfont->lfFaceName, nameW, ARRAY_SIZE(logfont->lfFaceName)); } } @@ -2810,7 +2807,7 @@ static void test_ConvertFontFaceToLOGFONT(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */ { @@ -2819,11 +2816,11 @@ if (0) /* crashes on native */ } memset(&logfont, 0xcc, sizeof(logfont)); hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop, NULL, &logfont); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(logfont.lfFaceName[0] == 0, "got face name %s\n", wine_dbgstr_w(logfont.lfFaceName));
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection); for (i = 0; i < count; i++) { @@ -2836,10 +2833,10 @@ if (0) /* crashes on native */ LOGFONTW lf;
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW)); IDWriteLocalizedStrings_Release(names); @@ -2850,10 +2847,10 @@ if (0) /* crashes on native */ IDWriteFontFace *fontface;
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW)); IDWriteLocalizedStrings_Release(names); @@ -2861,7 +2858,7 @@ if (0) /* crashes on native */ get_combined_font_name(familynameW, facenameW, nameW);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (has_face_variations(fontface)) { @@ -2875,14 +2872,14 @@ if (0) /* crashes on native */
memset(&logfont, 0xcc, sizeof(logfont)); hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop, fontface, &logfont); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
sim = IDWriteFontFace_GetSimulations(fontface); get_logfont_from_font(font, &lf);
winetest_push_context("Font %s", wine_dbgstr_w(nameW));
- ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %d, expected lfWeight %d, font weight %d, " + ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %ld, expected lfWeight %ld, font weight %d, " "bold simulation %s.\n", logfont.lfWeight, lf.lfWeight, IDWriteFont_GetWeight(font), sim & DWRITE_FONT_SIMULATIONS_BOLD ? "yes" : "no"); ok(logfont.lfItalic == lf.lfItalic, "Unexpected italic flag %d, oblique simulation %s.\n", @@ -2907,7 +2904,7 @@ if (0) /* crashes on native */ IDWriteFontCollection_Release(collection); IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static HRESULT WINAPI fontfileenumerator_QueryInterface(IDWriteFontFileEnumerator *iface, REFIID riid, void **obj) @@ -3046,50 +3043,50 @@ static void test_CustomFontCollection(void) loader3 = create_collection_loader();
hr = IDWriteFactory_RegisterFontCollectionLoader(factory, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(loader, 1); EXPECT_REF(loader2, 1);
hr = IDWriteFactory_RegisterFontCollectionLoader(factory, loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_RegisterFontCollectionLoader(factory, loader2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_RegisterFontCollectionLoader(factory, loader); - ok(hr == DWRITE_E_ALREADYREGISTERED, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(loader, 2); EXPECT_REF(loader2, 2);
hr = IDWriteFactory_RegisterFontFileLoader(factory, &rloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_RegisterFontCollectionLoader(factory, &resource_collection.IDWriteFontFileCollectionLoader_iface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Loader wasn't registered. */ font_collection = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontCollection(factory, loader3, "Billy", 6, &font_collection); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(font_collection == NULL, "got %p\n", font_collection);
EXPECT_REF(factory, 1); hr = IDWriteFactory_CreateCustomFontCollection(factory, loader, "Billy", 6, &font_collection); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); todo_wine EXPECT_REF(factory, 1); EXPECT_REF(loader, 2); IDWriteFontCollection_Release(font_collection);
hr = IDWriteFactory_CreateCustomFontCollection(factory, loader2, "Billy", 6, &font_collection); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontCollection_Release(font_collection);
font_collection = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontCollection(factory, (IDWriteFontCollectionLoader*)0xdeadbeef, "Billy", 6, &font_collection); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(font_collection == NULL, "got %p\n", font_collection);
font = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA); @@ -3097,13 +3094,13 @@ static void test_CustomFontCollection(void)
hr = IDWriteFactory_CreateCustomFontCollection(factory, &resource_collection.IDWriteFontFileCollectionLoader_iface, &font, sizeof(HRSRC), &font_collection); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); EXPECT_REF(font_collection, 1);
index = 1; exists = FALSE; hr = IDWriteFontCollection_FindFamilyName(font_collection, L"wine_test", &index, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(index == 0, "got index %i\n", index); ok(exists, "got exists %i\n", exists);
@@ -3112,65 +3109,65 @@ static void test_CustomFontCollection(void)
family = NULL; hr = IDWriteFontCollection_GetFontFamily(font_collection, 0, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(family, 1);
family2 = NULL; hr = IDWriteFontCollection_GetFontFamily(font_collection, 0, &family2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(family2, 1); ok(family != family2, "got %p, %p\n", family, family2);
hr = IDWriteFontFamily_GetFont(family, 0, &idfont); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(idfont, 1); EXPECT_REF(family, 2); hr = IDWriteFontFamily_GetFont(family, 0, &idfont2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(idfont2, 1); EXPECT_REF(family, 3); ok(idfont != idfont2, "got %p, %p\n", idfont, idfont2); IDWriteFont_Release(idfont2);
hr = IDWriteFont_GetInformationalStrings(idfont, DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE, &string, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists, "got %d\n", exists); EXPECT_REF(string, 1); IDWriteLocalizedStrings_Release(string);
family3 = NULL; hr = IDWriteFont_GetFontFamily(idfont, &family3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(family, 3); ok(family == family3, "got %p, %p\n", family, family3); IDWriteFontFamily_Release(family3);
idfontface = NULL; hr = IDWriteFont_CreateFontFace(idfont, &idfontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(idfont, 1);
idfont2 = NULL; hr = IDWriteFontFamily_GetFont(family2, 0, &idfont2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(idfont2, 1); EXPECT_REF(idfont, 1); ok(idfont2 != idfont, "Font instances should not match\n");
idfontface2 = NULL; hr = IDWriteFont_CreateFontFace(idfont2, &idfontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(idfontface2 == idfontface, "fontfaces should match\n");
index = 1; fontfile = NULL; hr = IDWriteFontFace_GetFiles(idfontface, &index, &fontfile); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
index = 1; fontfile2 = NULL; hr = IDWriteFontFace_GetFiles(idfontface2, &index, &fontfile2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontfile == fontfile2, "fontfiles should match\n");
IDWriteFont_Release(idfont); @@ -3184,22 +3181,22 @@ static void test_CustomFontCollection(void) IDWriteFontCollection_Release(font_collection);
hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, loader); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, loader2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontCollectionLoader(factory, &resource_collection.IDWriteFontFileCollectionLoader_iface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontFileLoader(factory, &rloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontCollectionLoader_Release(loader); IDWriteFontCollectionLoader_Release(loader2); IDWriteFontCollectionLoader_Release(loader3);
ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static HRESULT WINAPI fontfileloader_QueryInterface(IDWriteFontFileLoader *iface, REFIID riid, void **obj) @@ -3267,80 +3264,80 @@ static void test_CreateCustomFontFileReference(void)
if (0) { /* crashes on win10 */ hr = IDWriteFactory_RegisterFontFileLoader(factory, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); } /* local loader is accepted too */ hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateCustomFontFileReference(factory, key, key_size, loader, &file2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFile_Release(file2); IDWriteFontFile_Release(file); IDWriteFontFileLoader_Release(loader);
hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader); - ok(hr == DWRITE_E_ALREADYREGISTERED, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_RegisterFontFileLoader(factory, &rloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
file = NULL; hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
file = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader3, &file); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(file == NULL, "got %p\n", file);
file = (void*)0xdeadbeef; hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, NULL, &file); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(file == NULL, "got %p\n", file);
file = NULL; hr = IDWriteFactory_CreateCustomFontFileReference(factory, "test", 4, &floader, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
file_type = DWRITE_FONT_FILE_TYPE_TRUETYPE; face_type = DWRITE_FONT_FACE_TYPE_TRUETYPE; support = TRUE; count = 1; hr = IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count); - ok(hr == 0x8faecafe, "got 0x%08x\n", hr); + ok(hr == 0x8faecafe, "Unexpected hr %#lx.\n", hr); ok(support == FALSE, "got %i\n", support); ok(file_type == DWRITE_FONT_FILE_TYPE_UNKNOWN, "got %i\n", file_type); ok(face_type == DWRITE_FONT_FACE_TYPE_UNKNOWN, "got %i\n", face_type); ok(count == 0, "got %i\n", count);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, 0, &face); - ok(hr == 0x8faecafe, "got 0x%08x\n", hr); + ok(hr == 0x8faecafe, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
fontrsrc = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA); ok(fontrsrc != NULL, "Failed to find font resource\n");
hr = IDWriteFactory_CreateCustomFontFileReference(factory, &fontrsrc, sizeof(HRSRC), &rloader, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
file_type = DWRITE_FONT_FILE_TYPE_UNKNOWN; face_type = DWRITE_FONT_FACE_TYPE_UNKNOWN; support = FALSE; count = 0; hr = IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(support == TRUE, "got %i\n", support); ok(file_type == DWRITE_FONT_FILE_TYPE_TRUETYPE, "got %i\n", file_type); ok(face_type == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %i\n", face_type); @@ -3349,14 +3346,14 @@ if (0) { /* crashes on win10 */ /* invalid index */ face = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 1, DWRITE_FONT_SIMULATIONS_NONE, &face); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(face == NULL, "got %p\n", face);
hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* fontface instances are reused starting with win7 */ ok(face == face2 || broken(face != face2), "got %p, %p\n", face, face2); IDWriteFontFace_Release(face2); @@ -3365,37 +3362,37 @@ if (0) { /* crashes on win10 */ face2 = NULL; hr = IDWriteFactory_CreateFontFace(factory2, face_type, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face2); todo_wine - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (face2) { IDWriteFontFace_Release(face2); } file2 = NULL; hr = IDWriteFactory_CreateCustomFontFileReference(factory, &fontrsrc, sizeof(HRSRC), &rloader, &file2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(file != file2, "got %p, %p\n", file, file2);
hr = IDWriteFactory_CreateFontFace(factory, face_type, 1, &file2, 0, DWRITE_FONT_SIMULATIONS_NONE, &face2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* fontface instances are reused starting with win7 */ ok(face == face2 || broken(face != face2), "got %p, %p\n", face, face2); IDWriteFontFace_Release(face2); IDWriteFontFile_Release(file2);
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 0, NULL); - ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphIndices(face, codePoints, 0, NULL); - ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphIndices(face, codePoints, 0, indices); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 0, indices); - ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
indices[0] = indices[1] = 11; hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 1, indices); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(indices[0] == 0, "got index %i\n", indices[0]); ok(indices[1] == 11, "got index %i\n", indices[1]);
@@ -3403,24 +3400,24 @@ if (face2) { hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 1, NULL);
hr = IDWriteFontFace_GetGlyphIndices(face, codePoints, 1, indices); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(indices[0] == 7, "Unexpected glyph index, %u.\n", indices[0]); IDWriteFontFace_Release(face); IDWriteFontFile_Release(file);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &floader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontFileLoader(factory, &floader); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontFileLoader(factory, &floader2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFactory_UnregisterFontFileLoader(factory, &rloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IDWriteFactory_Release(factory2); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -3442,30 +3439,30 @@ static void test_CreateFontFileReference(void)
ffile = (void*)0xdeadbeef; hr = IDWriteFactory_CreateFontFileReference(factory, NULL, NULL, &ffile); - ok(hr == E_INVALIDARG, "got 0x%08x\n",hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n",hr); ok(ffile == NULL, "got %p\n", ffile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &ffile); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
support = FALSE; type = DWRITE_FONT_FILE_TYPE_UNKNOWN; face = DWRITE_FONT_FACE_TYPE_CFF; count = 0; hr = IDWriteFontFile_Analyze(ffile, &support, &type, &face, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(support == TRUE, "got %i\n", support); ok(type == DWRITE_FONT_FILE_TYPE_TRUETYPE, "got %i\n", type); ok(face == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %i\n", face); ok(count == 1, "got %i\n", count);
hr = IDWriteFactory_CreateFontFace(factory, face, 1, &ffile, 0, DWRITE_FONT_SIMULATIONS_NONE, &fface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace_Release(fface); IDWriteFontFile_Release(ffile); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref);
DELETE_FONTFILE(path); } @@ -3480,15 +3477,15 @@ static void test_shared_isolated(void) /* invalid type */ shared = NULL; hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED+1, &IID_IDWriteFactory, (IUnknown**)&shared); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(shared != NULL, "got %p\n", shared); IDWriteFactory_Release(shared);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown**)&shared); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown**)&shared2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(shared == shared2, "got %p, and %p\n", shared, shared2); IDWriteFactory_Release(shared2);
@@ -3496,30 +3493,30 @@ static void test_shared_isolated(void)
/* we got 2 references, released 2 - still same pointer is returned */ hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown**)&shared2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(shared == shared2, "got %p, and %p\n", shared, shared2); IDWriteFactory_Release(shared2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&isolated); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&isolated2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(isolated != isolated2, "got %p, and %p\n", isolated, isolated2); IDWriteFactory_Release(isolated2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IUnknown, (IUnknown**)&isolated2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFactory_Release(isolated2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED+1, &IID_IDWriteFactory, (IUnknown**)&isolated2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(shared != isolated2, "got %p, and %p\n", shared, isolated2);
ref = IDWriteFactory_Release(isolated); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); ref = IDWriteFactory_Release(isolated2); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
struct dwrite_fonttable @@ -3743,16 +3740,16 @@ static void test_GetUnicodeRanges(void) factory = create_factory();
hr = IDWriteFactory_RegisterFontFileLoader(factory, &rloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font = FindResourceA(GetModuleHandleA(NULL), (LPCSTR)MAKEINTRESOURCE(1), (LPCSTR)RT_RCDATA); ok(font != NULL, "Failed to find font resource\n");
hr = IDWriteFactory_CreateCustomFontFileReference(factory, &font, sizeof(HRSRC), &rloader, &ffile); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &ffile, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(ffile);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); @@ -3765,39 +3762,39 @@ static void test_GetUnicodeRanges(void)
count = 0; hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0, NULL, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count > 0, "got %u\n", count);
count = 1; hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, NULL, &count); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(count == 0, "got %u\n", count);
count = 0; hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, &r, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count > 1, "got %u\n", count);
ranges = malloc(count*sizeof(DWRITE_UNICODE_RANGE)); hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, count, ranges, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ranges[0].first = ranges[0].last = 0; hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, ranges, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(ranges[0].first != 0 && ranges[0].last != 0, "got 0x%x-0x%0x\n", ranges[0].first, ranges[0].last);
free(ranges);
hr = IDWriteFactory_UnregisterFontFileLoader(factory, &rloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace1_Release(fontface1);
if (strcmp(winetest_platform, "wine")) {
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
@@ -3809,10 +3806,10 @@ if (strcmp(winetest_platform, "wine")) { IDWriteFont *font;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "Failed to get font family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "Failed to get family names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family names, hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW)); IDWriteLocalizedStrings_Release(names); @@ -3823,13 +3820,13 @@ if (strcmp(winetest_platform, "wine")) { UINT32 range_count, expected_count;
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names); - ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr); IDWriteFont_Release(font);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW)); @@ -3848,12 +3845,12 @@ if (strcmp(winetest_platform, "wine")) { IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1);
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0, NULL, &range_count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
ranges = malloc(range_count * sizeof(*ranges));
hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, range_count, ranges, &range_count); - ok(hr == S_OK, "Failed to get ranges, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get ranges, hr %#lx.\n", hr);
expected_count = fontface_get_expected_unicode_ranges(fontface1, &expected_ranges); ok(expected_count == range_count, "%s - %s: unexpected range count %u, expected %u.\n", @@ -3885,7 +3882,7 @@ if (strcmp(winetest_platform, "wine")) { IDWriteFontCollection_Release(syscollection); } ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetFontFromFontFace(void) @@ -3903,35 +3900,35 @@ static void test_GetFontFromFontFace(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
font2 = NULL; hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(font2 != font, "got %p, %p\n", font2, font);
font3 = NULL; hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(font3 != font && font3 != font2, "got %p, %p, %p\n", font3, font2, font);
hr = IDWriteFont_CreateFontFace(font2, &fontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontface2 == fontface, "got %p, %p\n", fontface2, fontface); IDWriteFontFace_Release(fontface2);
hr = IDWriteFont_CreateFontFace(font3, &fontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontface2 == fontface, "got %p, %p\n", fontface2, fontface); IDWriteFontFace_Release(fontface2); IDWriteFontFace_Release(fontface); @@ -3943,14 +3940,14 @@ static void test_GetFontFromFontFace(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font3); - ok(hr == DWRITE_E_NOFONT, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOFONT, "Unexpected hr %#lx.\n", hr); ok(font3 == NULL, "got %p\n", font3); IDWriteFontFace_Release(fontface);
@@ -3959,7 +3956,7 @@ static void test_GetFontFromFontFace(void) IDWriteFontFamily_Release(family); IDWriteFontCollection_Release(collection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -3976,34 +3973,34 @@ static void test_GetFirstMatchingFont(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(font != font2, "got %p, %p\n", font, font2); IDWriteFont_Release(font); IDWriteFont_Release(font2);
/* out-of-range font props are allowed */ hr = IDWriteFontFamily_GetFirstMatchingFont(family, 1000, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, 10, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
IDWriteFontFamily_Release(family); @@ -4015,7 +4012,7 @@ static void test_GetFirstMatchingFont(void)
IDWriteFontCollection_Release(collection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetMatchingFonts(void) @@ -4032,34 +4029,34 @@ static void test_GetMatchingFonts(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* out-of-range font props are allowed */ hr = IDWriteFontFamily_GetMatchingFonts(family, 1000, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontList_Release(fontlist);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, 10, DWRITE_FONT_STYLE_NORMAL, &fontlist); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontList_Release(fontlist);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10, &fontlist); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontList_Release(fontlist);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontlist != fontlist2, "got %p, %p\n", fontlist, fontlist2); IDWriteFontList_Release(fontlist2);
@@ -4074,23 +4071,23 @@ static void test_GetMatchingFonts(void)
font = (void*)0xdeadbeef; hr = IDWriteFontList1_GetFont(fontlist1, ~0u, &font); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(font == NULL, "got %p\n", font);
font = (void*)0xdeadbeef; hr = IDWriteFontList1_GetFont(fontlist1, count, &font); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(font == NULL, "got %p\n", font);
hr = IDWriteFontList1_GetFont(fontlist1, 0, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont3_Release(font);
hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &ref); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &ref1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(ref != ref1, "got %p, %p\n", ref, ref1);
IDWriteFontFaceReference_Release(ref1); @@ -4105,10 +4102,10 @@ static void test_GetMatchingFonts(void) IDWriteFontSet1 *fontset, *fontset2;
hr = IDWriteFontList2_GetFontSet(fontlist3, &fontset); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontList2_GetFontSet(fontlist3, &fontset2); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontset != fontset2, "Unexpected instance.\n");
IDWriteFontSet1_Release(fontset2); @@ -4124,7 +4121,7 @@ static void test_GetMatchingFonts(void)
IDWriteFontCollection_Release(collection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetInformationalStrings(void) @@ -4143,51 +4140,51 @@ static void test_GetInformationalStrings(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
exists = TRUE; strings = (void *)0xdeadbeef; hr = IDWriteFont_GetInformationalStrings(font, 0xdead, &strings, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists == FALSE, "got %d\n", exists); ok(strings == NULL, "got %p\n", strings);
exists = TRUE; strings = NULL; hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_NONE, &strings, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists == FALSE, "got %d\n", exists);
exists = FALSE; strings = NULL; hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists == TRUE, "got %d\n", exists);
/* strings instance is not reused */ strings2 = NULL; hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings2, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(strings2 != strings, "got %p, %p\n", strings2, strings);
IDWriteLocalizedStrings_Release(strings); IDWriteLocalizedStrings_Release(strings2);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
if (SUCCEEDED(hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3))) { hr = IDWriteFontFace3_GetInformationalStrings(fontface3, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists); - ok(hr == S_OK, "Failed to get info strings, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get info strings, hr %#lx.\n", hr); IDWriteLocalizedStrings_Release(strings);
IDWriteFontFace3_Release(fontface3); @@ -4201,7 +4198,7 @@ static void test_GetInformationalStrings(void) IDWriteFontFamily_Release(family); IDWriteFontCollection_Release(collection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetGdiInterop(void) @@ -4217,21 +4214,21 @@ static void test_GetGdiInterop(void)
interop = NULL; hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
interop2 = NULL; hr = IDWriteFactory_GetGdiInterop(factory, &interop2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(interop == interop2, "got %p, %p\n", interop, interop2); IDWriteGdiInterop_Release(interop2);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&factory2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* each factory gets its own interop */ interop2 = NULL; hr = IDWriteFactory_GetGdiInterop(factory2, &interop2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(interop != interop2, "got %p, %p\n", interop, interop2);
/* release factory - interop still works */ @@ -4245,13 +4242,13 @@ static void test_GetGdiInterop(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop2, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
IDWriteGdiInterop_Release(interop2); IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void *map_font_file(const WCHAR *filename, DWORD *file_size) @@ -4320,17 +4317,17 @@ static void test_CreateFontFaceFromHdc(void)
interop = NULL; hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Invalid HDC. */ fontface = (void*)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, NULL, &fontface); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(fontface == NULL, "got %p\n", fontface);
fontface = (void *)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, (HDC)0xdeadbeef, &fontface); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(fontface == NULL, "got %p\n", fontface);
memset(&logfont, 0, sizeof(logfont)); @@ -4346,17 +4343,17 @@ static void test_CreateFontFaceFromHdc(void)
fontface = NULL; hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, hdc, &fontface); - ok(hr == S_OK, "Failed to create font face, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create font face, hr %#lx.\n", hr);
count = 1; hr = IDWriteFontFace_GetFiles(fontface, &count, &file); - ok(hr == S_OK, "Failed to get font files, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font files, hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "Failed to get file loader, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get file loader, hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void **)&unk); - ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Expected local loader, hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Vista */, "Expected local loader, hr %#lx.\n", hr); if (unk) IUnknown_Release(unk);
@@ -4376,7 +4373,7 @@ static void test_CreateFontFaceFromHdc(void)
fontface = (void *)0xdeadbeef; hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, hdc, &fontface); - ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* Vista */, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* Vista */, "Unexpected hr %#lx.\n", hr); ok(fontface == NULL, "got %p\n", fontface);
DeleteObject(SelectObject(hdc, oldhfont)); @@ -4389,7 +4386,7 @@ static void test_CreateFontFaceFromHdc(void)
num_fonts = 0; resource = AddFontMemResourceEx(font_data, data_size, NULL, &num_fonts); - ok(resource != NULL, "Failed to add memory resource font, %d.\n", GetLastError()); + ok(resource != NULL, "Failed to add memory resource font, %ld.\n", GetLastError()); ok(num_fonts == 1, "Unexpected number of fonts.\n");
memset(&lf, 0, sizeof(lf)); @@ -4401,27 +4398,27 @@ static void test_CreateFontFaceFromHdc(void) oldhfont = SelectObject(hdc, hfont);
hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, hdc, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
count = 1; hr = IDWriteFontFace_GetFiles(fontface, &count, &file); - ok(hr == S_OK, "Failed to get font files, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font files, hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "Failed to get file loader, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get file loader, hr %#lx.\n", hr);
hr = IDWriteFactory_RegisterFontFileLoader(factory, loader); - ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_ALREADYREGISTERED, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteInMemoryFontFileLoader, (void **)&unk); - ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void **)&unk); - ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteFontFile_GetReferenceKey(file, &refkey, &count); - ok(hr == S_OK, "Failed to get ref key, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get ref key, hr %#lx.\n", hr); ok(count > 0, "Unexpected key length %u.\n", count);
if (pGetFontRealizationInfo) @@ -4436,43 +4433,43 @@ static void test_CreateFontFaceFromHdc(void) win_skip("GetFontRealizationInfo() is not available.\n");
hr = IDWriteFontFileLoader_CreateStreamFromKey(loader, refkey, count, &stream); - ok(hr == S_OK, "Failed to create file stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create file stream, hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_CreateStreamFromKey(loader, refkey, count, &stream2); - ok(hr == S_OK, "Failed to create file stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create file stream, hr %#lx.\n", hr); ok(stream2 != stream, "Unexpected stream instance.\n"); IDWriteFontFileStream_Release(stream2);
dummy = 1; hr = IDWriteFontFileLoader_CreateStreamFromKey(loader, &dummy, count, &stream2); - ok(hr == S_OK, "Failed to create file stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create file stream, hr %#lx.\n", hr);
writetime = 1; hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr); ok(writetime == 1, "Unexpected write time.\n");
IDWriteFontFileStream_Release(stream2);
hr = IDWriteFontFileStream_GetFileSize(stream, &size); - ok(hr == S_OK, "Failed to get stream size, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get stream size, hr %#lx.\n", hr); ok(size == data_size, "Unexpected stream size.\n");
hr = IDWriteFontFileStream_GetLastWriteTime(stream, &writetime); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
fragment_context = NULL; hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, size, &fragment_context); - ok(hr == S_OK, "Failed to read fragment, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to read fragment, hr %#lx.\n", hr); ok(fragment_context != NULL, "Unexpected context %p.\n", fragment_context); ok(fragment == fragment_context, "Unexpected data pointer %p, context %p.\n", fragment, fragment_context); IDWriteFontFileStream_ReleaseFileFragment(stream, fragment_context);
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, size + 1, &fragment_context); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, size - 1, size / 2, &fragment_context); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
IDWriteFontFileStream_Release(stream);
@@ -4482,7 +4479,7 @@ static void test_CreateFontFaceFromHdc(void) IDWriteFontFace_Release(fontface);
ret = RemoveFontMemResourceEx(resource); - ok(ret, "Failed to remove memory resource font, %d.\n", GetLastError()); + ok(ret, "Failed to remove memory resource font, %ld.\n", GetLastError());
UnmapViewOfFile(font_data);
@@ -4492,7 +4489,7 @@ static void test_CreateFontFaceFromHdc(void) DeleteDC(hdc); IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetSimulations(void) @@ -4509,7 +4506,7 @@ static void test_GetSimulations(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -4519,12 +4516,12 @@ static void test_GetSimulations(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
simulations = IDWriteFont_GetSimulations(font); ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations); hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); simulations = IDWriteFontFace_GetSimulations(fontface); ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations); IDWriteFontFace_Release(fontface); @@ -4538,12 +4535,12 @@ static void test_GetSimulations(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
simulations = IDWriteFont_GetSimulations(font); ok(simulations == DWRITE_FONT_SIMULATIONS_NONE, "got %d\n", simulations); hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); simulations = IDWriteFontFace_GetSimulations(fontface); ok(simulations == DWRITE_FONT_SIMULATIONS_NONE, "got %d\n", simulations); IDWriteFontFace_Release(fontface); @@ -4551,7 +4548,7 @@ static void test_GetSimulations(void)
IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetFaceNames(void) @@ -4572,7 +4569,7 @@ static void test_GetFaceNames(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&logfont, 0, sizeof(logfont)); logfont.lfHeight = 12; @@ -4582,13 +4579,13 @@ static void test_GetFaceNames(void) lstrcpyW(logfont.lfFaceName, L"Tahoma");
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &strings); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &strings2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(strings != strings2, "got %p, %p\n", strings2, strings); IDWriteLocalizedStrings_Release(strings2);
@@ -4598,42 +4595,42 @@ static void test_GetFaceNames(void) index = 1; exists = FALSE; hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-Us", &index, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(index == 0 && exists, "got %d, %d\n", index, exists);
count = 0; hr = IDWriteLocalizedStrings_GetLocaleNameLength(strings, 1, &count); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(count == ~0, "got %d\n", count);
/* for simulated faces names are also simulated */ buffW[0] = 0; hr = IDWriteLocalizedStrings_GetLocaleName(strings, 0, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
buffW[0] = 0; hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"Oblique"), "got %s\n", wine_dbgstr_w(buffW)); IDWriteLocalizedStrings_Release(strings);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create a font face, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a font face, hr %#lx.\n", hr);
if (SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3))) { hr = IDWriteFontFace3_GetFaceNames(fontface3, &strings2); - ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr);
hr = IDWriteFontFace3_GetFaceNames(fontface3, &strings3); - ok(hr == S_OK, "Failed to get face names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get face names, hr %#lx.\n", hr); ok(strings2 != strings3, "Unexpected instance.\n"); IDWriteLocalizedStrings_Release(strings3);
buffW[0] = 0; hr = IDWriteLocalizedStrings_GetString(strings2, 0, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "Failed to get a string, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get a string, hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"Oblique"), "Unexpected name %s.\n", wine_dbgstr_w(buffW)); IDWriteLocalizedStrings_Release(strings2);
@@ -4647,7 +4644,7 @@ static void test_GetFaceNames(void) IDWriteFont_Release(font); IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
struct local_refkey @@ -4679,12 +4676,12 @@ static void test_TryGetFontTable(void) factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
key = NULL; size = 0; hr = IDWriteFontFile_GetReferenceKey(file, (const void**)&key, &size); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(size != 0, "got %u\n", size);
ret = GetFileAttributesExW(path, GetFileExInfoStandard, &info); @@ -4692,27 +4689,27 @@ static void test_TryGetFontTable(void) ok(!memcmp(&info.ftLastWriteTime, &key->writetime, sizeof(key->writetime)), "got wrong write time\n");
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader); IDWriteFontFileLoader_Release(loader);
hr = IDWriteLocalFontFileLoader_GetFilePathLengthFromKey(localloader, key, size, &len); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(lstrlenW(key->name) == len, "path length %d\n", len);
hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader, key, size, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, key->name), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(key->name)); IDWriteLocalFontFileLoader_Release(localloader);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, 0, &fontface); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
exists = FALSE; context = (void*)0xdeadbeef; table = NULL; hr = IDWriteFontFace_TryGetFontTable(fontface, MS_CMAP_TAG, &table, &size, &context, &exists); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); ok(exists == TRUE, "got %d\n", exists); ok(context == NULL && table != NULL, "cmap: context %p, table %p\n", context, table);
@@ -4720,7 +4717,7 @@ static void test_TryGetFontTable(void) context2 = (void*)0xdeadbeef; table2 = NULL; hr = IDWriteFontFace_TryGetFontTable(fontface, MS_CMAP_TAG, &table2, &size, &context2, &exists); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); ok(exists == TRUE, "got %d\n", exists); ok(context2 == context && table2 == table, "cmap: context2 %p, table2 %p\n", context2, table2);
@@ -4732,14 +4729,14 @@ static void test_TryGetFontTable(void) context = (void*)0xdeadbeef; table = (void*)0xdeadbeef; hr = IDWriteFontFace_TryGetFontTable(fontface, 0xabababab, &table, &size, &context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists == FALSE, "got %d\n", exists); ok(context == NULL && table == NULL, "got context %p, table pointer %p\n", context, table);
IDWriteFontFace_Release(fontface); IDWriteFontFile_Release(file); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -4761,17 +4758,17 @@ static void test_ConvertFontToLOGFONT(void)
interop = NULL; hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_GetSystemFontCollection(factory2, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (0) { /* crashes on native */ IDWriteGdiInterop_ConvertFontToLOGFONT(interop, NULL, NULL, NULL); @@ -4782,7 +4779,7 @@ if (0) { /* crashes on native */ memset(&logfont, 0xcc, sizeof(logfont)); system = TRUE; hr = IDWriteGdiInterop_ConvertFontToLOGFONT(interop, NULL, &logfont, &system); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(!system, "got %d\n", system); ok(logfont.lfFaceName[0] == 0, "got face name %s\n", wine_dbgstr_w(logfont.lfFaceName));
@@ -4797,10 +4794,10 @@ if (0) { /* crashes on native */ LOGFONTW lf;
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW)); IDWriteLocalizedStrings_Release(names); @@ -4813,10 +4810,10 @@ if (0) { /* crashes on native */ BOOL has_variations;
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW)); IDWriteLocalizedStrings_Release(names); @@ -4826,7 +4823,7 @@ if (0) { /* crashes on native */ lstrcatW(nameW, facenameW);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
has_variations = has_face_variations(fontface); IDWriteFontFace_Release(fontface); @@ -4843,7 +4840,7 @@ if (0) { /* crashes on native */ system = FALSE; memset(&logfont, 0xcc, sizeof(logfont)); hr = IDWriteGdiInterop_ConvertFontToLOGFONT(interop, font, &logfont, &system); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(system, "got %d\n", system);
sim = IDWriteFont_GetSimulations(font); @@ -4851,7 +4848,7 @@ if (0) { /* crashes on native */ winetest_push_context("Font %s", wine_dbgstr_w(nameW));
get_logfont_from_font(font, &lf); - ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %d, expected lfWeight %d, font weight %d, " + ok(logfont.lfWeight == lf.lfWeight, "Unexpected lfWeight %ld, expected lfWeight %ld, font weight %d, " "bold simulation %s.\n", logfont.lfWeight, lf.lfWeight, IDWriteFont_GetWeight(font), sim & DWRITE_FONT_SIMULATIONS_BOLD ? "yes" : "no"); ok(logfont.lfItalic == lf.lfItalic, "Unexpected italic flag %d, oblique simulation %s.\n", @@ -4879,7 +4876,7 @@ if (0) { /* crashes on native */ IDWriteFont_Release(font); IDWriteGdiInterop_Release(interop); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_CreateStreamFromKey(void) @@ -4901,25 +4898,25 @@ static void test_CreateStreamFromKey(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
key = NULL; size = 0; hr = IDWriteFontFile_GetReferenceKey(file, (const void**)&key, &size); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(size != 0, "got %u\n", size);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader); IDWriteFontFileLoader_Release(loader);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(stream, 1);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(stream == stream2 || broken(stream != stream2) /* Win7 SP0 */, "got %p, %p\n", stream, stream2); if (stream == stream2) EXPECT_REF(stream, 2); @@ -4927,12 +4924,12 @@ static void test_CreateStreamFromKey(void) IDWriteFontFileStream_Release(stream2);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(stream, 1);
writetime = 0; hr = IDWriteFontFileStream_GetLastWriteTime(stream, &writetime); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(writetime != 0, "got %s\n", wine_dbgstr_longlong(writetime));
IDWriteFontFileStream_Release(stream); @@ -4940,7 +4937,7 @@ static void test_CreateStreamFromKey(void)
IDWriteLocalFontFileLoader_Release(localloader); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -4964,44 +4961,44 @@ static void test_ReadFileFragment(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
key = NULL; size = 0; hr = IDWriteFontFile_GetReferenceKey(file, (const void**)&key, &size); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(size != 0, "got %u\n", size);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader); IDWriteFontFileLoader_Release(loader);
hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileStream_GetFileSize(stream, &filesize); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* reading past the end of the stream */ fragment = (void*)0xdeadbeef; context = (void*)0xdeadbeef; hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, filesize+1, &context); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr); ok(context == NULL, "got %p\n", context); ok(fragment == NULL, "got %p\n", fragment);
fragment = (void*)0xdeadbeef; context = (void*)0xdeadbeef; hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, filesize, &context); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(context == NULL, "got %p\n", context); ok(fragment != NULL, "got %p\n", fragment);
fragment2 = (void*)0xdeadbeef; context2 = (void*)0xdeadbeef; hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment2, 0, filesize, &context2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(context2 == NULL, "got %p\n", context2); ok(fragment == fragment2, "got %p, %p\n", fragment, fragment2);
@@ -5012,7 +5009,7 @@ static void test_ReadFileFragment(void) fragment = (void*)0xdeadbeef; context = (void*)0xdeadbeef; hr = IDWriteFontFileStream_ReadFileFragment(stream, &fragment, 0, filesize, &context); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(context == NULL, "got %p\n", context); ok(fragment == fragment2, "got %p, %p\n", fragment, fragment2); IDWriteFontFileStream_ReleaseFileFragment(stream, context); @@ -5021,7 +5018,7 @@ static void test_ReadFileFragment(void) IDWriteFontFileStream_Release(stream); IDWriteLocalFontFileLoader_Release(localloader); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -5042,39 +5039,39 @@ static void test_GetDesignGlyphMetrics(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); IDWriteFontFile_Release(file);
codepoint = 'A'; indices[0] = 0; hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, &indices[0]); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(indices[0] > 0, "got %u\n", indices[0]);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, NULL, 0, metrics, FALSE); - ok(hr == E_INVALIDARG, "got 0x%08x\n",hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, NULL, 1, metrics, FALSE); - ok(hr == E_INVALIDARG, "got 0x%08x\n",hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, indices, 0, metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
/* missing glyphs are ignored */ indices[1] = 1; memset(metrics, 0xcc, sizeof(metrics)); hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, indices, 2, metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); ok(metrics[0].advanceWidth == 1000, "got %d\n", metrics[0].advanceWidth); ok(metrics[1].advanceWidth == 0, "got %d\n", metrics[1].advanceWidth);
IDWriteFontFace_Release(fontface); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -5088,7 +5085,7 @@ static BOOL get_expected_is_monospaced(IDWriteFontFace1 *fontface, const DWRITE_
hr = IDWriteFontFace1_TryGetFontTable(fontface, MS_POST_TAG, (const void **)&tt_post, &size, &post_context, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_post) { @@ -5119,7 +5116,7 @@ static void test_IsMonospacedFont(void) }
hr = IDWriteFactory1_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "Failed to get font collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font collection, hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection); for (i = 0; i < count; ++i) @@ -5130,10 +5127,10 @@ static void test_IsMonospacedFont(void) WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "Failed to get names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get names, hr %#lx.\n", hr); get_enus_string(names, nameW, ARRAY_SIZE(nameW)); IDWriteLocalizedStrings_Release(names);
@@ -5149,17 +5146,17 @@ static void test_IsMonospacedFont(void) IDWriteFont *font;
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont1, (void **)&font1); - ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFont1_CreateFontFace(font1, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1); - ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr); IDWriteFontFace_Release(fontface);
is_monospaced_font = IDWriteFont1_IsMonospacedFont(font1); @@ -5181,7 +5178,7 @@ static void test_IsMonospacedFont(void)
IDWriteFontCollection_Release(collection); ref = IDWriteFactory1_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetDesignGlyphAdvances(void) @@ -5199,11 +5196,11 @@ static void test_GetDesignGlyphAdvances(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); @@ -5215,17 +5212,17 @@ static void test_GetDesignGlyphAdvances(void) codepoint = 'A'; index = 0; hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &codepoint, 1, &index); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(index > 0, "got %u\n", index);
advance = 0; hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, &index, &advance, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advance == 1000, "got %i\n", advance);
advance = 0; hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, &index, &advance, TRUE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); todo_wine ok(advance == 2048, "got %i\n", advance);
@@ -5236,7 +5233,7 @@ static void test_GetDesignGlyphAdvances(void)
IDWriteFontFace_Release(fontface); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -5257,24 +5254,24 @@ static void test_GetGlyphRunOutline(void) factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &face); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
codepoint = 'A'; glyphs[0] = 0; hr = IDWriteFontFace_GetGlyphIndices(face, &codepoint, 1, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyphs[0] > 0, "got %u\n", glyphs[0]); glyphs[1] = glyphs[0];
hr = IDWriteFontFace_GetGlyphRunOutline(face, 2048.0, glyphs, advances, offsets, 1, FALSE, FALSE, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGlyphRunOutline(face, 2048.0, NULL, NULL, offsets, 1, FALSE, FALSE, &test_geomsink); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
advances[0] = 1.0; advances[1] = 0.0; @@ -5289,7 +5286,7 @@ static void test_GetGlyphRunOutline(void) g_startpoint_count = 0; SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 2, FALSE, FALSE, &test_geomsink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); if (g_startpoint_count == 2) { /* glyph advance of 500 is applied */ @@ -5303,7 +5300,7 @@ static void test_GetGlyphRunOutline(void) g_startpoint_count = 0; SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 2, FALSE, TRUE, &test_geomsink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); if (g_startpoint_count == 2) { /* advance is -500 now */ @@ -5317,7 +5314,7 @@ static void test_GetGlyphRunOutline(void) g_startpoint_count = 0; SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, offsets, 2, FALSE, FALSE, &test_geomsink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); if (g_startpoint_count == 2) { /* offsets applied to first contour */ @@ -5331,7 +5328,7 @@ static void test_GetGlyphRunOutline(void) g_startpoint_count = 0; SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, offsets, 2, FALSE, TRUE, &test_geomsink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); if (g_startpoint_count == 2) { ok(g_startpoints[0].x == -271.5 && g_startpoints[0].y == -630.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y); @@ -5344,7 +5341,7 @@ static void test_GetGlyphRunOutline(void) g_startpoint_count = 0; SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, advances, offsets, 2, FALSE, FALSE, &test_geomsink); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(g_startpoint_count == 2, "got %d\n", g_startpoint_count); if (g_startpoint_count == 2) { ok(g_startpoints[0].x == 230.5 && g_startpoints[0].y == -630.0, "0: got (%.2f,%.2f)\n", g_startpoints[0].x, g_startpoints[0].y); @@ -5354,18 +5351,18 @@ static void test_GetGlyphRunOutline(void)
/* 0 glyph count */ hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 0, FALSE, FALSE, &test_geomsink2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Glyph with open figure, single contour point. */ codepoint = 'B'; glyphs[0] = 0; hr = IDWriteFontFace_GetGlyphIndices(face, &codepoint, 1, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyphs[0] > 0, "got %u\n", glyphs[0]);
SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 1, FALSE, FALSE, &test_geomsink2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); CHECK_CALLED(setfillmode);
IDWriteFactory_Release(factory); @@ -5379,17 +5376,17 @@ static void test_GetGlyphRunOutline(void) codepoint = ' '; glyphs[0] = 0; hr = IDWriteFontFace_GetGlyphIndices(face, &codepoint, 1, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyphs[0] > 0, "got %u\n", glyphs[0]);
SET_EXPECT(setfillmode); hr = IDWriteFontFace_GetGlyphRunOutline(face, 1024.0, glyphs, NULL, NULL, 1, FALSE, FALSE, &test_geomsink2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); CHECK_CALLED(setfillmode);
IDWriteFontFace_Release(face); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetEudcFontCollection(void) @@ -5407,17 +5404,17 @@ static void test_GetEudcFontCollection(void)
EXPECT_REF(factory, 1); hr = IDWriteFactory1_GetEudcFontCollection(factory, &coll, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(factory, 2); hr = IDWriteFactory1_GetEudcFontCollection(factory, &coll2, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(factory, 2); ok(coll == coll2, "got %p, %p\n", coll, coll2); IDWriteFontCollection_Release(coll); IDWriteFontCollection_Release(coll2);
ref = IDWriteFactory1_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_GetCaretMetrics(void) @@ -5437,10 +5434,10 @@ static void test_GetCaretMetrics(void) factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); @@ -5448,7 +5445,7 @@ static void test_GetCaretMetrics(void) if (hr != S_OK) { win_skip("GetCaretMetrics() is not supported.\n"); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); return; } @@ -5465,10 +5462,10 @@ static void test_GetCaretMetrics(void) factory = create_factory(); font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_NORMAL); hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font); hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFace_Release(fontface);
memset(&caret, 0xcc, sizeof(caret)); @@ -5481,10 +5478,10 @@ static void test_GetCaretMetrics(void) /* simulated italic */ font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_ITALIC); hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font); hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFace_Release(fontface);
IDWriteFontFace1_GetMetrics(fontface1, &metrics); @@ -5497,7 +5494,7 @@ static void test_GetCaretMetrics(void) IDWriteFontFace1_Release(fontface1);
ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -5515,10 +5512,10 @@ static void test_GetGlyphCount(void) factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
count = IDWriteFontFace_GetGlyphCount(fontface); @@ -5526,7 +5523,7 @@ static void test_GetGlyphCount(void)
IDWriteFontFace_Release(fontface); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -5544,10 +5541,10 @@ static void test_GetKerningPairAdjustments(void) factory = create_factory();
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); @@ -5555,14 +5552,14 @@ static void test_GetKerningPairAdjustments(void) INT32 adjustments[1];
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 0, NULL, NULL); - ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */ hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1, NULL, NULL);
adjustments[0] = 1; hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1, NULL, adjustments); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(adjustments[0] == 0, "got %d\n", adjustments[0]);
IDWriteFontFace1_Release(fontface1); @@ -5572,7 +5569,7 @@ static void test_GetKerningPairAdjustments(void)
IDWriteFontFace_Release(fontface); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -5591,7 +5588,7 @@ static void test_CreateRenderingParams(void)
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 1.0, 0.0, 0.0, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_DEFAULT, ¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteRenderingParams_QueryInterface(params, &IID_IDWriteRenderingParams1, (void**)¶ms1); if (hr == S_OK) { @@ -5621,7 +5618,7 @@ static void test_CreateRenderingParams(void) IDWriteRenderingParams_Release(params);
hr = IDWriteFactory_CreateRenderingParams(factory, ¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = IDWriteRenderingParams_GetRenderingMode(params); ok(mode == DWRITE_RENDERING_MODE_DEFAULT, "got %d\n", mode); @@ -5633,10 +5630,10 @@ static void test_CreateRenderingParams(void)
hr = IDWriteFactory3_CreateCustomRenderingParams(factory3, 1.0f, 0.0f, 0.0f, 1.0f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED, DWRITE_GRID_FIT_MODE_DEFAULT, ¶ms3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams, (void**)¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = IDWriteRenderingParams_GetRenderingMode(params); ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode); @@ -5649,7 +5646,7 @@ static void test_CreateRenderingParams(void) win_skip("IDWriteRenderingParams3 not supported.\n");
ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_CreateGlyphRunAnalysis(void) @@ -5689,11 +5686,11 @@ static void test_CreateGlyphRunAnalysis(void) ch = 'A'; glyph = 0; hr = IDWriteFontFace_GetGlyphIndices(face, &ch, 1, &glyph); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyph > 0, "got %u\n", glyph);
hr = IDWriteFontFace_GetDesignGlyphMetrics(face, &glyph, 1, &metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); advances[0] = metrics.advanceWidth;
offsets[0].advanceOffset = 0.0; @@ -5713,7 +5710,7 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 0.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(analysis == NULL, "got %p\n", analysis);
/* negative ppdip */ @@ -5721,7 +5718,7 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, -1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(analysis == NULL, "got %p\n", analysis);
/* default mode is not allowed */ @@ -5729,7 +5726,7 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_DEFAULT, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(analysis == NULL, "got %p\n", analysis);
/* outline too */ @@ -5737,25 +5734,25 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_OUTLINE, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(analysis == NULL, "got %p\n", analysis);
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid texture type */ memset(&rect, 0xcc, sizeof(rect)); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1+1, &rect); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(rect.left == 0 && rect.right == 0 && rect.top == 0 && rect.bottom == 0, "unexpected rect\n");
/* check how origin affects bounds */ SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&rect), "got empty rect\n"); IDWriteGlyphRunAnalysis_Release(analysis);
@@ -5763,10 +5760,10 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 2.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); SetRectEmpty(&rect2); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(rect.right - rect.left < rect2.right - rect2.left, "expected wider rect\n"); ok(rect.bottom - rect.top < rect2.bottom - rect2.top, "expected taller rect\n"); IDWriteGlyphRunAnalysis_Release(analysis); @@ -5774,11 +5771,11 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 10.0, -5.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect2); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&rect2), "got empty rect\n"); IDWriteGlyphRunAnalysis_Release(analysis);
@@ -5790,28 +5787,28 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, rendermodes[i], DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (rendermodes[i] == DWRITE_RENDERING_MODE_ALIASED) { SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&rect), "got empty rect\n");
SetRect(&rect, 0, 0, 1, 1); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(IsRectEmpty(&rect), "unexpected empty rect\n"); } else { SetRect(&rect, 0, 0, 1, 1); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(IsRectEmpty(&rect), "got empty rect\n");
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&rect), "got empty rect\n"); }
@@ -5828,15 +5825,15 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(run.fontFace, run.fontEmSize, 1.0, NULL, DWRITE_MEASURING_MODE_GDI_CLASSIC, run.glyphIndices, 1, &gm, run.isSideways); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* metrics are in design units */ bboxX = (int)floorf((gm.advanceWidth - gm.leftSideBearing - gm.rightSideBearing) * run.fontEmSize / fm.designUnitsPerEm + 0.5f); @@ -5844,8 +5841,8 @@ static void test_CreateGlyphRunAnalysis(void)
rect.right -= rect.left; rect.bottom -= rect.top; - ok(abs(bboxX - rect.right) <= 2, "%.0f: bbox width %d, from metrics %d\n", run.fontEmSize, rect.right, bboxX); - ok(abs(bboxY - rect.bottom) <= 2, "%.0f: bbox height %d, from metrics %d\n", run.fontEmSize, rect.bottom, bboxY); + ok(abs(bboxX - rect.right) <= 2, "%.0f: bbox width %ld, from metrics %ld\n", run.fontEmSize, rect.right, bboxX); + ok(abs(bboxY - rect.bottom) <= 2, "%.0f: bbox height %ld, from metrics %ld\n", run.fontEmSize, rect.bottom, bboxY);
IDWriteGlyphRunAnalysis_Release(analysis); } @@ -5863,11 +5860,11 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&rect), "got empty bounds\n");
IDWriteGlyphRunAnalysis_Release(analysis); @@ -5885,11 +5882,11 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&rect), "got empty bounds\n");
IDWriteGlyphRunAnalysis_Release(analysis); @@ -5909,37 +5906,37 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect2); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&rect2), "got empty bounds\n"); ok(!EqualRect(&rect, &rect2), "got wrong rect2\n"); - ok((rect2.right - rect.left) > advances[0], "got rect width %d for advance %f\n", rect.right - rect.left, advances[0]); + ok((rect2.right - rect.left) > advances[0], "got rect width %ld for advance %f\n", rect.right - rect.left, advances[0]); IDWriteGlyphRunAnalysis_Release(analysis);
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 2.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok((rect.right - rect.left) > 2 * advances[0], "got rect width %d for advance %f\n", rect.right - rect.left, advances[0]); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok((rect.right - rect.left) > 2 * advances[0], "got rect width %ld for advance %f\n", rect.right - rect.left, advances[0]); IDWriteGlyphRunAnalysis_Release(analysis);
/* with scaling transform */ hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(!IsRectEmpty(&rect), "got rect width %d\n", rect.right - rect.left); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!IsRectEmpty(&rect), "got rect width %ld\n", rect.right - rect.left); IDWriteGlyphRunAnalysis_Release(analysis);
memset(&m, 0, sizeof(m)); @@ -5948,18 +5945,18 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, &m, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&rect2); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok((rect2.right - rect2.left) > (rect.right - rect.left), "got rect width %d\n", rect2.right - rect2.left); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok((rect2.right - rect2.left) > (rect.right - rect.left), "got rect width %ld\n", rect2.right - rect2.left);
/* instances are not reused for same runs */ hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, &m, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(analysis2 != analysis, "got %p, previous instance %p\n", analysis2, analysis); IDWriteGlyphRunAnalysis_Release(analysis2);
@@ -5972,31 +5969,31 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE + 1, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid grid fit mode. */ hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED + 1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid rendering mode. */ hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_OUTLINE, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid measuring mode. */ hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_GDI_NATURAL + 1, DWRITE_GRID_FIT_MODE_ENABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Win8 does not accept default grid fitting mode. */ hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_NATURAL, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == S_OK || broken(hr == E_INVALIDARG) /* Win8 */, "Failed to create analysis, hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* Win8 */, "Failed to create analysis, hr %#lx.\n", hr); if (hr == S_OK) IDWriteGlyphRunAnalysis_Release(analysis);
@@ -6004,42 +6001,42 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory2_CreateGlyphRunAnalysis(factory2, &run, NULL, DWRITE_RENDERING_MODE_NATURAL, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DISABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == S_OK, "Failed to create analysis, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create analysis, hr %#lx.\n", hr);
SetRect(&rect, 0, 1, 0, 1); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); - ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr); ok(IsRectEmpty(&rect), "Expected empty bbox.\n");
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr); ok(!IsRectEmpty(&rect), "Unexpected empty bbox.\n");
size = (rect.right - rect.left) * (rect.bottom - rect.top); bits = malloc(size);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size); - ok(hr == S_OK, "Failed to get alpha texture, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get alpha texture, hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size - 1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size); - ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size - 1); todo_wine - ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
free(bits);
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 0.1f, 0.0f, 1.0f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_NATURAL, ¶ms); - ok(hr == S_OK, "Failed to create custom parameters, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create custom parameters, hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, params, &gamma, &contrast, &cleartype_level); - ok(hr == S_OK, "Failed to get alpha blend params, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get alpha blend params, hr %#lx.\n", hr); todo_wine ok(cleartype_level == 0.0f, "Unexpected cleartype level %f.\n", cleartype_level);
@@ -6055,63 +6052,63 @@ static void test_CreateGlyphRunAnalysis(void) hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_ALIASED, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE + 1, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid grid fit mode. */ hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_ALIASED, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED + 1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid rendering mode. */ hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_OUTLINE, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_ENABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Invalid measuring mode. */ hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_ALIASED, DWRITE_MEASURING_MODE_GDI_NATURAL + 1, DWRITE_GRID_FIT_MODE_ENABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_NATURAL, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == S_OK, "Failed to create analysis, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create analysis, hr %#lx.\n", hr); IDWriteGlyphRunAnalysis_Release(analysis);
/* Natural mode, grayscale antialiased. */ hr = IDWriteFactory3_CreateGlyphRunAnalysis(factory3, &run, NULL, DWRITE_RENDERING_MODE1_NATURAL, DWRITE_MEASURING_MODE_NATURAL, DWRITE_GRID_FIT_MODE_DISABLED, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis); - ok(hr == S_OK, "Failed to create analysis, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create analysis, hr %#lx.\n", hr);
SetRect(&rect, 0, 1, 0, 1); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect); - ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr); ok(IsRectEmpty(&rect), "Expected empty bbox.\n");
SetRectEmpty(&rect); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); - ok(hr == S_OK, "Failed to get texture bounds, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get texture bounds, hr %#lx.\n", hr); ok(!IsRectEmpty(&rect), "Unexpected empty bbox.\n");
size = (rect.right - rect.left) * (rect.bottom - rect.top); bits = malloc(size);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size); - ok(hr == S_OK, "Failed to get alpha texture, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get alpha texture, hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect, bits, size - 1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size); - ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &rect, bits, size - 1); todo_wine - ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_UNSUPPORTEDOPERATION, "Unexpected hr %#lx.\n", hr);
free(bits);
@@ -6122,7 +6119,7 @@ static void test_CreateGlyphRunAnalysis(void)
IDWriteFontFace_Release(face); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
#define round(x) ((int)floor((x) + 0.5)) @@ -6312,7 +6309,7 @@ static void get_expected_metrics(IDWriteFontFace *fontface, struct compatmetrics
memset(expected, 0, sizeof(*expected)); hr = IDWriteFontFace_GetGdiCompatibleMetrics(fontface, ptr->ppdip * fabsf(ptr->m.m22) * ptr->emsize, 1.0, NULL, expected); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); }
static void test_gdicompat_metrics(IDWriteFontFace *face) @@ -6352,26 +6349,26 @@ static void test_gdicompat_metrics(IDWriteFontFace *face) memset(&comp_metrics, 0xcc, sizeof(comp_metrics)); memset(&expected, 0, sizeof(expected)); hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, -10.0, 1.0, NULL, &comp_metrics); - ok(hr == E_INVALIDARG, "got %08x\n", hr); + ok(hr == E_INVALIDARG, "got %08lx\n", hr); test_metrics_cmp(0.0, &comp_metrics, &expected);
/* zero emsize */ memset(&comp_metrics, 0xcc, sizeof(comp_metrics)); memset(&expected, 0, sizeof(expected)); hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 0.0, 1.0, NULL, &comp_metrics); - ok(hr == E_INVALIDARG, "got %08x\n", hr); + ok(hr == E_INVALIDARG, "got %08lx\n", hr); test_metrics_cmp(0.0, &comp_metrics, &expected);
/* zero pixels per dip */ memset(&comp_metrics, 0xcc, sizeof(comp_metrics)); memset(&expected, 0, sizeof(expected)); hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, 0.0, NULL, &comp_metrics); - ok(hr == E_INVALIDARG, "got %08x\n", hr); + ok(hr == E_INVALIDARG, "got %08lx\n", hr); test_metrics_cmp(5.0, &comp_metrics, &expected);
memset(&comp_metrics, 0xcc, sizeof(comp_metrics)); hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, 5.0, -1.0, NULL, &comp_metrics); - ok(hr == E_INVALIDARG, "got %08x\n", hr); + ok(hr == E_INVALIDARG, "got %08lx\n", hr); test_metrics_cmp(5.0, &comp_metrics, &expected);
for (i = 0; i < ARRAY_SIZE(compatmetrics_tests); i++) { @@ -6379,7 +6376,7 @@ static void test_gdicompat_metrics(IDWriteFontFace *face)
get_expected_metrics(face, ptr, (DWRITE_FONT_METRICS*)&expected); hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, ptr->emsize, ptr->ppdip, &ptr->m, &comp_metrics); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); test_metrics_cmp(ptr->emsize, &comp_metrics, &expected); }
@@ -6389,11 +6386,11 @@ static void test_gdicompat_metrics(IDWriteFontFace *face)
if (fontface1) { hr = IDWriteFontFace1_GetGdiCompatibleMetrics(fontface1, emsize, 1.0, NULL, &comp_metrics1); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); } else { hr = IDWriteFontFace_GetGdiCompatibleMetrics(face, emsize, 1.0, NULL, &comp_metrics); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); }
scale = emsize / design_metrics.designUnitsPerEm; @@ -6458,7 +6455,7 @@ static void test_GetGdiCompatibleMetrics(void)
font = get_font(factory, L"Tahoma", DWRITE_FONT_STYLE_NORMAL); hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font); test_gdicompat_metrics(fontface); IDWriteFontFace_Release(fontface); @@ -6469,7 +6466,7 @@ static void test_GetGdiCompatibleMetrics(void) else { hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
test_gdicompat_metrics(fontface); @@ -6477,7 +6474,7 @@ static void test_GetGdiCompatibleMetrics(void) }
ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void get_expected_panose(IDWriteFont1 *font, DWRITE_PANOSE *panose) @@ -6492,10 +6489,10 @@ static void get_expected_panose(IDWriteFont1 *font, DWRITE_PANOSE *panose) memset(panose, 0, sizeof(*panose));
hr = IDWriteFont1_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_os2) { memcpy(panose, &tt_os2->panose, sizeof(*panose)); @@ -6523,14 +6520,14 @@ static void test_GetPanose(void)
if (FAILED(hr)) { ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); win_skip("GetPanose() is not supported.\n"); return; } IDWriteFont1_Release(font1);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) { @@ -6544,18 +6541,18 @@ static void test_GetPanose(void) WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont1, (void **)&font1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
@@ -6590,7 +6587,7 @@ static void test_GetPanose(void) winetest_pop_context();
hr = IDWriteFont1_CreateFontFace(font1, &fontface); - ok(hr == S_OK, "Failed to create a font face, %#x.\n", hr); + ok(hr == S_OK, "Failed to create a font face, %#lx.\n", hr); if (IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)&fontface3) == S_OK) { ok(!memcmp(&panose, &expected_panose, sizeof(panose)), "%s: Unexpected panose from font face.\n", wine_dbgstr_w(nameW)); @@ -6604,7 +6601,7 @@ static void test_GetPanose(void)
IDWriteFontCollection_Release(syscollection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static INT32 get_gdi_font_advance(HDC hdc, FLOAT emsize) @@ -6650,7 +6647,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void) font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_NORMAL);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1); @@ -6658,7 +6655,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void)
if (hr != S_OK) { ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); win_skip("GetGdiCompatibleGlyphAdvances() is not supported\n"); return; } @@ -6666,35 +6663,35 @@ static void test_GetGdiCompatibleGlyphAdvances(void) codepoint = 'A'; glyph = 0; hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &codepoint, 1, &glyph); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyph > 0, "got %u\n", glyph);
/* zero emsize */ advance = 1; hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 0.0, 1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(advance == 0, "got %d\n", advance);
/* negative emsize */ advance = 1; hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, -1.0, 1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(advance == 0, "got %d\n", advance);
/* zero ppdip */ advance = 1; hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0, 0.0, NULL, FALSE, FALSE, 1, &glyph, &advance); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(advance == 0, "got %d\n", advance);
/* negative ppdip */ advance = 1; hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0, -1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(advance == 0, "got %d\n", advance);
IDWriteFontFace1_GetMetrics(fontface1, &fm); @@ -6707,7 +6704,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void) gdi_advance = get_gdi_font_advance(hdc, emsize); hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, emsize, 1.0, NULL, FALSE, FALSE, 1, &glyph, &advance); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* advance is in design units */ advance = (int)floorf(emsize * advance / fm.designUnitsPerEm + 0.5f); @@ -6718,7 +6715,7 @@ static void test_GetGdiCompatibleGlyphAdvances(void)
IDWriteFontFace1_Release(fontface1); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize, FLOAT ppdip) @@ -6736,7 +6733,7 @@ static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize, FLOAT ppdip) exists = FALSE; hr = IDWriteFontFace_TryGetFontTable(fontface, MS_GASP_TAG, (const void**)&ptr, &size, &ctxt, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists) goto done; @@ -6878,11 +6875,11 @@ static void test_GetRecommendedRenderingMode(void) mode = 10; hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0, DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, &mode); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(mode == DWRITE_RENDERING_MODE_DEFAULT, "got %d\n", mode);
hr = IDWriteFactory_CreateRenderingParams(factory, ¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* detect old dwrite version, that is using higher threshold value */ g_is_vista = fontface1 == NULL; @@ -6905,7 +6902,7 @@ static void test_GetRecommendedRenderingMode(void) gasp = get_gasp_flags(fontface, emsize, ppdip); expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected);
/* some ppdip variants */ @@ -6914,7 +6911,7 @@ static void test_GetRecommendedRenderingMode(void) gasp = get_gasp_flags(fontface, emsize, ppdip); expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected);
/* Only test larger sizes to workaround Win7 differences, where unscaled natural emsize threshold is used; @@ -6926,7 +6923,7 @@ static void test_GetRecommendedRenderingMode(void) gasp = get_gasp_flags(fontface, emsize, ppdip); expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected);
ppdip = 2.0f; @@ -6934,7 +6931,7 @@ static void test_GetRecommendedRenderingMode(void) gasp = get_gasp_flags(fontface, emsize, ppdip); expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, ppdip %f, flags 0x%04x, expected %d.\n", mode, ppdip, gasp, expected); }
@@ -6957,7 +6954,7 @@ static void test_GetRecommendedRenderingMode(void) expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
/* Only test larger sizes to workaround Win7 differences, where unscaled natural emsize threshold is used; @@ -6971,7 +6968,7 @@ static void test_GetRecommendedRenderingMode(void) expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 0.5f; @@ -6981,7 +6978,7 @@ static void test_GetRecommendedRenderingMode(void) expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
/* try different dpis for X and Y direction */ @@ -6992,7 +6989,7 @@ static void test_GetRecommendedRenderingMode(void) expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi * 0.5f, dpi, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 1.0f; @@ -7002,7 +6999,7 @@ static void test_GetRecommendedRenderingMode(void) expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi * 0.5f, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 2.0f; @@ -7012,7 +7009,7 @@ static void test_GetRecommendedRenderingMode(void) expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi * 0.5f, dpi, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected);
ppdip = 2.0f; @@ -7022,7 +7019,7 @@ static void test_GetRecommendedRenderingMode(void) expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi * 0.5f, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, dpi %f, flags 0x%04x, expected %d.\n", mode, dpi, gasp, expected); }
@@ -7044,7 +7041,7 @@ static void test_GetRecommendedRenderingMode(void) expected_gridfit = get_expected_gridfit_mode(emsize, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, emsize, 96.0f, 96.0f, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, params, &mode, &gridfit); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == expected, "got %d, flags 0x%04x, expected %d.\n", mode, gasp, expected); ok(gridfit == expected_gridfit, "gridfit: got %d, flags 0x%04x, expected %d.\n", gridfit, gasp, expected_gridfit);
@@ -7067,7 +7064,7 @@ static void test_GetRecommendedRenderingMode(void) expected_gridfit = get_expected_gridfit_mode(emsize, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); hr = IDWriteFontFace3_GetRecommendedRenderingMode(fontface3, emsize, 96.0f, 96.0f, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, params, &mode1, &gridfit); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode1 == expected1, "got %d, flags 0x%04x, expected %d.\n", mode1, gasp, expected1); ok(gridfit == expected_gridfit, "gridfit: got %d, flags 0x%04x, expected %d.\n", gridfit, gasp, expected_gridfit);
@@ -7083,11 +7080,11 @@ static void test_GetRecommendedRenderingMode(void) /* test how parameters override returned modes */ hr = IDWriteFactory_CreateCustomRenderingParams(factory, 1.0, 0.0, 0.0, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_GDI_CLASSIC, ¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = 10; hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 500.0, 1.0, DWRITE_MEASURING_MODE_NATURAL, params, &mode); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode);
IDWriteRenderingParams_Release(params); @@ -7098,18 +7095,18 @@ static void test_GetRecommendedRenderingMode(void) DWRITE_GRID_FIT_MODE gridfit;
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory2, (void**)&factory2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory2_CreateCustomRenderingParams(factory2, 1.0, 0.0, 0.0, 0.5, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_OUTLINE, DWRITE_GRID_FIT_MODE_ENABLED, ¶ms2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = 10; gridfit = 10; hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0, NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, &mode, &gridfit); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode); ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7118,7 +7115,7 @@ static void test_GetRecommendedRenderingMode(void) hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0, NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, (IDWriteRenderingParams*)params2, &mode, &gridfit); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == DWRITE_RENDERING_MODE_OUTLINE, "got %d\n", mode); ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7135,11 +7132,11 @@ static void test_GetRecommendedRenderingMode(void) DWRITE_RENDERING_MODE1 mode1;
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void**)&factory3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory3_CreateCustomRenderingParams(factory3, 1.0f, 0.0f, 0.0f, 0.5f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED, DWRITE_GRID_FIT_MODE_ENABLED, ¶ms3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode1 = IDWriteRenderingParams3_GetRenderingMode1(params3); ok(mode1 == DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED, "got %d\n", mode1); @@ -7148,14 +7145,14 @@ static void test_GetRecommendedRenderingMode(void) ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode);
hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams, (void**)¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(params == (IDWriteRenderingParams*)params3, "got %p, %p\n", params3, params); mode = IDWriteRenderingParams_GetRenderingMode(params); ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode); IDWriteRenderingParams_Release(params);
hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams2, (void**)¶ms2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(params2 == (IDWriteRenderingParams2*)params3, "got %p, %p\n", params3, params2); mode = IDWriteRenderingParams2_GetRenderingMode(params2); ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode); @@ -7166,7 +7163,7 @@ static void test_GetRecommendedRenderingMode(void) hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0f, 96.0f, 96.0f, NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, &mode, &gridfit); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == DWRITE_RENDERING_MODE_GDI_CLASSIC, "got %d\n", mode); ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7175,7 +7172,7 @@ static void test_GetRecommendedRenderingMode(void) hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0f, 96.0f, 96.0f, NULL, FALSE, DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, (IDWriteRenderingParams*)params3, &mode, &gridfit); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, "got %d\n", mode); ok(gridfit == DWRITE_GRID_FIT_MODE_ENABLED, "got %d\n", gridfit);
@@ -7191,7 +7188,7 @@ static void test_GetRecommendedRenderingMode(void) IDWriteFontFace1_Release(fontface1); IDWriteFontFace_Release(fontface); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static inline BOOL float_eq(FLOAT left, FLOAT right) @@ -7239,11 +7236,11 @@ static void test_GetAlphaBlendParams(void) ch = 'A'; glyph = 0; hr = IDWriteFontFace_GetGlyphIndices(fontface, &ch, 1, &glyph); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyph > 0, "got %u\n", glyph);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, &glyph, 1, &metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); advance = metrics.advanceWidth;
offset.advanceOffset = 0.0; @@ -7260,7 +7257,7 @@ static void test_GetAlphaBlendParams(void)
hr = IDWriteFactory_CreateCustomRenderingParams(factory, 0.9, 0.3, 0.1, DWRITE_PIXEL_GEOMETRY_RGB, DWRITE_RENDERING_MODE_DEFAULT, ¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0; ret = SystemParametersInfoW(SPI_GETFONTSMOOTHINGCONTRAST, 0, &value, 0); @@ -7271,18 +7268,18 @@ static void test_GetAlphaBlendParams(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, rendermodes[i], DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
gamma = contrast = ctlevel = -1.0; hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, NULL, &gamma, &contrast, &ctlevel); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(gamma == -1.0, "got %.2f\n", gamma); ok(contrast == -1.0, "got %.2f\n", contrast); ok(ctlevel == -1.0, "got %.2f\n", ctlevel);
gamma = contrast = ctlevel = -1.0; hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, params, &gamma, &contrast, &ctlevel); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (rendermodes[i] == DWRITE_RENDERING_MODE_GDI_CLASSIC || rendermodes[i] == DWRITE_RENDERING_MODE_GDI_NATURAL) { ok(float_eq(gamma, expected_gdi_gamma), "got %.2f, expected %.2f\n", gamma, expected_gdi_gamma); @@ -7301,7 +7298,7 @@ static void test_GetAlphaBlendParams(void) IDWriteRenderingParams_Release(params); IDWriteFontFace_Release(fontface); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_CreateAlphaTexture(void) @@ -7326,11 +7323,11 @@ static void test_CreateAlphaTexture(void) ch = 'A'; glyph = 0; hr = IDWriteFontFace_GetGlyphIndices(fontface, &ch, 1, &glyph); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyph > 0, "got %u\n", glyph);
hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, &glyph, 1, &metrics, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); advance = metrics.advanceWidth;
offset.advanceOffset = 0.0; @@ -7348,11 +7345,11 @@ static void test_CreateAlphaTexture(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_NATURAL, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&bounds); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &bounds); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&bounds), "got empty rect\n"); size = (bounds.right - bounds.left)*(bounds.bottom - bounds.top)*3; ok(sizeof(buff) >= size, "required %u\n", size); @@ -7360,23 +7357,23 @@ static void test_CreateAlphaTexture(void) /* invalid type value */ memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1+1, &bounds, buff, sizeof(buff)); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds, buff, 2); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* vista version allows texture type mismatch, mark it broken for now */ memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds, buff, sizeof(buff)); - ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "got 0x%08x\n", hr); + ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf || broken(buff[0] == 0), "got %1x\n", buff[0]);
memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &bounds, buff, size-1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
IDWriteGlyphRunAnalysis_Release(analysis); @@ -7384,32 +7381,32 @@ static void test_CreateAlphaTexture(void) hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_GDI_CLASSIC, 0.0, 0.0, &analysis); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRectEmpty(&bounds); hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!IsRectEmpty(&bounds), "got empty rect\n"); size = (bounds.right - bounds.left)*(bounds.bottom - bounds.top); ok(sizeof(buff) >= size, "required %u\n", size);
memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, NULL, buff, sizeof(buff)); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, NULL, NULL, sizeof(buff)); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, NULL, buff, 0); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* buffer size is not enough */ memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds, buff, size-1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* request texture for rectangle that doesn't intersect */ @@ -7417,14 +7414,14 @@ static void test_CreateAlphaTexture(void) r = bounds; OffsetRect(&r, (bounds.right - bounds.left)*2, 0); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &r, buff, sizeof(buff)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0, "got %1x\n", buff[0]);
memset(buff, 0xcf, sizeof(buff)); r = bounds; OffsetRect(&r, (bounds.right - bounds.left)*2, 0); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &r, buff, sizeof(buff)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0, "got %1x\n", buff[0]);
/* request texture for rectangle that doesn't intersect, small buffer */ @@ -7432,19 +7429,19 @@ static void test_CreateAlphaTexture(void) r = bounds; OffsetRect(&r, (bounds.right - bounds.left)*2, 0); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_ALIASED_1x1, &r, buff, size-1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf, "got %1x\n", buff[0]);
/* vista version allows texture type mismatch, mark it broken for now */ memset(buff, 0xcf, sizeof(buff)); hr = IDWriteGlyphRunAnalysis_CreateAlphaTexture(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &bounds, buff, sizeof(buff)); - ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "got 0x%08x\n", hr); + ok(hr == DWRITE_E_UNSUPPORTEDOPERATION || broken(hr == S_OK), "Unexpected hr %#lx.\n", hr); ok(buff[0] == 0xcf || broken(buff[0] == 0), "got %1x\n", buff[0]);
IDWriteGlyphRunAnalysis_Release(analysis); IDWriteFontFace_Release(fontface); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static BOOL get_expected_is_symbol(IDWriteFontFace *fontface) @@ -7460,7 +7457,7 @@ static BOOL get_expected_is_symbol(IDWriteFontFace *fontface) HRESULT hr;
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists); - ok(hr == S_OK, "Failed to get OS/2 table, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get OS/2 table, hr %#lx.\n", hr);
if (tt_os2) { @@ -7512,7 +7509,7 @@ static void test_IsSymbolFont(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection); for (i = 0; i < count; ++i) @@ -7523,10 +7520,10 @@ static void test_IsSymbolFont(void) WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "Failed to get names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get names, hr %#lx.\n", hr); get_enus_string(names, nameW, ARRAY_SIZE(nameW)); IDWriteLocalizedStrings_Release(names);
@@ -7537,10 +7534,10 @@ static void test_IsSymbolFont(void) BOOL is_symbol_font, is_symbol_face, is_symbol_expected;
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
is_symbol_font = IDWriteFont_IsSymbolFont(font); is_symbol_face = IDWriteFontFace_IsSymbolFont(fontface); @@ -7560,7 +7557,7 @@ static void test_IsSymbolFont(void) IDWriteFontCollection_Release(collection);
ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
struct CPAL_Header_0 @@ -7595,30 +7592,30 @@ static void test_GetPaletteEntries(void) IDWriteFontFace_Release(fontface); if (hr != S_OK) { ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); win_skip("GetPaletteEntries() is not supported.\n"); return; }
hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, 0, 1, &color); - ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr); IDWriteFontFace2_Release(fontface2);
/* Segoe UI Emoji, with color support */ font = get_font(factory, L"Segoe UI Emoji", DWRITE_FONT_STYLE_NORMAL); if (!font) { ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); skip("Segoe UI Emoji font not found.\n"); return; }
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFace_Release(fontface);
palettecount = IDWriteFontFace2_GetColorPaletteCount(fontface2); @@ -7629,7 +7626,7 @@ static void test_GetPaletteEntries(void)
exists = FALSE; hr = IDWriteFontFace2_TryGetFontTable(fontface2, MS_CPAL_TAG, (const void**)&cpal_header, &size, &ctxt, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists, "got %d\n", exists); colorrecords = GET_BE_WORD(cpal_header->numColorRecords); ok(colorrecords >= 1, "got %u\n", colorrecords); @@ -7637,33 +7634,33 @@ static void test_GetPaletteEntries(void) /* invalid palette index */ color.r = color.g = color.b = color.a = 123.0; hr = IDWriteFontFace2_GetPaletteEntries(fontface2, palettecount, 0, 1, &color); - ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr); ok(color.r == 123.0 && color.g == 123.0 && color.b == 123.0 && color.a == 123.0, "got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
/* invalid entry index */ color.r = color.g = color.b = color.a = 123.0; hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, entrycount, 1, &color); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(color.r == 123.0 && color.g == 123.0 && color.b == 123.0 && color.a == 123.0, "got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
color.r = color.g = color.b = color.a = 123.0; hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, entrycount - 1, 1, &color); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(color.r != 123.0 && color.g != 123.0 && color.b != 123.0 && color.a != 123.0, "got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
/* zero return length */ color.r = color.g = color.b = color.a = 123.0; hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, 0, 0, &color); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(color.r == 123.0 && color.g == 123.0 && color.b == 123.0 && color.a == 123.0, "got wrong color %.2fx%.2fx%.2fx%.2f\n", color.r, color.g, color.b, color.a);
IDWriteFontFace2_Release(fontface2); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_TranslateColorGlyphRun(void) @@ -7695,7 +7692,7 @@ static void test_TranslateColorGlyphRun(void)
codepoints[0] = 'A'; hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
run.fontFace = fontface; run.fontEmSize = 20.0f; @@ -7709,7 +7706,7 @@ static void test_TranslateColorGlyphRun(void) layers = (void*)0xdeadbeef; hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); - ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr); ok(layers == NULL, "got %p\n", layers); IDWriteFontFace_Release(fontface);
@@ -7722,19 +7719,19 @@ static void test_TranslateColorGlyphRun(void) }
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFont_Release(font);
codepoints[0] = 0x26c4; hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
run.fontFace = fontface;
layers = NULL; hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(layers != NULL, "got %p\n", layers);
hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (void **)&layers1); @@ -7748,13 +7745,13 @@ static void test_TranslateColorGlyphRun(void) { hasrun = FALSE; hr = IDWriteColorGlyphRunEnumerator_MoveNext(layers, &hasrun); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!hasrun) break;
hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(colorrun->glyphRun.fontFace == fontface, "Unexpected fontface %p.\n", colorrun->glyphRun.fontFace); ok(colorrun->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun->glyphRun.fontEmSize); ok(colorrun->glyphRun.glyphCount == 1, "Unexpected glyph count %u.\n", colorrun->glyphRun.glyphCount); @@ -7765,7 +7762,7 @@ static void test_TranslateColorGlyphRun(void) if (layers1) { hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1); - ok(hr == S_OK, "Failed to get color runt, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get color runt, hr %#lx.\n", hr); ok((const DWRITE_COLOR_GLYPH_RUN *)colorrun1 == colorrun, "Unexpected pointer.\n"); ok(colorrun1->glyphImageFormat == (DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE | DWRITE_GLYPH_IMAGE_FORMATS_COLR) || colorrun1->glyphImageFormat == DWRITE_GLYPH_IMAGE_FORMATS_NONE, @@ -7777,12 +7774,12 @@ static void test_TranslateColorGlyphRun(void)
/* iterated all way through */ hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun); - ok(hr == E_NOT_VALID_STATE, "got 0x%08x\n", hr); + ok(hr == E_NOT_VALID_STATE, "Unexpected hr %#lx.\n", hr);
if (layers1) { hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1); - ok(hr == E_NOT_VALID_STATE, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_VALID_STATE, "Unexpected hr %#lx.\n", hr); }
IDWriteColorGlyphRunEnumerator_Release(layers); @@ -7790,33 +7787,33 @@ static void test_TranslateColorGlyphRun(void) IDWriteColorGlyphRunEnumerator1_Release(layers1);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid palette index */ layers = (void*)0xdeadbeef; hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL, DWRITE_MEASURING_MODE_NATURAL, NULL, IDWriteFontFace2_GetColorPaletteCount(fontface2), &layers); - ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr); ok(layers == NULL, "got %p\n", layers);
layers = NULL; hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL, DWRITE_MEASURING_MODE_NATURAL, NULL, IDWriteFontFace2_GetColorPaletteCount(fontface2) - 1, &layers); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteColorGlyphRunEnumerator_Release(layers);
/* color font, glyph without color info */ codepoints[0] = 'A'; hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!*glyphs, "Unexpected glyph.\n");
layers = (void*)0xdeadbeef; hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); - ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr); ok(layers == NULL, "got %p\n", layers);
/* one glyph with, one without */ @@ -7824,14 +7821,14 @@ static void test_TranslateColorGlyphRun(void) codepoints[1] = 0x26c4;
hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 2, glyphs); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
run.glyphCount = 2;
layers = NULL; hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(layers != NULL, "got %p\n", layers);
hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (void **)&layers1); @@ -7841,13 +7838,13 @@ static void test_TranslateColorGlyphRun(void) { hasrun = FALSE; hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!hasrun) break;
hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!colorrun1->glyphRun.fontFace, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace); ok(colorrun1->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun1->glyphRun.fontEmSize); ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u.\n", colorrun1->glyphRun.glyphCount); @@ -7873,31 +7870,31 @@ static void test_TranslateColorGlyphRun(void) origin.x = origin.y = 0.0f; hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL, DWRITE_GLYPH_IMAGE_FORMATS_NONE, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1); - ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL, DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1); - ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL, DWRITE_GLYPH_IMAGE_FORMATS_CFF, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1); - ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr); + ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL, DWRITE_GLYPH_IMAGE_FORMATS_COLR, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (;;) { hasrun = FALSE; hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!hasrun) break;
hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!colorrun1->glyphRun.fontFace, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace); ok(colorrun1->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun1->glyphRun.fontEmSize); ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u.\n", colorrun1->glyphRun.glyphCount); @@ -7921,7 +7918,7 @@ static void test_TranslateColorGlyphRun(void) IDWriteFontFace2_Release(fontface2); IDWriteFontFace_Release(fontface); ref = IDWriteFactory2_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_HasCharacter(void) @@ -7943,7 +7940,7 @@ static void test_HasCharacter(void) hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void**)&factory3); if (hr == S_OK) { hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont3, (void**)&font3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ret = IDWriteFont3_HasCharacter(font3, 'A'); ok(ret, "got %d\n", ret); @@ -7956,7 +7953,7 @@ static void test_HasCharacter(void)
IDWriteFont_Release(font); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static BOOL has_main_axis_values(const DWRITE_FONT_AXIS_VALUE *values, unsigned int count) @@ -8003,47 +8000,47 @@ static void test_CreateFontFaceReference(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory3_CreateFontFaceReference(factory, NULL, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* out of range simulation flags */ hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, ~0u, &ref); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* test file is not a collection, but reference could still be created with non-zero face index */ hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 1, DWRITE_FONT_SIMULATIONS_NONE, &ref); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
index = IDWriteFontFaceReference_GetFontFaceIndex(ref); ok(index == 1, "got %u\n", index);
hr = IDWriteFontFaceReference_GetFontFile(ref, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFile_Release(file);
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface); todo_wine - ok(hr == DWRITE_E_FILEFORMAT, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_FILEFORMAT, "Unexpected hr %#lx.\n", hr);
IDWriteFontFaceReference_Release(ref);
/* path however has to be valid */ hr = IDWriteFactory3_CreateFontFaceReference(factory, L"dummy", NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref); todo_wine - ok(hr == DWRITE_E_FILENOTFOUND, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_FILENOTFOUND, "Unexpected hr %#lx.\n", hr); if (hr == S_OK) IDWriteFontFaceReference_Release(ref);
EXPECT_REF(factory, 1); hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(factory, 2);
/* new file is returned */ hr = IDWriteFontFaceReference_GetFontFile(ref, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_GetFontFile(ref, &file1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(file != file1, "got %p, previous file %p\n", file1, file);
IDWriteFontFile_Release(file); @@ -8051,15 +8048,15 @@ static void test_CreateFontFaceReference(void)
/* references are not reused */ hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(ref1 != ref, "got %p, previous ref %p\n", ref1, ref);
/* created fontfaces are cached */ hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_CreateFontFace(ref1, &fontface1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontface == fontface1, "got %p, expected %p\n", fontface1, fontface); IDWriteFontFace3_Release(fontface); IDWriteFontFace3_Release(fontface1); @@ -8070,13 +8067,13 @@ static void test_CreateFontFaceReference(void) IDWriteFontFaceReference_Release(ref1);
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 1, DWRITE_FONT_SIMULATIONS_NONE, &ref1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ret = IDWriteFontFaceReference_Equals(ref, ref1); ok(!ret, "got %d\n", ret); IDWriteFontFaceReference_Release(ref1);
hr = IDWriteFactory3_CreateFontFaceReference(factory, path, NULL, 0, DWRITE_FONT_SIMULATIONS_BOLD, &ref1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ret = IDWriteFontFaceReference_Equals(ref, ref1); ok(!ret, "got %d\n", ret); IDWriteFontFaceReference_Release(ref1); @@ -8085,13 +8082,13 @@ static void test_CreateFontFaceReference(void)
/* create reference from a file */ hr = IDWriteFactory3_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory3_CreateFontFaceReference_(factory, file, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_GetFontFile(ref, &file1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(file != file1, "got %p, previous file %p\n", file1, file);
IDWriteFontFaceReference_Release(ref); @@ -8100,7 +8097,7 @@ static void test_CreateFontFaceReference(void)
/* References returned from IDWriteFont3/IDWriteFontFace3. */ hr = IDWriteFactory3_GetSystemFontCollection(factory, FALSE, &collection, FALSE); - ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
count = IDWriteFontCollection1_GetFontFamilyCount(collection); for (i = 0; i < count; i++) @@ -8109,7 +8106,7 @@ static void test_CreateFontFaceReference(void) UINT32 font_count, j;
hr = IDWriteFontCollection1_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
font_count = IDWriteFontFamily1_GetFontCount(family);
@@ -8118,17 +8115,17 @@ static void test_CreateFontFaceReference(void) IDWriteFontFaceReference1 *ref2;
hr = IDWriteFontFamily1_GetFont(family, j, &font3); - ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont3_GetFontFaceReference(font3, &ref); - ok(hr == S_OK, "Failed to get reference object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get reference object, hr %#lx.\n", hr);
hr = IDWriteFont3_GetFontFaceReference(font3, &ref1); - ok(hr == S_OK, "Failed to get reference object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get reference object, hr %#lx.\n", hr); ok(ref != ref1, "Unexpected reference object %p, %p.\n", ref1, ref);
hr = IDWriteFont3_CreateFontFace(font3, &fontface); - ok(hr == S_OK, "Failed to create a fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a fontface, hr %#lx.\n", hr);
/* Fonts present regular properties as axis values, for non-variable fonts too. Normally it would include weight/width/slant/italic, but could also contain optical size axis. */ @@ -8140,7 +8137,7 @@ static void test_CreateFontFaceReference(void) ok(axis_count >= 4, "Unexpected axis value count.\n");
hr = IDWriteFontFaceReference1_GetFontAxisValues(ref2, axis_values, ARRAY_SIZE(axis_values)); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine ok(has_main_axis_values(axis_values, axis_count), "Unexpected axis returned.\n"); @@ -8152,16 +8149,16 @@ static void test_CreateFontFaceReference(void) IDWriteFontFaceReference_Release(ref1);
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref); - ok(hr == S_OK, "Failed to get a reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get a reference, hr %#lx.\n", hr); EXPECT_REF(fontface, 2);
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref1); - ok(hr == S_OK, "Failed to get a reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get a reference, hr %#lx.\n", hr); ok(ref == ref1, "Unexpected reference %p, %p.\n", ref1, ref); EXPECT_REF(fontface, 3);
hr = IDWriteFontFace3_QueryInterface(fontface, &IID_IDWriteFontFaceReference, (void **)&ref3); - ok(hr == S_OK || broken(FAILED(hr)), "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK || broken(FAILED(hr)), "Failed to get interface, hr %#lx.\n", hr); if (SUCCEEDED(hr)) { ok(ref == ref3, "Unexpected reference %p.\n", ref3); @@ -8169,7 +8166,7 @@ static void test_CreateFontFaceReference(void) }
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface1); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr); ok(fontface1 == fontface, "Unexpected fontface %p, %p.\n", fontface1, fontface); IDWriteFontFace3_Release(fontface1);
@@ -8185,7 +8182,7 @@ static void test_CreateFontFaceReference(void) IDWriteFontCollection1_Release(collection);
refcount = IDWriteFactory3_Release(factory); - ok(refcount == 0, "factory not released, %u\n", refcount); + ok(refcount == 0, "factory not released, %lu\n", refcount); DELETE_FONTFILE(path); }
@@ -8201,10 +8198,10 @@ static void get_expected_fontsig(IDWriteFont *font, FONTSIGNATURE *fontsig) memset(fontsig, 0, sizeof(*fontsig));
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_TryGetFontTable(fontface, MS_OS2_TAG, (const void **)&tt_os2, &size, &os2_context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (tt_os2) { fontsig->fsUsb[0] = GET_BE_DWORD(tt_os2->ulUnicodeRange1); @@ -8241,7 +8238,7 @@ static void test_GetFontSignature(void) factory = create_factory();
hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop_QueryInterface(interop, &IID_IDWriteGdiInterop1, (void**)&interop1); IDWriteGdiInterop_Release(interop); @@ -8251,13 +8248,13 @@ static void test_GetFontSignature(void) IDWriteFactory_Release(factory); return; }; - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop1_GetFontSignature(interop1, NULL, &fontsig); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) { @@ -8268,38 +8265,38 @@ static void test_GetFontSignature(void) WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
IDWriteLocalizedStrings_Release(names);
hr = IDWriteGdiInterop1_GetFontSignature(interop1, font, &fontsig); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_expected_fontsig(font, &expected_signature);
winetest_push_context("Font %s\n", wine_dbgstr_w(nameW));
- ok(fontsig.fsUsb[0] == expected_signature.fsUsb[0], "fsUsb[0] %#x, expected %#x.\n", + ok(fontsig.fsUsb[0] == expected_signature.fsUsb[0], "fsUsb[0] %#lx, expected %#lx.\n", fontsig.fsUsb[0], expected_signature.fsUsb[0]); - ok(fontsig.fsUsb[1] == expected_signature.fsUsb[1], "fsUsb[1] %#x, expected %#x.\n", + ok(fontsig.fsUsb[1] == expected_signature.fsUsb[1], "fsUsb[1] %#lx, expected %#lx.\n", fontsig.fsUsb[1], expected_signature.fsUsb[1]); - ok(fontsig.fsUsb[2] == expected_signature.fsUsb[2], "fsUsb[2] %#x, expected %#x.\n", + ok(fontsig.fsUsb[2] == expected_signature.fsUsb[2], "fsUsb[2] %#lx, expected %#lx.\n", fontsig.fsUsb[2], expected_signature.fsUsb[2]); - ok(fontsig.fsUsb[3] == expected_signature.fsUsb[3], "fsUsb[3] %#x, expected %#x.\n", + ok(fontsig.fsUsb[3] == expected_signature.fsUsb[3], "fsUsb[3] %#lx, expected %#lx.\n", fontsig.fsUsb[3], expected_signature.fsUsb[3]);
- ok(fontsig.fsCsb[0] == expected_signature.fsCsb[0], "fsCsb[0] %#x, expected %#x.\n", + ok(fontsig.fsCsb[0] == expected_signature.fsCsb[0], "fsCsb[0] %#lx, expected %#lx.\n", fontsig.fsCsb[0], expected_signature.fsCsb[0]); - ok(fontsig.fsCsb[1] == expected_signature.fsCsb[1], "fsCsb[1] %#x, expected %#x.\n", + ok(fontsig.fsCsb[1] == expected_signature.fsCsb[1], "fsCsb[1] %#lx, expected %#lx.\n", fontsig.fsCsb[1], expected_signature.fsCsb[1]);
winetest_pop_context(); @@ -8311,7 +8308,7 @@ static void test_GetFontSignature(void) IDWriteGdiInterop1_Release(interop1); IDWriteFontCollection_Release(syscollection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_font_properties(void) @@ -8333,7 +8330,7 @@ static void test_font_properties(void) ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %u\n", style);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void**)&fontface3); IDWriteFontFace_Release(fontface); @@ -8346,7 +8343,7 @@ static void test_font_properties(void)
IDWriteFont_Release(font); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface) @@ -8362,7 +8359,7 @@ static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface) UINT16 i;
hr = IDWriteFontFace1_TryGetFontTable(fontface, MS_GSUB_TAG, &data, &size, &context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!exists) return FALSE; @@ -8451,7 +8448,7 @@ static void test_HasVerticalGlyphVariants(void) IDWriteFontFace1_Release(fontface1);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) { @@ -8462,20 +8459,20 @@ static void test_HasVerticalGlyphVariants(void) WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void**)&fontface1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
@@ -8495,7 +8492,7 @@ static void test_HasVerticalGlyphVariants(void)
IDWriteFontCollection_Release(syscollection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_HasKerningPairs(void) @@ -8521,7 +8518,7 @@ static void test_HasKerningPairs(void) IDWriteFontFace1_Release(fontface1);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) { @@ -8535,26 +8532,26 @@ static void test_HasKerningPairs(void) UINT32 size;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (void **)&fontface1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, nameW, ARRAY_SIZE(nameW));
exists = FALSE; hr = IDWriteFontFace1_TryGetFontTable(fontface1, MS_KERN_TAG, &data, &size, &context, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFace1_ReleaseFontTable(fontface1, context);
has_kerningpairs = IDWriteFontFace1_HasKerningPairs(fontface1); @@ -8571,7 +8568,7 @@ static void test_HasKerningPairs(void)
IDWriteFontCollection_Release(syscollection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static float get_scaled_metric(const DWRITE_GLYPH_RUN *run, float metric, const DWRITE_FONT_METRICS *m) @@ -8591,7 +8588,7 @@ static void get_expected_glyph_origins(D2D1_POINT_2F baseline_origin, const DWRI
hr = IDWriteFontFace_GetDesignGlyphMetrics(run->fontFace, run->glyphIndices, run->glyphCount, glyph_metrics, run->isSideways); - ok(hr == S_OK, "Failed to get glyph metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get glyph metrics, hr %#lx.\n", hr);
if (run->bidiLevel & 1) { @@ -8694,7 +8691,7 @@ static void test_ComputeGlyphOrigins(void)
memset(origins, 0, sizeof(origins)); hr = IDWriteFactory4_ComputeGlyphOrigins_(factory, &run, origins_tests[i].baseline_origin, origins); - ok(hr == S_OK, "%u: failed to compute glyph origins, hr %#x.\n", i, hr); + ok(hr == S_OK, "%u: failed to compute glyph origins, hr %#lx.\n", i, hr); for (j = 0; j < run.glyphCount; ++j) { todo_wine_if(run.isSideways) @@ -8723,7 +8720,7 @@ static void test_ComputeGlyphOrigins(void)
memset(origins, 0, sizeof(origins)); hr = IDWriteFactory4_ComputeGlyphOrigins_(factory, &run, baseline_origin, origins); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(origins[0].x == 123.0f && origins[0].y == 321.0f, "origins[0] %f,%f\n", origins[0].x, origins[0].y); ok(origins[1].x == 133.0f && origins[1].y == 321.0f, "origins[1] %f,%f\n", origins[1].x, origins[1].y);
@@ -8748,7 +8745,7 @@ static void test_ComputeGlyphOrigins(void) ok(origins[1].x == 133.0f && origins[1].y == 321.0f, "origins[1] %f,%f\n", origins[1].x, origins[1].y);
ref = IDWriteFactory4_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_object_lifetime(void) @@ -8768,13 +8765,13 @@ static void test_object_lifetime(void)
/* system collection takes factory reference */ hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(collection, 1); EXPECT_REF(factory, 2);
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection2, FALSE); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); ok(collection2 == collection, "expected same collection\n");
EXPECT_REF(collection, 2); @@ -8791,14 +8788,14 @@ static void test_object_lifetime(void)
/* family takes collection reference */ hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family, 1); EXPECT_REF(collection, 2); EXPECT_REF(factory, 2);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family2); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family2, 1); EXPECT_REF(collection, 3); @@ -8813,14 +8810,14 @@ static void test_object_lifetime(void) /* font takes family reference */ hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family, 2); EXPECT_REF(collection, 2); EXPECT_REF(factory, 2);
hr = IDWriteFont_GetFontFamily(font, &family2); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); ok(family2 == family, "unexpected family pointer\n"); IDWriteFontFamily_Release(family2);
@@ -8829,7 +8826,7 @@ static void test_object_lifetime(void)
/* Fontface takes factory reference and nothing else. */ hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(font, 1); EXPECT_REF_BROKEN(fontface, 1, 2); @@ -8839,7 +8836,7 @@ static void test_object_lifetime(void)
/* get font from fontface */ hr = IDWriteFontCollection_GetFontFromFontFace(collection, fontface, &font2); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(font, 1); EXPECT_REF(font2, 1); @@ -8865,7 +8862,7 @@ static void test_object_lifetime(void) /* Matching fonts list takes family reference. */ hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
EXPECT_REF(family, 2); EXPECT_REF(collection, 2); @@ -8873,7 +8870,7 @@ static void test_object_lifetime(void)
hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist2); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); ok(fontlist2 != fontlist, "unexpected font list\n"); IDWriteFontList_Release(fontlist2);
@@ -8884,17 +8881,17 @@ static void test_object_lifetime(void)
EXPECT_REF(factory, 2); ref = IDWriteFontCollection_Release(collection); - ok(ref == 0, "collection not released, %u\n", ref); + ok(ref == 0, "collection not released, %lu\n", ref); EXPECT_REF(factory, 1);
/* GDI interop object takes factory reference */ hr = IDWriteFactory_GetGdiInterop(factory, &interop); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); EXPECT_REF(interop, 1); EXPECT_REF(factory, 2);
hr = IDWriteFactory_GetGdiInterop(factory, &interop2); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); ok(interop == interop2, "got unexpected interop pointer\n");
EXPECT_REF(interop, 2); @@ -8902,10 +8899,10 @@ static void test_object_lifetime(void)
IDWriteGdiInterop_Release(interop2); ref = IDWriteGdiInterop_Release(interop); - ok(ref == 0, "interop not released, %u\n", ref); + ok(ref == 0, "interop not released, %lu\n", ref);
ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
struct testowner_object @@ -8981,14 +8978,14 @@ static void test_inmemory_file_loader(void)
EXPECT_REF(factory, 1); hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory, &loader); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); EXPECT_REF(factory, 1);
testowner_init(&ownerobject); fontface = create_fontface((IDWriteFactory *)factory);
hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory, &loader2); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); ok(loader != loader2, "unexpected pointer\n"); IDWriteInMemoryFontFileLoader_Release(loader2);
@@ -9000,41 +8997,41 @@ static void test_inmemory_file_loader(void) /* Use whole font blob to construct in-memory file. */ count = 1; hr = IDWriteFontFace_GetFiles(fontface, &count, &file); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFile_GetLoader(file, &fileloader); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFileLoader_CreateStreamFromKey(fileloader, key, key_size, &stream); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); IDWriteFontFileLoader_Release(fileloader); IDWriteFontFile_Release(file);
hr = IDWriteFontFileStream_GetFileSize(stream, &file_size); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
hr = IDWriteFontFileStream_ReadFileFragment(stream, &data, 0, file_size, &context); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
/* Not registered yet. */ hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data, file_size, NULL, &file); - ok(hr == E_INVALIDARG, "got %#x\n", hr); + ok(hr == E_INVALIDARG, "got %#lx\n", hr);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory); ok(count == 1, "Unexpected file count %u.\n", count);
hr = IDWriteFactory5_RegisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); EXPECT_REF(inmemory, 2);
EXPECT_REF(&ownerobject.IUnknown_iface, 1); hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data, file_size, &ownerobject.IUnknown_iface, &file); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); EXPECT_REF(&ownerobject.IUnknown_iface, 2); EXPECT_REF(inmemory, 3);
@@ -9043,7 +9040,7 @@ static void test_inmemory_file_loader(void)
hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data, file_size, &ownerobject.IUnknown_iface, &file2); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); ok(file2 != file, "got unexpected file\n"); EXPECT_REF(&ownerobject.IUnknown_iface, 3); EXPECT_REF(inmemory, 4); @@ -9053,25 +9050,25 @@ static void test_inmemory_file_loader(void)
/* Check in-memory reference key format. */ hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
ok(key && *(DWORD*)key == 1, "got wrong ref key\n"); ok(key_size == 4, "ref key size %u\n", key_size);
hr = IDWriteFontFile_GetReferenceKey(file2, &key, &key_size); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr);
ok(key && *(DWORD*)key == 2, "got wrong ref key\n"); ok(key_size == 4, "ref key size %u\n", key_size);
EXPECT_REF(inmemory, 4); hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, key, key_size, &stream2); - ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr); EXPECT_REF(stream2, 1); EXPECT_REF(inmemory, 4);
hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, key, key_size, &stream3); - ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
ok(stream2 != stream3, "Unexpected stream.\n");
@@ -9081,7 +9078,7 @@ static void test_inmemory_file_loader(void) /* Release file at index 1, create new one to see if index is reused. */ EXPECT_REF(&ownerobject.IUnknown_iface, 3); ref = IDWriteFontFile_Release(file); - ok(ref == 0, "File object not released, %u.\n", ref); + ok(ref == 0, "File object not released, %lu.\n", ref); EXPECT_REF(&ownerobject.IUnknown_iface, 3);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory); @@ -9089,58 +9086,58 @@ static void test_inmemory_file_loader(void)
EXPECT_REF(&ownerobject.IUnknown_iface, 3); ref = IDWriteFontFile_Release(file2); - ok(ref == 0, "File object not released, %u.\n", ref); + ok(ref == 0, "File object not released, %lu.\n", ref); EXPECT_REF(&ownerobject.IUnknown_iface, 3);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory); ok(count == 3, "Unexpected file count %u.\n", count);
hr = IDWriteFactory5_UnregisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory); - ok(hr == S_OK, "got %#x\n", hr); + ok(hr == S_OK, "got %#lx\n", hr); EXPECT_REF(&ownerobject.IUnknown_iface, 3);
EXPECT_REF(&ownerobject.IUnknown_iface, 3); ref = IDWriteInMemoryFontFileLoader_Release(inmemory); - ok(ref == 0, "loader not released, %u.\n", ref); + ok(ref == 0, "loader not released, %lu.\n", ref); EXPECT_REF(&ownerobject.IUnknown_iface, 1);
/* Test reference key for first added file. */ hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory, &loader); - ok(hr == S_OK, "Failed to create loader, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create loader, hr %#lx.\n", hr);
inmemory = loader;
hr = IDWriteFactory5_RegisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory); - ok(hr == S_OK, "Failed to register loader, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to register loader, hr %#lx.\n", hr);
ref_key = 0; hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key), &stream2); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* With owner object. */ hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data, file_size, &ownerobject.IUnknown_iface, &file); - ok(hr == S_OK, "Failed to create in-memory file reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create in-memory file reference, hr %#lx.\n", hr);
ref_key = 0; hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key), &stream2); - ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
context2 = (void *)0xdeadbeef; hr = IDWriteFontFileStream_ReadFileFragment(stream2, &frag_start, 0, file_size, &context2); - ok(hr == S_OK, "Failed to read a fragment, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to read a fragment, hr %#lx.\n", hr); ok(context2 == NULL, "Unexpected context %p.\n", context2); ok(frag_start == data, "Unexpected fragment pointer %p.\n", frag_start);
hr = IDWriteFontFileStream_GetFileSize(stream2, &size); - ok(hr == S_OK, "Failed to get file size, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get file size, hr %#lx.\n", hr); ok(size == file_size, "Unexpected file size.\n");
IDWriteFontFileStream_ReleaseFileFragment(stream2, context2);
writetime = 1; hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr); ok(writetime == 0, "Unexpected writetime.\n");
IDWriteFontFileStream_Release(stream2); @@ -9148,27 +9145,27 @@ static void test_inmemory_file_loader(void) /* Without owner object. */ hr = IDWriteInMemoryFontFileLoader_CreateInMemoryFontFileReference(inmemory, (IDWriteFactory *)factory, data, file_size, NULL, &file2); - ok(hr == S_OK, "Failed to create in-memory file reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create in-memory file reference, hr %#lx.\n", hr);
ref_key = 1; hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key), &stream2); - ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
context2 = (void *)0xdeadbeef; hr = IDWriteFontFileStream_ReadFileFragment(stream2, &frag_start, 0, file_size, &context2); - ok(hr == S_OK, "Failed to read a fragment, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to read a fragment, hr %#lx.\n", hr); ok(context2 == NULL, "Unexpected context %p.\n", context2); ok(frag_start != data, "Unexpected fragment pointer %p.\n", frag_start);
hr = IDWriteFontFileStream_GetFileSize(stream2, &size); - ok(hr == S_OK, "Failed to get file size, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get file size, hr %#lx.\n", hr); ok(size == file_size, "Unexpected file size.\n");
IDWriteFontFileStream_ReleaseFileFragment(stream2, context2);
writetime = 1; hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr); ok(writetime == 0, "Unexpected writetime.\n");
IDWriteFontFileStream_Release(stream2); @@ -9177,21 +9174,21 @@ static void test_inmemory_file_loader(void) /* Key size validation. */ ref_key = 0; hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, NULL, sizeof(ref_key) - 1, &stream2); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ref_key = 0; hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key) - 1, &stream2); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
ref_key = 0; hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key, sizeof(ref_key) + 1, &stream2); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory); ok(count == 2, "Unexpected file count %u.\n", count);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &key_size); - ok(hr == S_OK, "Failed to get reference key, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get reference key, hr %#lx.\n", hr);
ok(key && *(DWORD*)key == 0, "Unexpected reference key.\n"); ok(key_size == 4, "Unexpected key size %u.\n", key_size); @@ -9202,17 +9199,17 @@ static void test_inmemory_file_loader(void) ok(count == 2, "Unexpected file count %u.\n", count);
hr = IDWriteFactory5_UnregisterFontFileLoader(factory, (IDWriteFontFileLoader *)inmemory); - ok(hr == S_OK, "Failed to unregister loader, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to unregister loader, hr %#lx.\n", hr);
IDWriteFontFileStream_ReleaseFileFragment(stream, context); IDWriteFontFileStream_Release(stream); IDWriteFontFace_Release(fontface);
ref = IDWriteInMemoryFontFileLoader_Release(inmemory); - ok(ref == 0, "loader not released, %u.\n", ref); + ok(ref == 0, "loader not released, %lu.\n", ref);
ref = IDWriteFactory5_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static BOOL face_has_table(IDWriteFontFace4 *fontface, UINT32 tag) @@ -9224,7 +9221,7 @@ static BOOL face_has_table(IDWriteFontFace4 *fontface, UINT32 tag) HRESULT hr;
hr = IDWriteFontFace4_TryGetFontTable(fontface, tag, &data, &size, &context, &exists); - ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr); + ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr); if (exists) IDWriteFontFace4_ReleaseFontTable(fontface, context);
@@ -9244,7 +9241,7 @@ static DWORD get_sbix_formats(IDWriteFontFace4 *fontface) HRESULT hr;
hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_MAXP_TAG, &data, &size, &context, &exists); - ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr); + ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr); ok(exists, "Expected maxp table\n");
if (!exists) @@ -9254,7 +9251,7 @@ static DWORD get_sbix_formats(IDWriteFontFace4 *fontface) num_glyphs = GET_BE_WORD(maxp->numGlyphs);
hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_SBIX_TAG, &data, &size, &context, &exists); - ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr); + ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr); ok(exists, "Expected sbix table\n");
header = data; @@ -9285,7 +9282,7 @@ static DWORD get_sbix_formats(IDWriteFontFace4 *fontface) ret |= DWRITE_GLYPH_IMAGE_FORMATS_TIFF; break; default: - ok(0, "unexpected format, %#x\n", GET_BE_DWORD(format)); + ok(0, "unexpected format, %#lx\n", GET_BE_DWORD(format)); } } } @@ -9306,7 +9303,7 @@ static DWORD get_cblc_formats(IDWriteFontFace4 *fontface) HRESULT hr;
hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_CBLC_TAG, (const void **)&header, &size, &context, &exists); - ok(hr == S_OK, "TryGetFontTable() failed, %#x\n", hr); + ok(hr == S_OK, "TryGetFontTable() failed, %#lx\n", hr); ok(exists, "Expected CBLC table\n");
if (!exists) @@ -9378,7 +9375,7 @@ static void test_GetGlyphImageFormats(void) IDWriteFontFace4_Release(fontface4);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; i++) { @@ -9389,10 +9386,10 @@ static void test_GetGlyphImageFormats(void) IDWriteFont *font;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, familynameW, ARRAY_SIZE(familynameW)); IDWriteLocalizedStrings_Release(names); @@ -9402,13 +9399,13 @@ static void test_GetGlyphImageFormats(void) DWORD formats, expected_formats;
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_GetFaceNames(font, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_enus_string(names, facenameW, ARRAY_SIZE(facenameW));
@@ -9419,7 +9416,7 @@ static void test_GetGlyphImageFormats(void) /* Mask describes font as a whole. */ formats = IDWriteFontFace4_GetGlyphImageFormats(fontface4); expected_formats = get_face_glyph_image_formats(fontface4); - ok(formats == expected_formats, "%s - %s, expected formats %#x, got formats %#x.\n", + ok(formats == expected_formats, "%s - %s, expected formats %#lx, got formats %#lx.\n", wine_dbgstr_w(familynameW), wine_dbgstr_w(facenameW), expected_formats, formats);
IDWriteFontFace4_Release(fontface4); @@ -9432,7 +9429,7 @@ static void test_GetGlyphImageFormats(void)
IDWriteFontCollection_Release(syscollection); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_CreateCustomRenderingParams(void) @@ -9474,7 +9471,7 @@ static void test_CreateCustomRenderingParams(void) params = (void *)0xdeadbeef; hr = IDWriteFactory_CreateCustomRenderingParams(factory, params_tests[i].gamma, params_tests[i].contrast, params_tests[i].cleartype_level, params_tests[i].geometry, params_tests[i].rendering_mode, ¶ms); - ok(hr == params_tests[i].hr, "unexpected hr %#x, expected %#x.\n", hr, params_tests[i].hr); + ok(hr == params_tests[i].hr, "unexpected hr %#lx, expected %#lx.\n", hr, params_tests[i].hr);
if (hr == S_OK) { ok(params_tests[i].gamma == IDWriteRenderingParams_GetGamma(params), "unexpected gamma %f, expected %f.\n", @@ -9500,7 +9497,7 @@ static void test_CreateCustomRenderingParams(void) }
ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); }
static void test_localfontfileloader(void) @@ -9518,17 +9515,17 @@ static void test_localfontfileloader(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "Failed to create file reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create file reference, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateFontFileReference(factory2, path, NULL, &file2); - ok(hr == S_OK, "Failed to create file reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create file reference, hr %#lx.\n", hr); ok(file != file2, "Unexpected file instance.\n");
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "Failed to get loader, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get loader, hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file2, &loader2); - ok(hr == S_OK, "Failed to get loader, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get loader, hr %#lx.\n", hr); ok(loader == loader2, "Unexpected loader instance\n");
IDWriteFontFile_Release(file); @@ -9536,9 +9533,9 @@ static void test_localfontfileloader(void) IDWriteFontFileLoader_Release(loader); IDWriteFontFileLoader_Release(loader2); ref = IDWriteFactory_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); ref = IDWriteFactory_Release(factory2); - ok(ref == 0, "factory not released, %u\n", ref); + ok(ref == 0, "factory not released, %lu\n", ref); DELETE_FONTFILE(path); }
@@ -9619,7 +9616,7 @@ static void test_fontsetbuilder(void)
EXPECT_REF(factory, 1); hr = IDWriteFactory3_CreateFontSetBuilder(factory, &builder); - ok(hr == S_OK, "Failed to create font set builder, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create font set builder, hr %#lx.\n", hr); EXPECT_REF(factory, 2);
if (SUCCEEDED(hr = IDWriteFontSetBuilder_QueryInterface(builder, &IID_IDWriteFontSetBuilder1, (void **)&builder1))) @@ -9627,16 +9624,16 @@ static void test_fontsetbuilder(void) path = create_testfontfile(test_fontfile);
hr = IDWriteFactory3_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); hr = IDWriteFactory3_CreateFontCollectionFromFontSet(factory, fontset, &collection); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); if (SUCCEEDED(hr)) { count = IDWriteFontCollection1_GetFontFamilyCount(collection); @@ -9646,14 +9643,14 @@ static void test_fontsetbuilder(void) IDWriteFontSet_Release(fontset);
hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory3_CreateFontCollectionFromFontSet(factory, fontset, &collection); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); if (SUCCEEDED(hr)) { check_familymodel(collection, DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE); @@ -9667,10 +9664,10 @@ static void test_fontsetbuilder(void) ok(count == 2, "Unexpected font count %u.\n", count);
hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontFaceReference_QueryInterface(ref, &IID_IDWriteFontFaceReference1, (void **)&ref1); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
count = IDWriteFontFaceReference1_GetFontAxisValueCount(ref1); todo_wine @@ -9679,7 +9676,7 @@ static void test_fontsetbuilder(void) if (count == 4) { hr = IDWriteFontFaceReference1_GetFontAxisValues(ref1, axis_values, ARRAY_SIZE(axis_values)); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
ok(axis_values[0].axisTag == DWRITE_FONT_AXIS_TAG_WEIGHT, "Unexpected tag[0] %s.\n", wine_dbgstr_an((char *)&axis_values[0].axisTag, 4)); @@ -9709,7 +9706,7 @@ static void test_fontsetbuilder(void) IDWriteFontSetBuilder_Release(builder);
hr = IDWriteFactory3_GetSystemFontCollection(factory, FALSE, &collection, FALSE); - ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr); count = IDWriteFontCollection1_GetFontFamilyCount(collection);
for (i = 0; i < count; i++) { @@ -9718,7 +9715,7 @@ static void test_fontsetbuilder(void) IDWriteFont3 *font;
hr = IDWriteFontCollection1_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
fontcount = IDWriteFontFamily1_GetFontCount(family); for (j = 0; j < fontcount; ++j) @@ -9727,39 +9724,39 @@ static void test_fontsetbuilder(void) UINT32 setcount, id;
hr = IDWriteFontFamily1_GetFont(family, j, &font); - ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
/* Create a set with a single font reference, test set properties. */ hr = IDWriteFactory3_CreateFontSetBuilder(factory, &builder); - ok(hr == S_OK, "Failed to create font set builder, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create font set builder, hr %#lx.\n", hr);
hr = IDWriteFont3_GetFontFaceReference(font, &ref); - ok(hr == S_OK, "Failed to get fontface reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get fontface reference, hr %#lx.\n", hr);
EXPECT_REF(ref, 1); hr = IDWriteFontSetBuilder_AddFontFaceReference(builder, ref); - ok(hr == S_OK, "Failed to add fontface reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to add fontface reference, hr %#lx.\n", hr); EXPECT_REF(ref, 1);
hr = IDWriteFontSetBuilder_CreateFontSet(builder, &fontset); - ok(hr == S_OK, "Failed to create a font set, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a font set, hr %#lx.\n", hr);
setcount = IDWriteFontSet_GetFontCount(fontset); ok(setcount == 1, "Unexpected font count %u.\n", setcount);
ref2 = (void *)0xdeadbeef; hr = IDWriteFontSet_GetFontFaceReference(fontset, setcount, &ref2); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(!ref2, "Unexpected pointer.\n");
ref2 = NULL; hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref2); - ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font face reference, hr %#lx.\n", hr); ok(ref2 != ref, "Unexpected reference.\n");
ref3 = NULL; hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref3); - ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font face reference, hr %#lx.\n", hr); ok(ref2 != ref3, "Unexpected reference.\n");
IDWriteFontFaceReference_Release(ref3); @@ -9773,7 +9770,7 @@ static void test_fontsetbuilder(void) BOOL exists = FALSE;
hr = IDWriteFontSet_GetPropertyValues(fontset, 0, id, &exists, &values); - ok(hr == S_OK, "Failed to get property value, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get property value, hr %#lx.\n", hr);
if (id == DWRITE_FONT_PROPERTY_ID_WEIGHT || id == DWRITE_FONT_PROPERTY_ID_STRETCH || id == DWRITE_FONT_PROPERTY_ID_STYLE) @@ -9810,12 +9807,12 @@ static void test_fontsetbuilder(void)
buffW[0] = 'a'; hr = IDWriteLocalizedStrings_GetLocaleName(values, 0, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "Failed to get locale name, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get locale name, hr %#lx.\n", hr); ok(!*buffW, "Unexpected locale %s.\n", wine_dbgstr_w(buffW));
buff2W[0] = 0; hr = IDWriteLocalizedStrings_GetString(values, 0, buff2W, ARRAY_SIZE(buff2W)); - ok(hr == S_OK, "Failed to get property string, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get property string, hr %#lx.\n", hr);
wsprintfW(buffW, L"%u", ivalue); ok(!lstrcmpW(buffW, buff2W), "Unexpected property value %s, expected %s.\n", wine_dbgstr_w(buff2W), @@ -9868,18 +9865,18 @@ static void test_font_resource(void)
count = 1; hr = IDWriteFontFace_GetFiles(fontface, &count, &fontfile); - ok(hr == S_OK, "Failed to get file object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get file object, hr %#lx.\n", hr);
hr = IDWriteFactory6_CreateFontResource(factory, fontfile, 0, &resource); - ok(hr == S_OK, "Failed to create font resource, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create font resource, hr %#lx.\n", hr);
hr = IDWriteFactory6_CreateFontResource(factory, fontfile, 0, &resource2); - ok(hr == S_OK, "Failed to create font resource, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create font resource, hr %#lx.\n", hr); ok(resource != resource2, "Unexpected instance.\n"); IDWriteFontResource_Release(resource2);
hr = IDWriteFontResource_GetFontFile(resource, &fontfile2); - ok(hr == S_OK, "Failed to get font file, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font file, hr %#lx.\n", hr); ok(fontfile2 == fontfile, "Unexpected file instance.\n"); IDWriteFontFile_Release(fontfile2);
@@ -9890,7 +9887,7 @@ static void test_font_resource(void) axis_values[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT; axis_values[0].value = 400.0f; hr = IDWriteFontResource_CreateFontFaceReference(resource, DWRITE_FONT_SIMULATIONS_NONE, axis_values, 1, &reference); - ok(hr == S_OK, "Failed to create reference object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create reference object, hr %#lx.\n", hr);
count = IDWriteFontFaceReference1_GetFontAxisValueCount(reference); ok(count == 1, "Unexpected axis value count.\n"); @@ -9905,25 +9902,25 @@ static void test_font_resource(void)
EXPECT_REF(resource, 1); hr = IDWriteFontResource_CreateFontFaceReference(resource, DWRITE_FONT_SIMULATIONS_NONE, NULL, 0, &reference); - ok(hr == S_OK, "Failed to create reference object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create reference object, hr %#lx.\n", hr); EXPECT_REF(resource, 1);
hr = IDWriteFontResource_CreateFontFaceReference(resource, DWRITE_FONT_SIMULATIONS_NONE, NULL, 0, &reference2); - ok(hr == S_OK, "Failed to create reference object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create reference object, hr %#lx.\n", hr); ok(reference != reference2, "Unexpected reference instance.\n"); IDWriteFontFaceReference1_Release(reference2); IDWriteFontFaceReference1_Release(reference);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace5, (void **)&fontface5); - ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
hr = IDWriteFontFace5_GetFontResource(fontface5, &resource2); - ok(hr == S_OK, "Failed to get font resource, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font resource, hr %#lx.\n", hr); ok(resource != resource2, "Unexpected resource instance.\n"); IDWriteFontResource_Release(resource);
hr = IDWriteFontFace5_GetFontResource(fontface5, &resource); - ok(hr == S_OK, "Failed to get font resource, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font resource, hr %#lx.\n", hr); ok(resource != resource2, "Unexpected resource instance.\n"); EXPECT_REF(resource, 1); IDWriteFontResource_Release(resource); @@ -9980,16 +9977,16 @@ static void test_font_resource(void)
memset(axis_values, 0, sizeof(axis_values)); hr = IDWriteFontFaceReference1_GetFontAxisValues(reference, axis_values, 1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(!axis_values[0].axisTag, "Unexpected axis tag.\n");
memset(axis_values, 0, sizeof(axis_values)); hr = IDWriteFontFaceReference1_GetFontAxisValues(reference, axis_values, 2); - ok(hr == S_OK, "Failed to get axis values, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get axis values, hr %#lx.\n", hr); ok(axis_values[0].axisTag == DWRITE_FONT_AXIS_TAG_WEIGHT, "Unexpected axis tag.\n");
hr = IDWriteFontFaceReference1_CreateFontFace(reference, &fontface5); - ok(hr == S_OK, "Failed to create a font face, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a font face, hr %#lx.\n", hr); IDWriteFontFace5_Release(fontface5);
IDWriteFontFaceReference1_Release(reference); @@ -9998,7 +9995,7 @@ static void test_font_resource(void)
IDWriteFontFace_Release(fontface); ref = IDWriteFactory6_Release(factory); - ok(ref == 0, "Factory wasn't released, %u.\n", ref); + ok(ref == 0, "Factory wasn't released, %lu.\n", ref); }
static BOOL get_expected_is_color(IDWriteFontFace2 *fontface) @@ -10010,14 +10007,14 @@ static BOOL get_expected_is_color(IDWriteFontFace2 *fontface) HRESULT hr;
hr = IDWriteFontFace2_TryGetFontTable(fontface, MS_CPAL_TAG, (const void **)&data, &size, &context, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (context) IDWriteFontFace2_ReleaseFontTable(fontface, context);
if (exists) { hr = IDWriteFontFace2_TryGetFontTable(fontface, MS_COLR_TAG, (const void **)&data, &size, &context, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (context) IDWriteFontFace2_ReleaseFontTable(fontface, context); } @@ -10042,7 +10039,7 @@ static void test_IsColorFont(void) }
hr = IDWriteFactory2_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "Failed to get font collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font collection, hr %#lx.\n", hr);
count = IDWriteFontCollection_GetFontFamilyCount(collection); for (i = 0; i < count; ++i) @@ -10053,10 +10050,10 @@ static void test_IsColorFont(void) WCHAR nameW[256];
hr = IDWriteFontCollection_GetFontFamily(collection, i, &family); - ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get family, hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "Failed to get names, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get names, hr %#lx.\n", hr); get_enus_string(names, nameW, ARRAY_SIZE(nameW)); IDWriteLocalizedStrings_Release(names);
@@ -10071,17 +10068,17 @@ static void test_IsColorFont(void) IDWriteFont *font;
hr = IDWriteFontFamily_GetFont(family, j, &font); - ok(hr == S_OK, "Failed to get font, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get font, hr %#lx.\n", hr);
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFont2, (void **)&font2); - ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr); IDWriteFont_Release(font);
hr = IDWriteFont2_CreateFontFace(font2, &fontface); - ok(hr == S_OK, "Failed to create fontface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fontface, hr %#lx.\n", hr);
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void **)&fontface2); - ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr); IDWriteFontFace_Release(fontface);
is_color_font = IDWriteFont2_IsColorFont(font2); @@ -10101,7 +10098,7 @@ static void test_IsColorFont(void)
IDWriteFontCollection_Release(collection); refcount = IDWriteFactory2_Release(factory); - ok(refcount == 0, "Factory not released, refcount %u.\n", refcount); + ok(refcount == 0, "Factory not released, refcount %lu.\n", refcount); }
static void test_GetVerticalGlyphVariants(void) @@ -10130,12 +10127,12 @@ static void test_GetVerticalGlyphVariants(void) ch = 'A'; *glyphs = 0; hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &ch, 1, glyphs); - ok(hr == S_OK, "Failed to get glyph, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get glyph, hr %#lx.\n", hr); ok(!!*glyphs, "Unexpected glyph %u.\n", glyphs[0]);
memset(glyph_variants, 0, sizeof(glyph_variants)); hr = IDWriteFontFace1_GetVerticalGlyphVariants(fontface1, 1, glyphs, glyph_variants); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(glyphs[0] == glyph_variants[0], "Unexpected glyph.\n");
ret = IDWriteFontFace1_HasVerticalGlyphVariants(fontface1); @@ -10143,7 +10140,7 @@ static void test_GetVerticalGlyphVariants(void)
IDWriteFontFace1_Release(fontface1); refcount = IDWriteFactory_Release(factory); - ok(!refcount, "Factory not released, refcount %u.\n", refcount); + ok(!refcount, "Factory not released, refcount %lu.\n", refcount); }
static HANDLE get_collection_expiration_event(IDWriteFontCollection *collection) @@ -10153,7 +10150,7 @@ static HANDLE get_collection_expiration_event(IDWriteFontCollection *collection) HRESULT hr;
hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection3, (void **)&collection3); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); event = IDWriteFontCollection3_GetExpirationEvent(collection3); IDWriteFontCollection3_Release(collection3);
@@ -10172,7 +10169,7 @@ static void test_expiration_event(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection3, (void **)&collection3); if (FAILED(hr)) @@ -10192,7 +10189,7 @@ static void test_expiration_event(void) factory2 = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory2, &collection2, FALSE); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); event2 = get_collection_expiration_event(collection2); todo_wine { ok(!!event2, "Unexpected event handle.\n"); @@ -10225,17 +10222,17 @@ static void test_family_font_set(void) factory = create_factory();
hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(IDWriteFontFamily_QueryInterface(family, &IID_IDWriteFontFamily2, (void **)&family2))) { hr = IDWriteFontFamily2_GetFontSet(family2, &fontset); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteFontFamily2_GetFontSet(family2, &fontset2); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fontset != fontset2, "Unexpected fontset instance.\n");
count = IDWriteFontSet1_GetFontCount(fontset); @@ -10244,37 +10241,37 @@ static void test_family_font_set(void) exists = TRUE; values = (void *)0xdeadbeef; hr = IDWriteFontSet1_GetPropertyValues(fontset, 0, 100, &exists, &values); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + ok(FAILED(hr), "Unexpected hr %#lx.\n", hr); ok(!exists && !values, "Unexpected return value.\n");
/* Invalid index. */ exists = TRUE; values = (void *)0xdeadbeef; hr = IDWriteFontSet1_GetPropertyValues(fontset, count, DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME, &exists, &values); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + ok(FAILED(hr), "Unexpected hr %#lx.\n", hr); ok(!exists && !values, "Unexpected return value.\n");
exists = TRUE; values = (void *)0xdeadbeef; hr = IDWriteFontSet1_GetPropertyValues(fontset, count, 100, &exists, &values); - ok(FAILED(hr), "Unexpected hr %#x.\n", hr); + ok(FAILED(hr), "Unexpected hr %#lx.\n", hr); ok(!exists && !values, "Unexpected return value.\n");
hr = IDWriteFontSet1_GetPropertyValues(fontset, 0, DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME, &exists, &values); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(exists == !!values, "Unexpected return value.\n"); if (values) { hr = IDWriteLocalizedStrings_GetString(values, 0, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteLocalizedStrings_Release(values); }
hr = IDWriteFontSet1_CreateFontResource(fontset, 100, &resource); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontSet1_CreateFontResource(fontset, 0, &resource); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontResource_Release(resource);
IDWriteFontSet1_Release(fontset2); @@ -10309,7 +10306,7 @@ static void test_system_font_set(void) }
hr = IDWriteFactory3_GetSystemFontSet(factory, &fontset); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontSet_GetFontCount(fontset); ok(!!count, "Unexpected font count %u.\n", count); @@ -10318,15 +10315,15 @@ static void test_system_font_set(void) p.propertyValue = L"Tahoma"; p.localeName = L""; hr = IDWriteFontSet_GetMatchingFonts(fontset, &p, 1, &filtered_set); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontSet_GetFontCount(filtered_set); ok(!!count, "Unexpected font count %u.\n", count);
hr = IDWriteFontSet_GetFontFaceReference(filtered_set, 0, &ref); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFace3_Release(fontface); IDWriteFontFaceReference_Release(ref); @@ -10359,33 +10356,33 @@ static void test_CreateFontCollectionFromFontSet(void) }
hr = IDWriteFactory5_CreateFontSetBuilder(factory, &builder); - ok(hr == S_OK, "Failed to create font set builder, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create font set builder, hr %#lx.\n", hr);
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory5_CreateFontFileReference(factory, path, NULL, &file); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFontSetBuilder1_AddFontFile(builder, file); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
/* Add same file, with explicit properties. */ hr = IDWriteFactory5_CreateFontFaceReference_(factory, file, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); props[0].propertyId = DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FAMILY_NAME; props[0].propertyValue = L"Another Font"; props[0].localeName = L"en-US"; hr = IDWriteFontSetBuilder1_AddFontFaceReference_(builder, ref, props, 1); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); IDWriteFontFaceReference_Release(ref);
hr = IDWriteFontSetBuilder1_CreateFontSet(builder, &fontset); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
hr = IDWriteFactory5_CreateFontCollectionFromFontSet(factory, fontset, &collection); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr);
if (SUCCEEDED(hr)) { @@ -10395,7 +10392,7 @@ if (SUCCEEDED(hr)) /* Explicit fontset properties are prioritized and not replaced by actual properties from a file. */ exists = FALSE; hr = IDWriteFontCollection1_FindFamilyName(collection, L"Another Font", &index, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n",hr); ok(!!exists, "Unexpected return value %d.\n", exists);
IDWriteFontCollection1_Release(collection); @@ -10428,14 +10425,14 @@ static void test_GetMatchingFontsByLOGFONT(void) }
hr = IDWriteFactory3_GetSystemFontSet(factory, &systemset); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
interop = NULL; hr = IDWriteFactory3_GetGdiInterop(factory, &interop0); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop_QueryInterface(interop0, &IID_IDWriteGdiInterop1, (void **)&interop); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteGdiInterop_Release(interop0);
memset(&logfont, 0, sizeof(logfont)); @@ -10446,16 +10443,16 @@ static void test_GetMatchingFontsByLOGFONT(void) lstrcpyW(logfont.lfFaceName, L"tahoma");
hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, NULL, systemset, &set); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, &logfont, NULL, &set); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, &logfont, systemset, &set); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteFontSet_GetFontCount(set); - ok(count > 0, "Unexpected count %u.\n", count); + ok(count > 0, "Unexpected count %lu.\n", count);
IDWriteFontSet_Release(set);
@@ -10463,7 +10460,7 @@ static void test_GetMatchingFontsByLOGFONT(void) IDWriteFontSet_Release(systemset);
refcount = IDWriteFactory3_Release(factory); - ok(!refcount, "Factory wasn't released, %u.\n", refcount); + ok(!refcount, "Factory wasn't released, %lu.\n", refcount); }
START_TEST(font) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 95166376ac7..c77c6ff2034 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -216,10 +216,10 @@ static void get_script_analysis(const WCHAR *str, UINT32 len, DWRITE_SCRIPT_ANAL
factory = create_factory(); hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &analysissource, 0, len, &analysissink.IDWriteTextAnalysisSink_iface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
*sa = analysissink.sa; IDWriteFactory_Release(factory); @@ -237,16 +237,16 @@ static IDWriteFontFace *get_fontface_from_format(IDWriteTextFormat *format) HRESULT hr;
hr = IDWriteTextFormat_GetFontCollection(format, &collection); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetFontFamilyName(format, nameW, ARRAY_SIZE(nameW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_FindFamilyName(collection, nameW, &index, &exists); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(collection, index, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontCollection_Release(collection);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, @@ -254,10 +254,10 @@ static IDWriteFontFace *get_fontface_from_format(IDWriteTextFormat *format) IDWriteTextFormat_GetFontStretch(format), IDWriteTextFormat_GetFontStyle(format), &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFont_Release(font); IDWriteFontFamily_Release(family); @@ -271,7 +271,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line) ULONG rc; IUnknown_AddRef(obj); rc = IUnknown_Release(obj); - ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); + ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc); }
enum drawcall_modifiers_kind { @@ -913,60 +913,60 @@ static void test_CreateTextLayout(void)
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, NULL, 0, NULL, 0.0f, 0.0f, &layout); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 0.0f, 0.0f, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 1.0f, 0.0f, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 0.0f, 1.0f, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, NULL, 1000.0f, 1000.0f, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, NULL, 0, format, 100.0f, 100.0f, &layout); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void *)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, -100.0f, 100.0f, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, -100.0f, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef; hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, -100.0f, -100.0f, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "Unexpected pointer %p.\n", layout);
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 0, format, 0.0f, 0.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextLayout_Release(layout);
EXPECT_REF(format, 1); hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); EXPECT_REF(format, 1);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2); @@ -976,33 +976,33 @@ static void test_CreateTextLayout(void) IDWriteTextFormat *format;
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextLayout1, (void**)&layout1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteTextLayout1_Release(layout1);
EXPECT_REF(layout2, 2); hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void**)&format1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(layout2, 3);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat, (void**)&format); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(format == (IDWriteTextFormat*)format1, "got %p, %p\n", format, format1); ok(format != (IDWriteTextFormat*)layout2, "got %p, %p\n", format, layout2); EXPECT_REF(layout2, 4);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextLayout1, (void**)&layout1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteTextLayout1_Release(layout1);
IDWriteTextFormat1_Release(format1); IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat1, (void**)&format1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(layout2, 3);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&format); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(format == (IDWriteTextFormat*)format1, "got %p, %p\n", format, format1); EXPECT_REF(layout2, 4);
@@ -1015,7 +1015,7 @@ static void test_CreateTextLayout(void) if (layout2 && SUCCEEDED(IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextLayout4, (void **)&layout4))) { hr = IDWriteTextLayout4_QueryInterface(layout4, &IID_IDWriteTextFormat3, (void **)&format3); - ok(hr == S_OK, "Failed to get text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get text format, hr %#lx.\n", hr); IDWriteTextFormat3_Release(format3); } else @@ -1051,65 +1051,65 @@ static void test_CreateGdiCompatibleTextLayout(void)
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, NULL, 0.0f, 0.0f, 0.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 0.0f, 0.0f, 0.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 1.0f, 0.0f, 0.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 1.0f, 0.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, NULL, 1000.0f, 1000.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
/* create with text format */ hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr); EXPECT_REF(format, 1);
layout = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "got %p\n", layout);
layout = (void *)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, -100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, -100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "Unexpected pointer %p.\n", layout);
layout = (void *)0xdeadbeef; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, -100.0f, -100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(layout == NULL, "Unexpected pointer %p.\n", layout);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); EXPECT_REF(format, 1); EXPECT_REF(layout, 1);
@@ -1122,7 +1122,7 @@ static void test_CreateGdiCompatibleTextLayout(void) /* zero length string is okay */ hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 0, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
dimension = IDWriteTextLayout_GetMaxWidth(layout); ok(dimension == 100.0, "got %f\n", dimension); @@ -1135,12 +1135,12 @@ static void test_CreateGdiCompatibleTextLayout(void) /* negative, zero ppdip */ hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 1, format, 100.0f, 100.0f, -1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextLayout_Release(layout);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 1, format, 100.0f, 100.0f, 0.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextLayout_Release(layout);
/* transforms */ @@ -1148,7 +1148,7 @@ static void test_CreateGdiCompatibleTextLayout(void) { hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 1, format, 100.0f, 100.0f, 1.0f, &layoutcreate_transforms[i], FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextLayout_Release(layout); }
@@ -1177,45 +1177,45 @@ static void test_CreateTextFormat(void) /* zero/negative font size */ hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 0.0f, L"en-us", &format); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, -10.0f, L"en-us", &format); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid font properties */ hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, 1000, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_ITALIC + 1, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_ITALIC, 10, 10.0f, L"en-us", &format); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* empty family name */ hr = IDWriteFactory_CreateTextFormat(factory, L"", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr); IDWriteTextFormat_Release(format);
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
if (0) /* crashes on native */ hr = IDWriteTextFormat_GetFontCollection(format, NULL);
collection = NULL; hr = IDWriteTextFormat_GetFontCollection(format, &collection); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(collection != NULL, "got %p\n", collection);
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscoll, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(collection == syscoll, "got %p, was %p\n", syscoll, collection); IDWriteFontCollection_Release(syscoll); IDWriteFontCollection_Release(collection); @@ -1237,7 +1237,7 @@ static void test_CreateTextFormat(void) ok(flow == DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM, "got %d\n", flow);
hr = IDWriteTextFormat_GetLineSpacing(format, &method, &spacing, &baseline); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(spacing == 0.0, "got %f\n", spacing); ok(baseline == 0.0, "got %f\n", baseline); ok(method == DWRITE_LINE_SPACING_METHOD_DEFAULT, "got %d\n", method); @@ -1247,7 +1247,7 @@ static void test_CreateTextFormat(void) trimming.delimiterCount = 10; trimmingsign = (void*)0xdeadbeef; hr = IDWriteTextFormat_GetTrimming(format, &trimming, &trimmingsign); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(trimming.granularity == DWRITE_TRIMMING_GRANULARITY_NONE, "got %d\n", trimming.granularity); ok(trimming.delimiter == 0, "got %d\n", trimming.delimiter); ok(trimming.delimiterCount == 0, "got %d\n", trimming.delimiterCount); @@ -1255,39 +1255,39 @@ static void test_CreateTextFormat(void)
/* setters */ hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_JUSTIFIED+1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_NEAR); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_CENTER+1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_CHARACTER+1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetTrimming(format, &trimming, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid granularity */ trimming.granularity = 10; trimming.delimiter = 0; trimming.delimiterCount = 0; hr = IDWriteTextFormat_SetTrimming(format, &trimming, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); @@ -1306,28 +1306,28 @@ static void test_GetLocaleName(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 0, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&format2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
len = IDWriteTextFormat_GetLocaleNameLength(format2); ok(len == 2, "got %u\n", len); len = IDWriteTextFormat_GetLocaleNameLength(format); ok(len == 2, "got %u\n", len); hr = IDWriteTextFormat_GetLocaleName(format2, buff, len); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); hr = IDWriteTextFormat_GetLocaleName(format2, buff, len+1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buff, L"ru"), "Unexpected locale name %s.\n", wine_dbgstr_w(buff)); hr = IDWriteTextFormat_GetLocaleName(format, buff, len); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); hr = IDWriteTextFormat_GetLocaleName(format, buff, len+1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buff, L"ru"), "Unexpected locale name %s.\n", wine_dbgstr_w(buff));
IDWriteTextLayout_Release(layout); @@ -1356,20 +1356,20 @@ static void test_CreateEllipsisTrimmingSign(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-GB", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
sign = (void *)0xdeadbeef; hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, NULL, &sign); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(!sign, "Unexpected pointer %p.\n", sign);
EXPECT_REF(format, 1); hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(format, 1);
hr = IDWriteInlineObject_QueryInterface(sign, &IID_IDWriteTextLayout, (void**)&unk); - ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
if (0) {/* crashes on native */ hr = IDWriteInlineObject_GetBreakConditions(sign, NULL, NULL); @@ -1380,7 +1380,7 @@ if (0) {/* crashes on native */ metrics.baseline = 123.0; metrics.supportsSideways = TRUE; hr = IDWriteInlineObject_GetMetrics(sign, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(metrics.width > 0.0, "got %.2f\n", metrics.width); ok(metrics.height == 0.0, "got %.2f\n", metrics.height); ok(metrics.baseline == 0.0, "got %.2f\n", metrics.baseline); @@ -1388,14 +1388,14 @@ if (0) {/* crashes on native */
before = after = DWRITE_BREAK_CONDITION_CAN_BREAK; hr = IDWriteInlineObject_GetBreakConditions(sign, &before, &after); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(before == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", before); ok(after == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", after);
/* Draw tests */ flush_sequence(sequences, RENDERER_ID); hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0, 0.0, FALSE, FALSE, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw test", FALSE);
effect = create_test_effect(); @@ -1403,7 +1403,7 @@ if (0) {/* crashes on native */ EXPECT_REF(effect, 1); flush_sequence(sequences, RENDERER_ID); hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0f, 0.0f, FALSE, FALSE, effect); - ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw with effect test", FALSE); EXPECT_REF(effect, 1);
@@ -1411,39 +1411,39 @@ if (0) {/* crashes on native */
flush_sequence(sequences, RENDERER_ID); hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0f, 0.0f, FALSE, FALSE, (void *)0xdeadbeef); - ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw with effect test", FALSE);
memset(&ctxt, 0, sizeof(ctxt)); hr = IDWriteInlineObject_Draw(sign, &ctxt, &testrenderer, 123.0f, 456.0f, FALSE, FALSE, NULL); - ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr); ok(ctxt.originX == 123.0f && ctxt.originY == 456.0f, "Unexpected drawing origin\n");
IDWriteInlineObject_Release(sign);
/* Centered format */ hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_CENTER); - ok(hr == S_OK, "Failed to set text alignment, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set text alignment, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&ctxt, 0, sizeof(ctxt)); hr = IDWriteInlineObject_Draw(sign, &ctxt, &testrenderer, 123.0f, 456.0f, FALSE, FALSE, NULL); - ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to draw trimming sign, hr %#lx.\n", hr); ok(ctxt.originX == 123.0f && ctxt.originY == 456.0f, "Unexpected drawing origin\n");
IDWriteInlineObject_Release(sign);
/* non-orthogonal flow/reading combination */ hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT); - ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista, win7 */, "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista, win7 */, "Unexpected hr %#lx.\n", hr); if (hr == S_OK) { hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); - ok(hr == DWRITE_E_FLOWDIRECTIONCONFLICTS, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_FLOWDIRECTIONCONFLICTS, "Unexpected hr %#lx.\n", hr); }
IDWriteTextFormat_Release(format); @@ -1464,31 +1464,31 @@ static void test_fontweight(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0, L"ru", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&fmt2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
weight = IDWriteTextFormat_GetFontWeight(fmt2); ok(weight == DWRITE_FONT_WEIGHT_BOLD, "got %u\n", weight);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == ~0u, "got %u, %u\n", range.startPosition, range.length);
range.startPosition = 0; range.length = 6; hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == 6, "got %u, %u\n", range.startPosition, range.length);
/* IDWriteTextFormat methods output doesn't reflect layout changes */ @@ -1498,32 +1498,32 @@ static void test_fontweight(void) range.length = 0; weight = DWRITE_FONT_WEIGHT_BOLD; hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "got %d\n", weight); ok(range.length == 6, "got %d\n", range.length);
range.startPosition = 0; range.length = 6; hr = IDWriteTextLayout_SetFontWeight(layout, 1000, range); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout); ok(size == 100.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxWidth(layout, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout); ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxWidth(layout, -1.0); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout); ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxWidth(layout, 100.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxWidth(layout); ok(size == 100.0, "got %.2f\n", size); @@ -1532,19 +1532,19 @@ static void test_fontweight(void) ok(size == 100.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxHeight(layout, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxHeight(layout); ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxHeight(layout, -1.0); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxHeight(layout); ok(size == 0.0, "got %.2f\n", size);
hr = IDWriteTextLayout_SetMaxHeight(layout, 100.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = IDWriteTextLayout_GetMaxHeight(layout); ok(size == 100.0, "got %.2f\n", size); @@ -1568,42 +1568,42 @@ static void test_SetInlineObject(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(inlineobj, 1); EXPECT_REF(inlineobj2, 1);
inlinetest = (void*)0x1; hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == NULL, "got %p\n", inlinetest);
range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(inlineobj, 2);
inlinetest = (void*)0x1; hr = IDWriteTextLayout_GetInlineObject(layout, 2, &inlinetest, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == NULL, "got %p\n", inlinetest);
inlinetest = NULL; r2.startPosition = r2.length = 100; hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == inlineobj, "got %p\n", inlinetest); ok(r2.startPosition == 0 && r2.length == 2, "got %d, %d\n", r2.startPosition, r2.length); IDWriteInlineObject_Release(inlinetest); @@ -1614,7 +1614,7 @@ static void test_SetInlineObject(void) inlinetest = NULL; r2.startPosition = r2.length = 100; hr = IDWriteTextLayout_GetInlineObject(layout, 1, &inlinetest, &r2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == inlineobj, "got %p\n", inlinetest); ok(r2.startPosition == 0 && r2.length == 2, "got %d, %d\n", r2.startPosition, r2.length); IDWriteInlineObject_Release(inlinetest); @@ -1624,12 +1624,12 @@ static void test_SetInlineObject(void) range.startPosition = 1; range.length = 1; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj2, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
inlinetest = NULL; r2.startPosition = r2.length = 100; hr = IDWriteTextLayout_GetInlineObject(layout, 1, &inlinetest, &r2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == inlineobj2, "got %p\n", inlinetest); ok(r2.startPosition == 1 && r2.length == 1, "got %d, %d\n", r2.startPosition, r2.length); IDWriteInlineObject_Release(inlinetest); @@ -1640,7 +1640,7 @@ static void test_SetInlineObject(void) inlinetest = NULL; r2.startPosition = r2.length = 100; hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == inlineobj, "got %p\n", inlinetest); ok(r2.startPosition == 0 && r2.length == 1, "got %d, %d\n", r2.startPosition, r2.length); IDWriteInlineObject_Release(inlinetest); @@ -1650,11 +1650,11 @@ static void test_SetInlineObject(void) range.startPosition = 1; range.length = 1; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r2.startPosition = r2.length = 100; hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == inlineobj, "got %p\n", inlinetest); ok(r2.startPosition == 0 && r2.length == 2, "got %d, %d\n", r2.startPosition, r2.length); IDWriteInlineObject_Release(inlinetest); @@ -1664,13 +1664,13 @@ static void test_SetInlineObject(void) range.startPosition = 1; range.length = 2; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(inlineobj, 2);
r2.startPosition = r2.length = 100; hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, &r2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inlinetest == inlineobj, "got %p\n", inlinetest); ok(r2.startPosition == 0 && r2.length == 3, "got %d, %d\n", r2.startPosition, r2.length); IDWriteInlineObject_Release(inlinetest); @@ -1776,100 +1776,100 @@ static void test_Draw(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 5; range.length = 1; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 1; range.length = 1; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 4; range.length = 1; hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown*)inlineobj, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", FALSE); IDWriteTextLayout_Release(layout);
/* with reduced width DrawGlyphRun() is called for every line */ hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 5.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq2, "draw test 2", TRUE); hr = IDWriteTextLayout_GetMetrics(layout, &tm); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); todo_wine ok(tm.lineCount == 6, "got %u\n", tm.lineCount); IDWriteTextLayout_Release(layout);
/* string with control characters */ hr = IDWriteFactory_CreateTextLayout(factory, str2W, 4, format, 500.0, 100.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq3, "draw test 3", FALSE); IDWriteTextLayout_Release(layout);
/* strikethrough splits ranges from renderer point of view, but doesn't break shaping */ hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID);
range.startPosition = 0; range.length = 3; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq4, "draw test 4", FALSE); IDWriteTextLayout_Release(layout);
/* Strike through somewhere in the middle */ hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID);
range.startPosition = 2; range.length = 2; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq5, "draw test 5", FALSE); IDWriteTextLayout_Release(layout);
/* empty string */ hr = IDWriteFactory_CreateTextLayout(factory, L"string", 0, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, empty_seq, "draw test 6", FALSE); IDWriteTextLayout_Release(layout);
@@ -1879,26 +1879,26 @@ static void test_Draw(void) /* different parameter combinations with gdi-compatible layout */ hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL, TRUE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 7", FALSE);
/* text alignment keeps pixel-aligned origin */ hr = IDWriteTextLayout_GetMetrics(layout, &tm); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(tm.width == floorf(tm.width), "got %f\n", tm.width);
hr = IDWriteTextLayout_SetMaxWidth(layout, tm.width + 3.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_CENTER); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ctxt.originX = ctxt.originY = 0.0; flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 7", FALSE); ok(ctxt.originX != 0.0 && ctxt.originX == floorf(ctxt.originX), "got %f\n", ctxt.originX);
@@ -1909,10 +1909,10 @@ static void test_Draw(void)
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 8", FALSE); IDWriteTextLayout_Release(layout);
@@ -1923,10 +1923,10 @@ static void test_Draw(void) m.m12 = m.m21 = m.dx = m.dy = 0.0; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, &m, TRUE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 9", FALSE); IDWriteTextLayout_Release(layout);
@@ -1937,10 +1937,10 @@ static void test_Draw(void) m.m12 = m.m21 = m.dx = m.dy = 0.0; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, 1.0f, &m, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_single_run_seq, "draw test 10", FALSE); IDWriteTextLayout_Release(layout);
@@ -1948,18 +1948,18 @@ static void test_Draw(void)
/* text that triggers bidi run reordering */ hr = IDWriteFactory_CreateTextLayout(factory, str3W, lstrlenW(str3W), format, 1000.0f, 100.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ctxt.gdicompat = FALSE; ctxt.use_gdi_natural = FALSE; ctxt.snapping_disabled = TRUE;
hr = IDWriteTextLayout_SetReadingDirection(layout, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); - ok(hr == S_OK, "Failed to set reading direction, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set reading direction, hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0f, 0.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_ltr_reordered_run_seq, "draw test 11", FALSE);
IDWriteTextLayout_Release(layout); @@ -1979,12 +1979,12 @@ static void test_typography(void) factory = create_factory();
hr = IDWriteFactory_CreateTypography(factory, &typography); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING; feature.parameter = 1; hr = IDWriteTypography_AddFontFeature(typography, feature); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTypography_GetFontFeatureCount(typography); ok(count == 1, "got %u\n", count); @@ -1993,38 +1993,38 @@ static void test_typography(void) feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING; feature.parameter = 0; hr = IDWriteTypography_AddFontFeature(typography, feature); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTypography_GetFontFeatureCount(typography); ok(count == 2, "got %u\n", count);
memset(&feature, 0xcc, sizeof(feature)); hr = IDWriteTypography_GetFontFeature(typography, 0, &feature); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); ok(feature.parameter == 1, "got %u\n", feature.parameter);
memset(&feature, 0xcc, sizeof(feature)); hr = IDWriteTypography_GetFontFeature(typography, 1, &feature); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); ok(feature.parameter == 0, "got %u\n", feature.parameter);
hr = IDWriteTypography_GetFontFeature(typography, 2, &feature); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* duplicated with same parameter value */ feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING; feature.parameter = 0; hr = IDWriteTypography_AddFontFeature(typography, feature); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTypography_GetFontFeatureCount(typography); ok(count == 3, "got %u\n", count);
memset(&feature, 0xcc, sizeof(feature)); hr = IDWriteTypography_GetFontFeature(typography, 2, &feature); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); ok(feature.parameter == 0, "got %u\n", feature.parameter);
@@ -2062,27 +2062,27 @@ static void test_GetClusterMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, str3W, 7, format, 1000.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count == 7, "got %u\n", count); IDWriteTextLayout_Release(layout);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count == 4, "got %u\n", count);
/* check every cluster width */ count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 4, "got %u\n", count); for (i = 0; i < count; i++) { ok(metrics[i].width > 0.0, "%u: got width %.2f\n", i, metrics[i].width); @@ -2098,7 +2098,7 @@ static void test_GetClusterMetrics(void) leading = trailing = min_advance = 2.0; hr = IDWriteTextLayout1_GetCharacterSpacing(layout1, 500, &leading, &trailing, &min_advance, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(leading == 0.0 && trailing == 0.0 && min_advance == 0.0, "got %.2f, %.2f, %.2f\n", leading, trailing, min_advance); ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length); @@ -2106,18 +2106,18 @@ static void test_GetClusterMetrics(void) leading = trailing = min_advance = 2.0; hr = IDWriteTextLayout1_GetCharacterSpacing(layout1, 0, &leading, &trailing, &min_advance, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(leading == 0.0 && trailing == 0.0 && min_advance == 0.0, "got %.2f, %.2f, %.2f\n", leading, trailing, min_advance);
r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 10.0, 15.0, 0.0, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics2, ARRAY_SIZE(metrics2), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 4, "got %u\n", count); for (i = 0; i < count; ++i) { @@ -2130,13 +2130,13 @@ static void test_GetClusterMetrics(void) r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 0.0, 0.0, 0.0, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* negative advance limit */ r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout1_SetCharacterSpacing(layout1, 0.0, 0.0, -10.0, r); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout1_Release(layout1); } @@ -2144,28 +2144,28 @@ static void test_GetClusterMetrics(void) win_skip("IDWriteTextLayout1 is not supported, cluster spacing test skipped.\n");
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &trimm); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetInlineObject(layout, trimm, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* inline object takes a separate cluster, replaced codepoints number doesn't matter */ count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, NULL, 0, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count == 3, "got %u\n", count);
count = 0; memset(&metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count == 3, "got %u\n", count); ok(metrics[0].length == 2, "got %u\n", metrics[0].length);
hr = IDWriteInlineObject_GetMetrics(trimm, &inline_metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(inline_metrics.width > 0.0 && inline_metrics.width == metrics[0].width, "got %.2f, expected %.2f\n", inline_metrics.width, metrics[0].width);
@@ -2173,13 +2173,13 @@ static void test_GetClusterMetrics(void)
/* text with non-visual control codes */ hr = IDWriteFactory_CreateTextLayout(factory, str2W, 3, format, 1000.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* bidi control codes take a separate cluster */ count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 3, "got %u\n", count);
ok(metrics[0].width == 0.0, "got %.2f\n", metrics[0].width); @@ -2210,17 +2210,17 @@ static void test_GetClusterMetrics(void)
/* single inline object that fails to report its metrics */ hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
range.startPosition = 0; range.length = 4; hr = IDWriteTextLayout_SetInlineObject(layout, &testinlineobj, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count);
/* object sets a width to 123.0, but returns failure from GetMetrics() */ @@ -2236,12 +2236,12 @@ static void test_GetClusterMetrics(void) range.startPosition = 2; range.length = 2; hr = IDWriteTextLayout_SetInlineObject(layout, &testinlineobj2, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count);
ok(metrics[0].width == 0.0, "got %.2f\n", metrics[0].width); @@ -2264,23 +2264,23 @@ static void test_GetClusterMetrics(void)
/* zero length string */ hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 0, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 1; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 0, "got %u\n", count); IDWriteTextLayout_Release(layout);
/* Whitespace */ hr = IDWriteFactory_CreateTextLayout(factory, L"a ", 2, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 2, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count); ok(metrics[0].isWhitespace == 0, "got %d\n", metrics[0].isWhitespace); ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter); @@ -2290,17 +2290,17 @@ static void test_GetClusterMetrics(void)
/* Layout is fully covered by inline object with after condition DWRITE_BREAK_CONDITION_MAY_NOT_BREAK. */ hr = IDWriteFactory_CreateTextLayout(factory, L"a ", 2, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetInlineObject(layout, &testinlineobj3, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 2, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count); ok(metrics[0].canWrapLineAfter == 1, "got %d\n", metrics[0].canWrapLineAfter);
@@ -2308,12 +2308,12 @@ static void test_GetClusterMetrics(void)
/* compare natural cluster width with gdi layout */ hr = IDWriteFactory_CreateTextLayout(factory, L"a ", 1, format, 100.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count); ok(metrics[0].width != floorf(metrics[0].width), "got %f\n", metrics[0].width);
@@ -2321,12 +2321,12 @@ static void test_GetClusterMetrics(void)
hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"a ", 1, format, 100.0f, 100.0f, 1.0f, NULL, FALSE, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count); ok(metrics[0].width == floorf(metrics[0].width), "got %f\n", metrics[0].width);
@@ -2334,12 +2334,12 @@ static void test_GetClusterMetrics(void)
/* isNewline tests */ hr = IDWriteFactory_CreateTextLayout(factory, str5W, lstrlenW(str5W), format, 100.0f, 200.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 22, "got %u\n", count);
ok(metrics[1].isNewline == 1, "got %d\n", metrics[1].isNewline); @@ -2383,12 +2383,12 @@ static void test_GetClusterMetrics(void) /* Test whitespace resolution from linebreaking classes BK, ZW, and SP */ hr = IDWriteFactory_CreateTextLayout(factory, str_white_spaceW, ARRAY_SIZE(str_white_spaceW), format, 100.0f, 200.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 20, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 6, "got %u\n", count);
ok(metrics[0].isWhitespace == 1, "got %d\n", metrics[0].isWhitespace); @@ -2402,16 +2402,16 @@ static void test_GetClusterMetrics(void)
/* Trigger line trimming. */ hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 100.0f, 200.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 4, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 4, "got %u\n", count);
hr = IDWriteTextLayout_GetMetrics(layout, &text_metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
width = metrics[0].width + inline_metrics.width; ok(width < text_metrics.width, "unexpected trimming sign width\n"); @@ -2421,19 +2421,19 @@ static void test_GetClusterMetrics(void) trimming_options.delimiter = 0; trimming_options.delimiterCount = 0; hr = IDWriteTextLayout_SetTrimming(layout, &trimming_options, trimm); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetMaxWidth(layout, width); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 4, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 4, "got %u\n", count);
hr = IDWriteTextLayout_GetLineMetrics(layout, &line, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count); ok(line.length == 4, "got %u\n", line.length); ok(line.isTrimmed, "got %d\n", line.isTrimmed); @@ -2442,15 +2442,15 @@ static void test_GetClusterMetrics(void)
/* NO_WRAP, check cluster wrapping attribute. */ hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_NO_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a b", 3, format, 1000.0f, 200.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 3, "got %u\n", count);
ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter); @@ -2461,38 +2461,38 @@ static void test_GetClusterMetrics(void)
/* Single cluster layout, trigger trimming. */ hr = IDWriteFactory_CreateTextLayout(factory, L"a b", 1, format, 1000.0f, 200.0f, &layout); - ok(hr == S_OK, "Failed to create layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create layout, hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count); - ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr); ok(count == 1, "Unexpected cluster count %u.\n", count);
hr = IDWriteTextLayout_SetMaxWidth(layout, metrics[0].width / 2.0f); - ok(hr == S_OK, "Failed to set layout width, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set layout width, hr %#lx.\n", hr);
trimming_options.granularity = DWRITE_TRIMMING_GRANULARITY_CHARACTER; trimming_options.delimiter = 0; trimming_options.delimiterCount = 0; hr = IDWriteTextLayout_SetTrimming(layout, &trimming_options, trimm); - ok(hr == S_OK, "Failed to set trimming options, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set trimming options, hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 1, &count); - ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr); ok(count == 1, "Unexpected cluster count %u.\n", count);
hr = IDWriteTextLayout_GetLineMetrics(layout, &line, 1, &count); - ok(hr == S_OK, "Failed to get line metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get line metrics, hr %#lx.\n", hr); ok(count == 1, "Unexpected line count %u.\n", count); ok(line.length == 1, "Unexpected line length %u.\n", line.length); ok(line.isTrimmed, "Unexpected trimming flag %x.\n", line.isTrimmed);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f); - ok(hr == S_OK, "Draw() failed, hr %#x.\n", hr); + ok(hr == S_OK, "Draw() failed, hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draw_trimmed_seq, "Trimmed draw test", FALSE);
IDWriteTextLayout_Release(layout); @@ -2516,24 +2516,24 @@ static void test_SetLocaleName(void) /* create format with mixed case locale name, get it back */ hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"eN-uS", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetLocaleName(format, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat, (void**)&format2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_GetLocaleName(format2, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
IDWriteTextFormat_Release(format2); @@ -2542,25 +2542,25 @@ static void test_SetLocaleName(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetLocaleName(layout, L"en-us", range); - ok(hr == S_OK, "Failed to set locale name, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set locale name, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLocaleName(layout, NULL, range); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* invalid locale name is allowed */ hr = IDWriteTextLayout_SetLocaleName(layout, L"abcd", range); - ok(hr == S_OK, "Failed to set locale name, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set locale name, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLocaleName(layout, 0, NULL, 0, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
if (0) /* crashes on native */ hr = IDWriteTextLayout_GetLocaleName(layout, 0, NULL, 1, NULL); @@ -2568,14 +2568,14 @@ static void test_SetLocaleName(void) buffW[0] = 0; range.length = 0; hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"abcd"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW)); ok(range.startPosition == 0 && range.length == 1, "got %u,%u\n", range.startPosition, range.length);
/* get with a shorter buffer */ buffW[0] = 0xa; hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, 1, NULL); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(buffW[0] == 0, "got %x\n", buffW[0]);
/* name is too long */ @@ -2586,23 +2586,23 @@ static void test_SetLocaleName(void) range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetLocaleName(layout, buffW, range); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
buffW[0] = 0; hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"abcd"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW));
/* set initial locale name for whole text, except with a different casing */ range.startPosition = 0; range.length = 4; hr = IDWriteTextLayout_SetLocaleName(layout, L"eN-uS", range); - ok(hr == S_OK, "Failed to set locale name, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set locale name, hr %#lx.\n", hr);
buffW[0] = 0; range.length = 0; hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, ARRAY_SIZE(buffW), &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW)); ok((range.startPosition == 0 && range.length == ~0u) || broken(range.startPosition == 0 && range.length == 4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length); @@ -2611,7 +2611,7 @@ static void test_SetLocaleName(void) buffW[0] = 0; range.length = 0; hr = IDWriteTextLayout_GetLocaleName(layout, 100, buffW, ARRAY_SIZE(buffW), &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"en-us"), "Unexpected locale name %s.\n", wine_dbgstr_w(buffW)); ok((range.startPosition == 0 && range.length == ~0u) || broken(range.startPosition == 4 && range.length == ~0u-4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length); @@ -2638,10 +2638,10 @@ static void test_SetPairKerning(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 1000.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout1, (void**)&layout1); @@ -2659,19 +2659,19 @@ if (0) { /* crashes on native */ }
hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &kerning, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 0; kerning = TRUE; hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &kerning, &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!kerning, "got %d\n", kerning); ok(range.length == ~0u, "got %u\n", range.length);
count = 0; hr = IDWriteTextLayout1_GetClusterMetrics(layout1, clusters, 4, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 3, "Unexpected cluster count %u.\n", count); ok(clusters[0].length == 1, "got %u\n", clusters[0].length); ok(clusters[1].length == 2, "got %u\n", clusters[1].length); @@ -2682,16 +2682,16 @@ if (0) { /* crashes on native */ range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout1_SetPairKerning(layout1, 2, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
kerning = FALSE; hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &kerning, &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(kerning == TRUE, "got %d\n", kerning);
count = 0; hr = IDWriteTextLayout1_GetClusterMetrics(layout1, clusters, 4, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 4, "got %u\n", count); ok(clusters[0].length == 1, "got %u\n", clusters[0].length); ok(clusters[1].length == 1, "got %u\n", clusters[1].length); @@ -2716,10 +2716,10 @@ static void test_SetVerticalGlyphOrientation(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2); @@ -2735,16 +2735,16 @@ static void test_SetVerticalGlyphOrientation(void) ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT, "got %d\n", orientation);
hr = IDWriteTextLayout2_SetVerticalGlyphOrientation(layout2, DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED+1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void **)&format1); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
orientation = IDWriteTextFormat1_GetVerticalGlyphOrientation(format1); ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT, "Unexpected orientation %d.\n", orientation);
hr = IDWriteTextLayout2_SetVerticalGlyphOrientation(layout2, DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
orientation = IDWriteTextLayout2_GetVerticalGlyphOrientation(layout2); ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED, "Unexpected orientation %d.\n", orientation); @@ -2753,7 +2753,7 @@ static void test_SetVerticalGlyphOrientation(void) ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED, "Unexpected orientation %d.\n", orientation);
hr = IDWriteTextFormat1_SetVerticalGlyphOrientation(format1, DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
orientation = IDWriteTextLayout2_GetVerticalGlyphOrientation(layout2); ok(orientation == DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT, "Unexpected orientation %d.\n", orientation); @@ -2787,22 +2787,22 @@ static void test_DetermineMinWidth(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_DetermineMinWidth(layout, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); IDWriteTextLayout_Release(layout);
/* empty string */ hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 0, format, 100.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
minwidth = 1.0f; hr = IDWriteTextLayout_DetermineMinWidth(layout, &minwidth); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(minwidth == 0.0f, "got %f\n", minwidth); IDWriteTextLayout_Release(layout);
@@ -2811,10 +2811,10 @@ static void test_DetermineMinWidth(void)
/* measure expected width */ hr = IDWriteFactory_CreateTextLayout(factory, minwidth_tests[i].mintext, lstrlenW(minwidth_tests[i].mintext), format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (j = 0; j < count; j++) width += metrics[j].width; @@ -2822,11 +2822,11 @@ static void test_DetermineMinWidth(void) IDWriteTextLayout_Release(layout);
hr = IDWriteFactory_CreateTextLayout(factory, minwidth_tests[i].text, lstrlenW(minwidth_tests[i].text), format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
minwidth = 0.0f; hr = IDWriteTextLayout_DetermineMinWidth(layout, &minwidth); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(minwidth == width, "test %u: expected width %f, got %f\n", i, width, minwidth);
IDWriteTextLayout_Release(layout); @@ -2849,76 +2849,76 @@ static void test_SetFontSize(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* negative/zero size */ r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontSize(layout, -15.0, r); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetFontSize(layout, 0.0, r); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1; r.length = 0; size = 0.0; hr = IDWriteTextLayout_GetFontSize(layout, 0, &size, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length); ok(size == 10.0, "got %.2f\n", size);
r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontSize(layout, 15.0, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */ r.startPosition = 1; r.length = 0; hr = IDWriteTextLayout_SetFontSize(layout, 123.0, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = 0.0; hr = IDWriteTextLayout_GetFontSize(layout, 1, &size, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(size == 15.0, "got %.2f\n", size);
r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout_SetFontSize(layout, 15.0, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = 0.0; hr = IDWriteTextLayout_GetFontSize(layout, 1, &size, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(size == 15.0, "got %.2f\n", size);
size = 0.0; hr = IDWriteTextLayout_GetFontSize(layout, 0, &size, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(size == 15.0, "got %.2f\n", size);
size = 15.0; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetFontSize(layout, 20, &size, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 4 && r.length == ~0u-4, "got %u, %u\n", r.startPosition, r.length); ok(size == 10.0, "got %.2f\n", size);
r.startPosition = 100; r.length = 4; hr = IDWriteTextLayout_SetFontSize(layout, 25.0, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = 15.0; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetFontSize(layout, 100, &size, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(size == 25.0, "got %.2f\n", size);
@@ -2940,63 +2940,63 @@ static void test_SetFontFamilyName(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* NULL name */ r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontFamilyName(layout, NULL, r); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1; r.length = 0; nameW[0] = 0; hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length);
/* set name only different in casing */ r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"TaHoma", r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */ r.startPosition = 1; r.length = 0; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Arial", r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 0; r.length = 0; nameW[0] = 0; hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(nameW, L"TaHoma"), "Unexpected family name %s.\n", wine_dbgstr_w(nameW)); ok(r.startPosition == 1 && r.length == 1, "got %u, %u\n", r.startPosition, r.length);
r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Arial", r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1; r.length = 0; hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 1 && r.length == 1, "got %u, %u\n", r.startPosition, r.length);
r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Arial", r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
nameW[0] = 0; hr = IDWriteTextLayout_GetFontFamilyName(layout, 1, nameW, ARRAY_SIZE(nameW), &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(!lstrcmpW(nameW, L"Arial"), "Unexpected family name %s.\n", wine_dbgstr_w(nameW));
@@ -3018,72 +3018,72 @@ static void test_SetFontStyle(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* invalid style value */ r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC+1, r); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1; r.length = 0; hr = IDWriteTextLayout_GetFontStyle(layout, 0, &style, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length); ok(style == DWRITE_FONT_STYLE_NORMAL, "got %d\n", style);
r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */ r.startPosition = 1; r.length = 0; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_NORMAL, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
style = DWRITE_FONT_STYLE_NORMAL; hr = IDWriteTextLayout_GetFontStyle(layout, 1, &style, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(style == DWRITE_FONT_STYLE_ITALIC, "got %d\n", style);
r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_OBLIQUE, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
style = DWRITE_FONT_STYLE_ITALIC; hr = IDWriteTextLayout_GetFontStyle(layout, 1, &style, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %d\n", style);
style = DWRITE_FONT_STYLE_ITALIC; hr = IDWriteTextLayout_GetFontStyle(layout, 0, &style, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %d\n", style);
style = DWRITE_FONT_STYLE_ITALIC; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetFontStyle(layout, 20, &style, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 4 && r.length == ~0u-4, "got %u, %u\n", r.startPosition, r.length); ok(style == DWRITE_FONT_STYLE_NORMAL, "got %d\n", style);
r.startPosition = 100; r.length = 4; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_OBLIQUE, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
style = DWRITE_FONT_STYLE_NORMAL; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetFontStyle(layout, 100, &style, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %d\n", style);
@@ -3105,73 +3105,73 @@ static void test_SetFontStretch(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* invalid stretch value */ r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_ULTRA_EXPANDED+1, r); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1; r.length = 0; stretch = DWRITE_FONT_STRETCH_UNDEFINED; hr = IDWriteTextLayout_GetFontStretch(layout, 0, &stretch, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length); ok(stretch == DWRITE_FONT_STRETCH_NORMAL, "got %d\n", stretch);
r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* zero length range */ r.startPosition = 1; r.length = 0; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_NORMAL, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stretch = DWRITE_FONT_STRETCH_UNDEFINED; hr = IDWriteTextLayout_GetFontStretch(layout, 1, &stretch, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(stretch == DWRITE_FONT_STRETCH_CONDENSED, "got %d\n", stretch);
r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_EXPANDED, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stretch = DWRITE_FONT_STRETCH_UNDEFINED; hr = IDWriteTextLayout_GetFontStretch(layout, 1, &stretch, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(stretch == DWRITE_FONT_STRETCH_EXPANDED, "got %d\n", stretch);
stretch = DWRITE_FONT_STRETCH_UNDEFINED; hr = IDWriteTextLayout_GetFontStretch(layout, 0, &stretch, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(stretch == DWRITE_FONT_STRETCH_EXPANDED, "got %d\n", stretch);
stretch = DWRITE_FONT_STRETCH_UNDEFINED; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetFontStretch(layout, 20, &stretch, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 4 && r.length == ~0u-4, "got %u, %u\n", r.startPosition, r.length); ok(stretch == DWRITE_FONT_STRETCH_NORMAL, "got %d\n", stretch);
r.startPosition = 100; r.length = 4; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_EXPANDED, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stretch = DWRITE_FONT_STRETCH_UNDEFINED; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetFontStretch(layout, 100, &stretch, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(stretch == DWRITE_FONT_STRETCH_EXPANDED, "got %d\n", stretch);
@@ -3179,7 +3179,7 @@ static void test_SetFontStretch(void) r.startPosition = 0; r.length = 2; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_UNDEFINED, r); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); @@ -3199,46 +3199,46 @@ static void test_SetStrikethrough(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
r.startPosition = 1; r.length = 0; value = TRUE; hr = IDWriteTextLayout_GetStrikethrough(layout, 0, &value, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 0 && r.length == ~0u, "got %u, %u\n", r.startPosition, r.length); ok(value == FALSE, "got %d\n", value);
r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = FALSE; hr = IDWriteTextLayout_GetStrikethrough(layout, 1, &value, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(value == TRUE, "got %d\n", value); ok(r.startPosition == 1 && r.length == 1, "got %u, %u\n", r.startPosition, r.length);
value = TRUE; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetStrikethrough(layout, 20, &value, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 2 && r.length == ~0u-2, "got %u, %u\n", r.startPosition, r.length); ok(value == FALSE, "got %d\n", value);
r.startPosition = 100; r.length = 4; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = FALSE; r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetStrikethrough(layout, 100, &value, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 100 && r.length == 4, "got %u, %u\n", r.startPosition, r.length); ok(value == TRUE, "got %d\n", value);
@@ -3263,21 +3263,21 @@ static void test_GetMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 4, "got %u\n", count); for (i = 0, width = 0.0; i < count; i++) width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics)); hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(metrics.left == 0.0, "got %.2f\n", metrics.left); ok(metrics.top == 0.0, "got %.2f\n", metrics.top); ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width); @@ -3293,12 +3293,12 @@ static void test_GetMetrics(void)
/* a string with more complex bidi sequence */ hr = IDWriteFactory_CreateTextLayout(factory, str2W, 7, format, 500.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&metrics, 0xcc, sizeof(metrics)); metrics.maxBidiReorderingDepth = 0; hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(metrics.left == 0.0, "got %.2f\n", metrics.left); ok(metrics.top == 0.0, "got %.2f\n", metrics.top); ok(metrics.width > 0.0, "got %.2f\n", metrics.width); @@ -3314,16 +3314,16 @@ static void test_GetMetrics(void)
/* single cluster layout */ hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count);
memset(&metrics, 0xcc, sizeof(metrics)); hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(metrics.left == 0.0, "got %.2f\n", metrics.left); ok(metrics.top == 0.0, "got %.2f\n", metrics.top); ok(metrics.width == clusters[0].width, "got %.2f, expected %.2f\n", metrics.width, clusters[0].width); @@ -3337,11 +3337,11 @@ static void test_GetMetrics(void)
/* Whitespace only. */ hr = IDWriteFactory_CreateTextLayout(factory, L" ", 1, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
memset(&metrics, 0xcc, sizeof(metrics)); hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "Failed to get layout metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get layout metrics, hr %#lx.\n", hr); ok(metrics.left == 0.0f, "Unexpected value for left %f.\n", metrics.left); ok(metrics.top == 0.0f, "Unexpected value for top %f.\n", metrics.top); ok(metrics.width == 0.0f, "Unexpected width %f.\n", metrics.width); @@ -3371,7 +3371,7 @@ static void test_SetFlowDirection(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
flow = IDWriteTextFormat_GetFlowDirection(format); ok(flow == DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM, "got %d\n", flow); @@ -3380,25 +3380,25 @@ static void test_SetFlowDirection(void) ok(reading == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", reading);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextLayout_Release(layout);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT); - ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista,win7 */, "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* vista,win7 */, "Unexpected hr %#lx.\n", hr); if (hr == S_OK) { hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextLayout_Release(layout);
hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_TOP_TO_BOTTOM); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextLayout_Release(layout); } else @@ -3448,28 +3448,28 @@ static void test_SetDrawingEffect(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* string with combining mark */ hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* set effect past the end of text */ r.startPosition = 100; r.length = 10; hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = r.length = 0; hr = IDWriteTextLayout_GetDrawingEffect(layout, 101, &unk, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 100 && r.length == 10, "got %u, %u\n", r.startPosition, r.length); IUnknown_Release(unk);
r.startPosition = r.length = 0; unk = (void*)0xdeadbeef; hr = IDWriteTextLayout_GetDrawingEffect(layout, 1000, &unk, &r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(r.startPosition == 110 && r.length == ~0u-110, "got %u, %u\n", r.startPosition, r.length); ok(unk == NULL, "got %p\n", unk);
@@ -3477,84 +3477,84 @@ static void test_SetDrawingEffect(void) r.startPosition = 0; r.length = 2; hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draweffect_seq, "effect draw test", TRUE); IDWriteTextLayout_Release(layout);
/* simple string */ hr = IDWriteFactory_CreateTextLayout(factory, L"aecd", 4, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
r.startPosition = 0; r.length = 2; hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draweffect2_seq, "effect draw test 2", FALSE); IDWriteTextLayout_Release(layout);
/* Inline object - effect set for same range */ hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"aecd", 4, format, 500.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout_SetInlineObject(layout, sign, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draweffect3_seq, "effect draw test 3", FALSE);
/* now set effect somewhere inside a range replaced by inline object */ hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 1; r.length = 1; hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* no effect is reported in this case */ flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draweffect4_seq, "effect draw test 4", FALSE);
r.startPosition = 0; r.length = 4; hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
r.startPosition = 0; r.length = 1; hr = IDWriteTextLayout_SetDrawingEffect(layout, effect, r); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* first range position is all that matters for inline ranges */ flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, draweffect3_seq, "effect draw test 5", FALSE);
IDWriteTextLayout_Release(layout);
ref = IUnknown_Release(effect); - ok(ref == 0, "Unexpected effect refcount %u\n", ref); + ok(ref == 0, "Unexpected effect refcount %lu\n", ref); IDWriteInlineObject_Release(sign); IDWriteTextFormat_Release(format); IDWriteFactory_Release(factory); @@ -3567,11 +3567,11 @@ static BOOL get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, UINT3 HRESULT hr;
hr = IDWriteLocalizedStrings_FindLocaleName(strings, L"en-us", &index, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (exists) { hr = IDWriteLocalizedStrings_GetString(strings, index, buff, size); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); } else *buff = 0; @@ -3601,19 +3601,19 @@ static void test_GetLineMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 2048.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, strW, 5, format, 30000.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 0, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got count %u\n", count);
memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(metrics[0].length == 5, "got %u\n", metrics[0].length); ok(metrics[0].trailingWhitespaceLength == 1, "got %u\n", metrics[0].trailingWhitespaceLength);
@@ -3625,7 +3625,7 @@ static void test_GetLineMetrics(void)
/* Test line height and baseline calculation */ hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); familycount = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < familycount; i++) { @@ -3638,17 +3638,17 @@ static void test_GetLineMetrics(void) layout = NULL;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!(exists = get_enus_string(names, nameW, ARRAY_SIZE(nameW)))) { IDWriteLocalFontFileLoader *localloader; @@ -3660,20 +3660,20 @@ static void test_GetLineMetrics(void)
count = 1; hr = IDWriteFontFace_GetFiles(fontface, &count, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFileLoader_Release(loader);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &keysize); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader, key, keysize, nameW, ARRAY_SIZE(nameW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
skip("Failed to get English family name, font file %s\n", wine_dbgstr_w(nameW));
@@ -3690,15 +3690,15 @@ static void test_GetLineMetrics(void) IDWriteFontFace_GetMetrics(fontface, &fontmetrics); hr = IDWriteFactory_CreateTextFormat(factory, nameW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, fontmetrics.designUnitsPerEm, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"", 1, format, 30000.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
memset(metrics, 0, sizeof(metrics)); count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count);
ok(metrics[0].baseline == fontmetrics.ascent + fontmetrics.lineGap, "%s: got %.2f, expected %d, " @@ -3720,19 +3720,19 @@ static void test_GetLineMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 2048.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
fontface = get_fontface_from_format(format); ok(fontface != NULL, "got %p\n", fontface);
/* force 2 lines */ hr = IDWriteFactory_CreateTextLayout(factory, str2W, 5, format, 10000.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(metrics, 0, sizeof(metrics)); count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count); /* baseline is relative to a line, and is not accumulated */ ok(metrics[0].baseline == metrics[1].baseline, "got %.2f, %.2f\n", metrics[0].baseline, @@ -3744,15 +3744,15 @@ static void test_GetLineMetrics(void) /* line breaks */ hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, str3W, 10, format, 100.0, 300.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(metrics, 0xcc, sizeof(metrics)); count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 6, "got %u\n", count);
ok(metrics[0].length == 2, "got %u\n", metrics[0].length); @@ -3780,12 +3780,12 @@ static void test_GetLineMetrics(void)
/* empty text layout */ hr = IDWriteFactory_CreateTextLayout(factory, strW, 0, format, 100.0f, 300.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count); ok(metrics[0].length == 0, "got %u\n", metrics[0].length); ok(metrics[0].trailingWhitespaceLength == 0, "got %u\n", metrics[0].trailingWhitespaceLength); @@ -3798,28 +3798,28 @@ static void test_GetLineMetrics(void) range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count); ok(metrics[1].height > metrics[0].height, "got %f\n", metrics[1].height); ok(metrics[1].baseline > metrics[0].baseline, "got %f\n", metrics[1].baseline);
/* revert font size back to format value, set different size for position 1 */ hr = IDWriteTextLayout_SetFontSize(layout, 12.0f, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 1; range.length = 1; hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(metrics + 1, 0, sizeof(*metrics)); count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count); ok(metrics[1].height == metrics[0].height, "got %f\n", metrics[1].height); ok(metrics[1].baseline == metrics[0].baseline, "got %f\n", metrics[1].baseline); @@ -3828,12 +3828,12 @@ static void test_GetLineMetrics(void)
/* text is "a\r" */ hr = IDWriteFactory_CreateTextLayout(factory, str4W, 2, format, 100.0f, 300.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; memset(metrics, 0, sizeof(metrics)); hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count); ok(metrics[0].length == 2, "got %u\n", metrics[0].length); ok(metrics[0].newlineLength == 1, "got %u\n", metrics[0].newlineLength); @@ -3847,29 +3847,29 @@ static void test_GetLineMetrics(void) range.startPosition = 1; range.length = 1; hr = IDWriteTextLayout_SetFontSize(layout, 80.0f, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 2, 2, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count); ok(metrics[3].height > metrics[1].height, "got %f, old %f\n", metrics[3].height, metrics[1].height); ok(metrics[3].baseline > metrics[1].baseline, "got %f, old %f\n", metrics[3].baseline, metrics[1].baseline);
/* revert to original format */ hr = IDWriteTextLayout_SetFontSize(layout, 12.0f, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 2, 2, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count); ok(metrics[3].height == metrics[1].height, "got %f, old %f\n", metrics[3].height, metrics[1].height); ok(metrics[3].baseline == metrics[1].baseline, "got %f, old %f\n", metrics[3].baseline, metrics[1].baseline);
/* Switch to uniform spacing */ hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_UNIFORM, 456.0f, 123.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count);
for (i = 0; i < count; i++) { @@ -3883,18 +3883,18 @@ static void test_GetLineMetrics(void) hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_PROPORTIONAL, 2.0f, 4.0f); if (hr == S_OK) { hr = IDWriteFactory_CreateTextLayout(factory, str4W, 1, format, 100.0f, 300.0f, &layout); - ok(hr == S_OK, "Failed to create layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, ARRAY_SIZE(metrics), &count); - ok(hr == S_OK, "Failed to get line metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get line metrics, hr %#lx.\n", hr); ok(count == 1, "Unexpected line count %u\n", count);
/* Back to default mode. */ hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, 0.0f); - ok(hr == S_OK, "Failed to set spacing method, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set spacing method, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetLineMetrics(layout, metrics + 1, 1, &count); - ok(hr == S_OK, "Failed to get line metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get line metrics, hr %#lx.\n", hr); ok(count == 1, "Unexpected line count %u\n", count);
/* Proportional spacing applies multipliers to default, content based spacing. */ @@ -3932,22 +3932,22 @@ static void test_SetTextAlignment(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetTextAlignment(format); ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
v = IDWriteTextLayout_GetTextAlignment(layout); ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v);
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetTextAlignment(format); ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v); @@ -3958,7 +3958,7 @@ static void test_SetTextAlignment(void) hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat1, (void**)&format1); if (hr == S_OK) { hr = IDWriteTextFormat1_SetTextAlignment(format1, DWRITE_TEXT_ALIGNMENT_CENTER); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetTextAlignment(format); ok(v == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", v); @@ -3980,17 +3980,17 @@ static void test_SetTextAlignment(void) FLOAT text_width;
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, ARRAY_SIZE(clusters), &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (stringsW[i][0]) ok(count > 0, "got %u\n", count); else @@ -4002,10 +4002,10 @@ static void test_SetTextAlignment(void)
/* maxwidth is 500, leading alignment */ hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_LEADING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == 0.0f, "got %.2f\n", metrics.left); ok(metrics.width == text_width, "got %.2f\n", metrics.width); @@ -4014,10 +4014,10 @@ static void test_SetTextAlignment(void)
/* maxwidth is 500, trailing alignment */ hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); ok(metrics.width == text_width, "got %.2f\n", metrics.width); @@ -4027,13 +4027,13 @@ static void test_SetTextAlignment(void)
/* initially created with trailing alignment */ hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_TRAILING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); ok(metrics.width == text_width, "got %.2f\n", metrics.width); @@ -4044,12 +4044,12 @@ static void test_SetTextAlignment(void) if (stringsW[i][0]) { /* max width less than total run width, trailing alignment */ hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_NO_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, clusters[0].width, 100.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(metrics.left == metrics.layoutWidth - metrics.width, "got %.2f\n", metrics.left); ok(metrics.width == text_width, "got %.2f\n", metrics.width); ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); @@ -4058,13 +4058,13 @@ static void test_SetTextAlignment(void)
/* maxwidth is 500, centered */ hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_CENTER); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, stringsW[i], lstrlenW(stringsW[i]), format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(metrics.left == (metrics.layoutWidth - metrics.width) / 2.0f, "got %.2f\n", metrics.left); ok(metrics.width == text_width, "got %.2f\n", metrics.width); ok(metrics.lineCount == 1, "got %d\n", metrics.lineCount); @@ -4091,22 +4091,22 @@ static void test_SetParagraphAlignment(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetParagraphAlignment(format); ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
v = IDWriteTextLayout_GetParagraphAlignment(layout); ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v);
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetParagraphAlignment(format); ok(v == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", v); @@ -4115,22 +4115,22 @@ static void test_SetParagraphAlignment(void) ok(v == DWRITE_PARAGRAPH_ALIGNMENT_FAR, "got %d\n", v);
hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_CENTER); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextLayout_GetParagraphAlignment(layout); ok(v == DWRITE_PARAGRAPH_ALIGNMENT_CENTER, "got %d\n", v);
count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, lines, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count);
/* maxheight is 100, near alignment */ hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_NEAR); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.top == 0.0, "got %.2f\n", metrics.top); ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height); @@ -4139,10 +4139,10 @@ static void test_SetParagraphAlignment(void)
/* maxwidth is 100, far alignment */ hr = IDWriteTextLayout_SetParagraphAlignment(layout, DWRITE_PARAGRAPH_ALIGNMENT_FAR); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.top == metrics.layoutHeight - metrics.height, "got %.2f\n", metrics.top); ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height); @@ -4152,13 +4152,13 @@ static void test_SetParagraphAlignment(void)
/* initially created with centered alignment */ hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_CENTER); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.top == (metrics.layoutHeight - lines[0].height) / 2, "got %.2f\n", metrics.top); ok(metrics.height == lines[0].height, "got %.2f\n", metrics.height); @@ -4185,13 +4185,13 @@ static void test_SetReadingDirection(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetReadingDirection(format); ok(v == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
v = IDWriteTextLayout_GetReadingDirection(layout); ok(v == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", v); @@ -4200,21 +4200,21 @@ static void test_SetReadingDirection(void) ok(v == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", v);
hr = IDWriteTextLayout_SetReadingDirection(layout, DWRITE_READING_DIRECTION_RIGHT_TO_LEFT); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, lines, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 1, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(count == 1, "got %u\n", count);
/* leading alignment, RTL */ hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == metrics.layoutWidth - clusters[0].width, "got %.2f\n", metrics.left); ok(metrics.top == 0.0, "got %.2f\n", metrics.top); @@ -4226,10 +4226,10 @@ static void test_SetReadingDirection(void)
/* trailing alignment, RTL */ hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_TRAILING); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == 0.0, "got %.2f\n", metrics.left); ok(metrics.top == 0.0, "got %.2f\n", metrics.top); @@ -4241,10 +4241,10 @@ static void test_SetReadingDirection(void)
/* centered alignment, RTL */ hr = IDWriteTextLayout_SetTextAlignment(layout, DWRITE_TEXT_ALIGNMENT_CENTER); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(metrics.left == (metrics.layoutWidth - clusters[0].width) / 2.0, "got %.2f\n", metrics.left); ok(metrics.top == 0.0, "got %.2f\n", metrics.top); @@ -4372,13 +4372,13 @@ static void test_pixelsnapping(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
fontface = get_fontface_from_format(format); IDWriteFontFace_GetMetrics(fontface, &metrics);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* disabled snapping */ ctxt.snapping_disabled = TRUE; @@ -4390,7 +4390,7 @@ static void test_pixelsnapping(void) originX = 0.1;
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
baseline = get_scaled_font_metric(metrics.ascent, 12.0, &metrics); ok(ctxt.originX == originX, "got %f, originX %f\n", ctxt.originX, originX); @@ -4410,7 +4410,7 @@ static void test_pixelsnapping(void)
expectedY = snap_coord(&ctxt.m, ctxt.ppdip, baseline); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0); - ok(hr == S_OK, "%d: got 0x%08x\n", i, hr); + ok(hr == S_OK, "%d: unexpected hr %#lx.\n", i, hr); ok(ctxt.originX == originX, "%d: got %f, originX %f\n", i, ctxt.originX, originX); ok(float_eq(ctxt.originY, expectedY), "%d: got %f, expected %f, baseline %f\n", i, ctxt.originY, expectedY, baseline); @@ -4420,11 +4420,11 @@ static void test_pixelsnapping(void) { hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, L"a", 1, format, 500.0f, 100.0f, 1.0f, &compattransforms[j], FALSE, &layout2); - ok(hr == S_OK, "%d: failed to create text layout, hr %#x.\n", i, hr); + ok(hr == S_OK, "%d: failed to create text layout, hr %#lx.\n", i, hr);
expectedY = snap_coord(&ctxt.m, ctxt.ppdip, baseline); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, originX, 0.0); - ok(hr == S_OK, "%d: got 0x%08x\n", i, hr); + ok(hr == S_OK, "%d: unexpected hr %#lx.\n", i, hr); ok(ctxt.originX == originX, "%d: got %f, originX %f\n", i, ctxt.originX, originX); ok(float_eq(ctxt.originY, expectedY), "%d: got %f, expected %f, baseline %f\n", i, ctxt.originY, expectedY, baseline); @@ -4454,41 +4454,41 @@ static void test_SetWordWrapping(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 12.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
v = IDWriteTextFormat_GetWordWrapping(format); ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v);
hr = IDWriteFactory_CreateTextLayout(factory, strW, ARRAY_SIZE(strW), format, 10.0f, 100.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextLayout_GetWordWrapping(layout); ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
v = IDWriteTextFormat_GetWordWrapping(format); ok(v == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", v);
/* disable wrapping, text has explicit newline */ hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_NO_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, NULL, 0, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count == 2, "got %u\n", count);
hr = IDWriteTextLayout_SetWordWrapping(layout, DWRITE_WORD_WRAPPING_WRAP); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetLineMetrics(layout, NULL, 0, &count); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "got 0x%08x\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(count > 2, "got %u\n", count);
IDWriteTextLayout_Release(layout); @@ -4537,13 +4537,13 @@ static HRESULT WINAPI fontcollection_GetFontFamily(IDWriteFontCollection *iface, HRESULT hr;
hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_FindFamilyName(syscollection, L"Tahoma", &index, &exists); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_GetFontFamily(syscollection, index, family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontCollection_Release(syscollection); IDWriteFactory_Release(factory); @@ -4608,7 +4608,7 @@ static void test_MapCharacters(void)
fallback = NULL; hr = IDWriteFactory2_GetSystemFontFallback(factory2, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fallback != NULL, "got %p\n", fallback);
mappedlength = 1; @@ -4616,7 +4616,7 @@ static void test_MapCharacters(void) font = (void*)0xdeadbeef; hr = IDWriteFontFallback_MapCharacters(fallback, NULL, 0, 0, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 0, "got %u\n", mappedlength); ok(scale == 1.0f, "got %f\n", scale); ok(font == NULL, "got %p\n", font); @@ -4628,7 +4628,7 @@ static void test_MapCharacters(void) font = (void*)0xdeadbeef; hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 0, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 0, "got %u\n", mappedlength); ok(scale == 1.0f, "got %f\n", scale); ok(font == NULL, "got %p\n", font); @@ -4640,7 +4640,7 @@ static void test_MapCharacters(void) hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); } ok(scale == 1.0f, "got %f\n", scale); @@ -4657,7 +4657,7 @@ if (font) { hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 3, "got %u\n", mappedlength); } ok(scale == 1.0f, "got %f\n", scale); @@ -4674,7 +4674,7 @@ if (font) { hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); } ok(scale == 1.0f, "got %f\n", scale); @@ -4690,7 +4690,7 @@ if (font) { hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 2, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); } ok(scale == 1.0f, "got %f\n", scale); @@ -4707,16 +4707,16 @@ if (font) { font = NULL; hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, &fallbackcollection, g_blahfontW, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); ok(scale == 1.0f, "got %f\n", scale); ok(font != NULL, "got %p\n", font);
exists = FALSE; hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists); - ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists); + ok(hr == S_OK && exists, "Unexpected hr %#lx, exists %d.\n", hr, exists); hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW)); IDWriteLocalizedStrings_Release(strings); IDWriteFont_Release(font); @@ -4728,16 +4728,16 @@ if (font) { font = NULL; hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 1, &fallbackcollection, g_blahfontW, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); ok(scale == 1.0f, "got %f\n", scale); ok(font != NULL, "got %p\n", font);
exists = FALSE; hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists); - ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists); + ok(hr == S_OK && exists, "Unexpected hr %#lx, exists %d.\n", hr, exists); hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); todo_wine ok(lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW)); IDWriteLocalizedStrings_Release(strings); @@ -4780,7 +4780,7 @@ static void test_FontFallbackBuilder(void) EXPECT_REF(factory2, 2); EXPECT_REF(builder, 1); hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(factory2, 3); EXPECT_REF(fallback, 1); EXPECT_REF(builder, 1); @@ -4793,54 +4793,54 @@ static void test_FontFallbackBuilder(void)
/* New instance is created every time, even if mappings have not changed. */ hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback2); - ok(hr == S_OK, "Failed to create fallback object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create fallback object, hr %#lx.\n", hr); ok(fallback != fallback2, "Unexpected fallback instance.\n"); IDWriteFontFallback_Release(fallback2);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, NULL, 0, NULL, 0, NULL, NULL, NULL, 0.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.first = 'A'; range.last = 'B'; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 0, NULL, 0, NULL, NULL, NULL, 0.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 0, NULL, 0, NULL, NULL, NULL, 1.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 0, &familyW, 1, NULL, NULL, NULL, 1.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, NULL, 0, &familyW, 1, NULL, NULL, NULL, 1.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* negative scaling factor */ range.first = range.last = 0; familyW = g_blahfontW; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, -1.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 0.0f); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* empty range */ range.first = range.last = 0; familyW = g_blahfontW; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 1.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.first = range.last = 0; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 2.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.first = range.last = 'A'; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 3.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.first = 'B'; range.last = 'A'; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 4.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteFontFallback_Release(fallback);
@@ -4848,7 +4848,7 @@ static void test_FontFallbackBuilder(void) hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, NULL);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* fallback font missing from system collection */ g_source = L"A"; @@ -4858,7 +4858,7 @@ static void test_FontFallbackBuilder(void) hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); ok(scale == 1.0f, "got %f\n", scale); ok(font == NULL, "got %p\n", font); @@ -4868,10 +4868,10 @@ todo_wine { /* remap with custom collection */ range.first = range.last = 'A'; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, &fallbackcollection, NULL, NULL, 5.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_source = L"A"; mappedlength = 0; @@ -4880,7 +4880,7 @@ todo_wine { hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); ok(scale == 5.0f, "got %f\n", scale); ok(font != NULL, "got %p\n", font); @@ -4893,10 +4893,10 @@ todo_wine { range.first = 'B'; range.last = 'A'; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, &fallbackcollection, NULL, NULL, 6.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_source = L"A"; mappedlength = 0; @@ -4905,7 +4905,7 @@ todo_wine { hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); ok(scale == 5.0f, "got %f\n", scale); ok(font != NULL, "got %p\n", font); @@ -4919,10 +4919,10 @@ todo_wine { range.first = 'A'; range.last = 'B'; hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, &fallbackcollection, L"locale", NULL, 6.0f); - ok(hr == S_OK, "Failed to add mapping, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to add mapping, hr %#lx.\n", hr);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_source = L"A"; mappedlength = 0; @@ -4931,7 +4931,7 @@ todo_wine { hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale); todo_wine { - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(mappedlength == 1, "got %u\n", mappedlength); ok(scale == 5.0f, "got %f\n", scale); ok(font != NULL, "got %p\n", font); @@ -4950,7 +4950,7 @@ todo_wine {
IDWriteFontFallbackBuilder_Release(builder); ref = IDWriteFactory2_Release(factory2); - ok(ref == 0, "Factory is not released, ref %u.\n", ref); + ok(ref == 0, "Factory is not released, ref %lu.\n", ref); }
static void test_fallback(void) @@ -4974,15 +4974,15 @@ static void test_fallback(void) /* Font does not exist in system collection. */ hr = IDWriteFactory_CreateTextFormat(factory, g_blahfontW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count); todo_wine { - ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr); ok(count == 4, "Unexpected count %u.\n", count); } for (i = 0, width = 0.0; i < count; i++) @@ -4990,7 +4990,7 @@ todo_wine {
memset(&metrics, 0xcc, sizeof(metrics)); hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "Failed to get layout metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get layout metrics, hr %#lx.\n", hr); todo_wine { ok(metrics.width > 0.0 && metrics.width == width, "Unexpected width %.2f, expected %.2f.\n", metrics.width, width); ok(metrics.height > 0.0, "Unexpected height %.2f.\n", metrics.height); @@ -5001,11 +5001,11 @@ todo_wine {
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* Existing font. */ hr = IDWriteFactory_CreateTextLayout(factory, L"abcd", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextFormat_Release(format);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2); @@ -5022,39 +5022,39 @@ todo_wine {
fallback = (void*)0xdeadbeef; hr = IDWriteTextLayout2_GetFontFallback(layout2, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fallback == NULL, "got %p\n", fallback);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void**)&format1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback = (void*)0xdeadbeef; hr = IDWriteTextFormat1_GetFontFallback(format1, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fallback == NULL, "got %p\n", fallback);
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory2, (void**)&factory2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback = NULL; hr = IDWriteFactory2_GetSystemFontFallback(factory2, &fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fallback != NULL, "got %p\n", fallback);
hr = IDWriteTextFormat1_SetFontFallback(format1, fallback); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback2 = (void*)0xdeadbeef; hr = IDWriteTextLayout2_GetFontFallback(layout2, &fallback2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fallback2 == fallback, "got %p\n", fallback2);
hr = IDWriteTextLayout2_SetFontFallback(layout2, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
fallback2 = (void*)0xdeadbeef; hr = IDWriteTextFormat1_GetFontFallback(format1, &fallback2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(fallback2 == NULL, "got %p\n", fallback2);
if (SUCCEEDED(IDWriteFontFallback_QueryInterface(fallback, &IID_IDWriteFontFallback1, (void **)&fallback1))) @@ -5083,40 +5083,40 @@ static void test_SetTypography(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"afib", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr); IDWriteTextFormat_Release(format);
hr = IDWriteFactory_CreateTypography(factory, &typography); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(typography, 1); range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetTypography(layout, typography, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(typography, 2);
hr = IDWriteTextLayout_GetTypography(layout, 0, &typography2, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(typography2 == typography, "got %p, expected %p\n", typography2, typography); IDWriteTypography_Release(typography2); IDWriteTypography_Release(typography);
hr = IDWriteFactory_CreateTypography(factory, &typography2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetTypography(layout, typography2, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); EXPECT_REF(typography2, 2); IDWriteTypography_Release(typography2);
hr = IDWriteTextLayout_GetTypography(layout, 0, &typography, &range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.length == 1, "got %u\n", range.length);
IDWriteTypography_Release(typography); @@ -5139,7 +5139,7 @@ static void test_SetLastLineWrapping(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat1, (void**)&format1); IDWriteTextFormat_Release(format); @@ -5153,20 +5153,20 @@ static void test_SetLastLineWrapping(void) ok(ret, "got %d\n", ret);
hr = IDWriteTextFormat1_SetLastLineWrapping(format1, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, (IDWriteTextFormat *)format1, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteTextLayout_Release(layout);
ret = IDWriteTextLayout2_GetLastLineWrapping(layout2); ok(!ret, "got %d\n", ret);
hr = IDWriteTextLayout2_SetLastLineWrapping(layout2, TRUE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout2_Release(layout2); IDWriteTextFormat1_Release(format1); @@ -5187,7 +5187,7 @@ static void test_SetOpticalAlignment(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat1, (void**)&format1); IDWriteTextFormat_Release(format); @@ -5201,10 +5201,10 @@ static void test_SetOpticalAlignment(void) ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, (IDWriteTextFormat *)format1, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout2, (void**)&layout2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteTextLayout_Release(layout); IDWriteTextFormat1_Release(format1);
@@ -5212,25 +5212,25 @@ static void test_SetOpticalAlignment(void) ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment);
hr = IDWriteTextLayout2_QueryInterface(layout2, &IID_IDWriteTextFormat1, (void**)&format1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
alignment = IDWriteTextFormat1_GetOpticalAlignment(format1); ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment);
hr = IDWriteTextLayout2_SetOpticalAlignment(layout2, DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout2_SetOpticalAlignment(layout2, DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS+1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
alignment = IDWriteTextFormat1_GetOpticalAlignment(format1); ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS, "got %d\n", alignment);
hr = IDWriteTextFormat1_SetOpticalAlignment(format1, DWRITE_OPTICAL_ALIGNMENT_NONE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat1_SetOpticalAlignment(format1, DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS+1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
alignment = IDWriteTextLayout2_GetOpticalAlignment(layout2); ok(alignment == DWRITE_OPTICAL_ALIGNMENT_NONE, "got %d\n", alignment); @@ -5286,29 +5286,29 @@ static void test_SetUnderline(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 1000.0, 1000.0, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, ARRAY_SIZE(clusters), &count); - ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr); ok(count == 3, "Unexpected cluster count %u.\n", count);
range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, ARRAY_SIZE(clusters), &count); - ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr); ok(count == 3, "Unexpected cluster count %u.\n", count);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, drawunderline_seq, "draw underline test", TRUE);
IDWriteTextLayout_Release(layout); @@ -5316,53 +5316,53 @@ static void test_SetUnderline(void) /* 2 characters, same font, significantly different font size. Set underline for both, see how many underline drawing calls is there. */ hr = IDWriteFactory_CreateTextLayout(factory, strW, 2, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetFontSize(layout, 100.0f, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, drawunderline2_seq, "draw underline test 2", FALSE);
/* now set different locale for second char, draw again */ range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetLocaleName(layout, L"en-CA", range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, drawunderline3_seq, "draw underline test 2", FALSE);
IDWriteTextLayout_Release(layout);
/* 2 characters, same font properties, first with strikethrough, both underlined */ hr = IDWriteFactory_CreateTextLayout(factory, strW, 2, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 1; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, RENDERER_ID, drawunderline4_seq, "draw underline test 4", FALSE);
IDWriteTextLayout_Release(layout); @@ -5371,7 +5371,7 @@ static void test_SetUnderline(void)
/* Test runHeight value with all available fonts */ hr = IDWriteFactory_GetSystemFontCollection(factory, &syscollection, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
for (i = 0; i < count; ++i) @@ -5391,17 +5391,17 @@ static void test_SetUnderline(void) layout = NULL;
hr = IDWriteFontCollection_GetFontFamily(syscollection, i, &family); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFamily_GetFamilyNames(family, &names); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!(exists = get_enus_string(names, nameW, ARRAY_SIZE(nameW)))) { IDWriteLocalFontFileLoader *localloader; @@ -5413,20 +5413,20 @@ static void test_SetUnderline(void)
count = 1; hr = IDWriteFontFace_GetFiles(fontface, &count, &file); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFile_GetLoader(file, &loader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontFileLoader_QueryInterface(loader, &IID_IDWriteLocalFontFileLoader, (void**)&localloader); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteFontFileLoader_Release(loader);
hr = IDWriteFontFile_GetReferenceKey(file, &key, &keysize); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader, key, keysize, nameW, ARRAY_SIZE(nameW)); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
skip("Failed to get English family name, font file %s\n", wine_dbgstr_w(nameW));
@@ -5443,7 +5443,7 @@ static void test_SetUnderline(void) IDWriteFontFace_GetMetrics(fontface, &fontmetrics); hr = IDWriteFactory_CreateTextFormat(factory, nameW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, fontmetrics.designUnitsPerEm, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* Look for first supported character to avoid triggering fallback path. With fallback it's harder to test DrawUnderline() metrics, because actual resolved fontface is not passed to it. Grabbing fontface instance @@ -5452,7 +5452,7 @@ static void test_SetUnderline(void) { glyph = 0; hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, &glyph); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (glyph) break; } @@ -5465,18 +5465,18 @@ static void test_SetUnderline(void)
str[0] = codepoint; hr = IDWriteFactory_CreateTextLayout(factory, str, 1, format, 30000.0f, 100.0f, &layout); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&ctxt, 0, sizeof(ctxt)); ctxt.format = format; ctxt.familyW = nameW; hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0f, 0.0f); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
cleanup: if (layout) @@ -5503,10 +5503,10 @@ static void test_InvalidateLayout(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout3, (void**)&layout3); if (hr == S_OK) { @@ -5514,32 +5514,32 @@ static void test_InvalidateLayout(void) IDWriteTextFormat2 *format2;
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat2, (void**)&format2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteTextFormat2_Release(format2);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat2, (void**)&format2); - ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#lx.\n", hr); if (hr == S_OK) { ok(format != (IDWriteTextFormat *)format2, "Unexpected interface pointer.\n"); IDWriteTextFormat2_Release(format2); }
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextFormat1, (void**)&format1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat1_QueryInterface(format1, &IID_IDWriteTextFormat2, (void**)&format2); - ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#x.\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#lx.\n", hr); if (hr == S_OK) IDWriteTextFormat2_Release(format2); IDWriteTextFormat1_Release(format1);
hr = IDWriteTextLayout3_QueryInterface(layout3, &IID_IDWriteTextFormat2, (void**)&format2); - ok(hr == S_OK || broken(hr == E_NOINTERFACE), "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Unexpected hr %#lx.\n", hr); if (hr == S_OK) IDWriteTextFormat2_Release(format2);
hr = IDWriteTextLayout3_InvalidateLayout(layout3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IDWriteTextLayout3_Release(layout3); } else @@ -5562,40 +5562,40 @@ static void test_line_spacing(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, 0.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, -10.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, -10.0f, 0.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_PROPORTIONAL+1, 0.0f, 0.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, 0.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0f, -10.0f); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_DEFAULT, -10.0f, 0.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_PROPORTIONAL+1, 0.0f, 0.0f); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
if (IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat2, (void**)&format2) == S_OK) { DWRITE_LINE_SPACING spacing;
hr = IDWriteTextFormat2_GetLineSpacing(format2, &spacing); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(spacing.method == DWRITE_LINE_SPACING_METHOD_DEFAULT, "got method %d\n", spacing.method); ok(spacing.height == 0.0f, "got %f\n", spacing.height); @@ -5606,29 +5606,29 @@ static void test_line_spacing(void) spacing.leadingBefore = -1.0f;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
spacing.leadingBefore = 1.1f;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
spacing.leadingBefore = 1.0f;
hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
spacing.method = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL + 1; hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
spacing.method = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL; spacing.fontLineGapUsage = DWRITE_FONT_LINE_GAP_USAGE_ENABLED + 1; hr = IDWriteTextFormat2_SetLineSpacing(format2, &spacing); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat2_GetLineSpacing(format2, &spacing); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(spacing.fontLineGapUsage == DWRITE_FONT_LINE_GAP_USAGE_ENABLED + 1, "got %d\n", spacing.fontLineGapUsage);
IDWriteTextFormat2_Release(format2); @@ -5663,10 +5663,10 @@ static void test_GetOverhangMetrics(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 100.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"A", 1, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(overhangs_tests); i++) { const struct overhangs_test *test = &overhangs_tests[i]; @@ -5679,16 +5679,16 @@ static void test_GetOverhangMetrics(void)
hr = IDWriteTextLayout_SetLineSpacing(layout, DWRITE_LINE_SPACING_METHOD_UNIFORM, test->metrics.height * 2.0f, test->uniform_baseline); - ok(hr == S_OK, "Failed to set line spacing, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set line spacing, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetInlineObject(layout, NULL, range); - ok(hr == S_OK, "Failed to reset inline object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to reset inline object, hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetInlineObject(layout, &obj.IDWriteInlineObject_iface, range); - ok(hr == S_OK, "Failed to set inline object, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set inline object, hr %#lx.\n", hr);
hr = IDWriteTextLayout_GetMetrics(layout, &metrics); - ok(hr == S_OK, "Failed to get layout metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get layout metrics, hr %#lx.\n", hr);
ok(metrics.width == test->metrics.width, "%u: unexpected formatted width.\n", i); ok(metrics.height == test->metrics.height * 2.0f, "%u: unexpected formatted height.\n", i); @@ -5697,7 +5697,7 @@ static void test_GetOverhangMetrics(void) hr = IDWriteTextLayout_SetMaxHeight(layout, test->metrics.height);
hr = IDWriteTextLayout_GetOverhangMetrics(layout, &overhang_metrics); - ok(hr == S_OK, "Failed to get overhang metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get overhang metrics, hr %#lx.\n", hr);
ok(!memcmp(&overhang_metrics, &test->expected, sizeof(overhang_metrics)), "%u: unexpected overhang metrics (%f, %f, %f, %f).\n", i, overhang_metrics.left, overhang_metrics.top, @@ -5717,7 +5717,7 @@ static void test_tab_stops(void) IDWriteFactory *factory; DWRITE_TEXT_RANGE range; FLOAT tabstop, size; - ULONG count; + UINT count; HRESULT hr;
factory = create_factory(); @@ -5727,7 +5727,7 @@ static void test_tab_stops(void) { hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, size, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
tabstop = IDWriteTextFormat_GetIncrementalTabStop(format); ok(tabstop == 4.0f * size, "Unexpected tab stop %f.\n", tabstop); @@ -5737,28 +5737,28 @@ static void test_tab_stops(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetIncrementalTabStop(format, 0.0f); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_SetIncrementalTabStop(format, -10.0f); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
tabstop = IDWriteTextFormat_GetIncrementalTabStop(format); ok(tabstop == 40.0f, "Unexpected tab stop %f.\n", tabstop);
hr = IDWriteTextFormat_SetIncrementalTabStop(format, 100.0f); - ok(hr == S_OK, "Failed to set tab stop value, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set tab stop value, hr %#lx.\n", hr);
tabstop = IDWriteTextFormat_GetIncrementalTabStop(format); ok(tabstop == 100.0f, "Unexpected tab stop %f.\n", tabstop);
hr = IDWriteFactory_CreateTextLayout(factory, L"\ta\tb", 4, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count); - ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr); ok(clusters[0].isWhitespace, "Unexpected isWhitespace.\n"); ok(!clusters[1].isWhitespace, "Unexpected isWhitespace.\n"); ok(clusters[2].isWhitespace, "Unexpected isWhitespace.\n"); @@ -5770,13 +5770,13 @@ todo_wine { range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetFontSize(layout, 20.0f, range); - ok(hr == S_OK, "Failed to set font size, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set font size, hr %#lx.\n", hr);
tabstop = IDWriteTextLayout_GetIncrementalTabStop(layout); ok(tabstop == 100.0f, "Unexpected tab stop %f.\n", tabstop);
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count); - ok(hr == S_OK, "Failed to get cluster metrics, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get cluster metrics, hr %#lx.\n", hr); ok(clusters[0].isWhitespace, "Unexpected isWhitespace.\n"); ok(!clusters[1].isWhitespace, "Unexpected isWhitespace.\n"); ok(clusters[2].isWhitespace, "Unexpected isWhitespace.\n"); @@ -5806,10 +5806,10 @@ static void test_automatic_font_axes(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 16.0f, L"en-us", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout4, (void **)&layout4);
@@ -5824,16 +5824,16 @@ static void test_automatic_font_axes(void) }
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat3, (void **)&format3); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextFormat3_GetAutomaticFontAxes(format3); ok(axes == DWRITE_AUTOMATIC_FONT_AXES_NONE, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextFormat3_SetAutomaticFontAxes(format3, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_SetAutomaticFontAxes(format3, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat3_Release(format3);
@@ -5841,37 +5841,37 @@ static void test_automatic_font_axes(void) ok(axes == DWRITE_AUTOMATIC_FONT_AXES_NONE, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextLayout4_SetAutomaticFontAxes(layout4, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout4_SetAutomaticFontAxes(layout4, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout4_Release(layout4);
/* Out of range values allow for formats, but not for layouts. */ hr = IDWriteFactory_CreateTextLayout(factory, L"a", 1, format, 1000.0f, 1000.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %lx.\n", hr);
hr = IDWriteTextLayout_QueryInterface(layout, &IID_IDWriteTextLayout4, (void **)&layout4); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextLayout4_GetAutomaticFontAxes(layout4); ok(axes == DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextLayout4_QueryInterface(layout4, &IID_IDWriteTextFormat3, (void **)&format3); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextFormat3_GetAutomaticFontAxes(format3); ok(axes == DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextLayout4_SetAutomaticFontAxes(layout4, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
axes = IDWriteTextFormat3_GetAutomaticFontAxes(format3); ok(axes == DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE, "Unexpected automatic axes %u.\n", axes);
hr = IDWriteTextFormat3_SetAutomaticFontAxes(format3, DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE + 1); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IDWriteTextFormat3_Release(format3);
@@ -5907,15 +5907,15 @@ static void test_text_format_axes(void)
hr = IDWriteFactory6_CreateTextFormat(factory, L"test_family", NULL, NULL, 0, 10.0f, L"en-us", &format3); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr)) { hr = IDWriteTextFormat3_GetFontCollection(format3, &collection); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection2, (void **)&collection2); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
model = IDWriteFontCollection2_GetFontFamilyModel(collection2); ok(model == DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC, "Unexpected model %d.\n", model); @@ -5939,7 +5939,7 @@ if (SUCCEEDED(hr)) axes[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT; axes[0].value = 200.0f; hr = IDWriteTextFormat3_SetFontAxisValues(format3, axes, 1); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
weight = IDWriteTextFormat3_GetFontWeight(format3); ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "Unexpected font weight %d.\n", weight); @@ -5949,17 +5949,17 @@ if (SUCCEEDED(hr)) hr = IDWriteFactory_CreateTextFormat((IDWriteFactory *)factory, L"test_family", NULL, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_ITALIC, DWRITE_FONT_STRETCH_EXPANDED, 10.0f, L"en-us", &format); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat_QueryInterface(format, &IID_IDWriteTextFormat3, (void **)&format3); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTextFormat3_GetFontAxisValueCount(format3); ok(!count, "Unexpected axis count %u.\n", count);
axes[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT; hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 1); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(axes[0].axisTag == 0 && axes[0].value == 0.0f, "Unexpected value.\n");
axes[0].axisTag = DWRITE_FONT_AXIS_TAG_WEIGHT; @@ -5967,22 +5967,22 @@ if (SUCCEEDED(hr)) axes[1].axisTag = DWRITE_FONT_AXIS_TAG_WIDTH; axes[1].value = 2.0f; hr = IDWriteTextFormat3_SetFontAxisValues(format3, axes, 2); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTextFormat3_GetFontAxisValueCount(format3); ok(count == 2, "Unexpected axis count %u.\n", count);
hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 1); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 0); - ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_GetFontAxisValues(format3, axes, 2); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextFormat3_SetFontAxisValues(format3, axes, 0); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = IDWriteTextFormat3_GetFontAxisValueCount(format3); ok(!count, "Unexpected axis count %u.\n", count); @@ -6013,238 +6013,238 @@ static void test_layout_range_length(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
/* Range length is validated when setting properties. */
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* Weight */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_HEAVY, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontWeight(layout, 0, &weight, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontWeight(layout, 10, &weight, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetFontWeight(layout, DWRITE_FONT_WEIGHT_NORMAL, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Family name */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"family", range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"family", range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"family", range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetFontFamilyName(layout, L"Tahoma", range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Style */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_ITALIC, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontStyle(layout, 0, &style, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontStyle(layout, 10, &style, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetFontStyle(layout, DWRITE_FONT_STYLE_NORMAL, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Stretch */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_CONDENSED, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontStretch(layout, 0, &stretch, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetFontStretch(layout, 10, &stretch, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetFontStretch(layout, DWRITE_FONT_STRETCH_NORMAL, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Underline */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetUnderline(layout, 0, &value, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetUnderline(layout, 10, &value, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetUnderline(layout, FALSE, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Strikethrough */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetStrikethrough(layout, 0, &value, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0; hr = IDWriteTextLayout_GetStrikethrough(layout, 10, &value, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetStrikethrough(layout, FALSE, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Locale name */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetLocaleName(layout, L"locale", range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetLocaleName(layout, L"locale", range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetLocaleName(layout, L"locale", range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetLocaleName(layout, L"ru", range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Inline object */ hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetInlineObject(layout, sign, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetInlineObject(layout, sign, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetInlineObject(layout, sign, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; object = NULL; hr = IDWriteTextLayout_GetInlineObject(layout, 10, &object, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length); IDWriteInlineObject_Release(object); @@ -6252,85 +6252,85 @@ static void test_layout_range_length(void) range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetInlineObject(layout, NULL, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Drawing effect */ range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown *)sign, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown *)sign, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetDrawingEffect(layout, (IUnknown *)sign, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetDrawingEffect(layout, NULL, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteInlineObject_Release(sign);
/* Typography */ hr = IDWriteFactory_CreateTypography(factory, &typography); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetTypography(layout, typography, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetTypography(layout, typography, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetTypography(layout, typography, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetTypography(layout, NULL, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTypography_Release(typography);
/* Font collection */ hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); - ok(hr == S_OK, "Failed to get system collection, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get system collection, hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout_SetFontCollection(layout, collection, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout_SetFontCollection(layout, collection, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout_SetFontCollection(layout, collection, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout_SetFontCollection(layout, NULL, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; collection2 = NULL; hr = IDWriteTextLayout_GetFontCollection(layout, 10, &collection2, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.length == ~0u, "Unexpected range length %u.\n", range.length); if (collection2) IDWriteFontCollection_Release(collection2); @@ -6343,27 +6343,27 @@ static void test_layout_range_length(void) range.startPosition = 10; range.length = ~0u; hr = IDWriteTextLayout1_SetPairKerning(layout1, TRUE, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 9; hr = IDWriteTextLayout1_SetPairKerning(layout1, TRUE, range); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
range.startPosition = 10; range.length = ~0u - 10; hr = IDWriteTextLayout1_SetPairKerning(layout1, TRUE, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
range.startPosition = range.length = 0; hr = IDWriteTextLayout1_GetPairKerning(layout1, 0, &value, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 0 && range.length == 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length);
range.startPosition = range.length = 0; value = FALSE; hr = IDWriteTextLayout1_GetPairKerning(layout1, 10, &value, &range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(range.startPosition == 10 && range.length == ~0u - 10, "Unexpected range (%u, %u).\n", range.startPosition, range.length); ok(!!value, "Unexpected value %d.\n", value); @@ -6371,7 +6371,7 @@ static void test_layout_range_length(void) range.startPosition = 0; range.length = ~0u; hr = IDWriteTextLayout1_SetPairKerning(layout1, FALSE, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDWriteTextLayout1_Release(layout1); } @@ -6398,16 +6398,16 @@ static void test_HitTestTextRange(void)
hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"ru", &format); - ok(hr == S_OK, "Failed to create text format, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text format, hr %#lx.\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, L"string", 6, format, 100.0f, 100.0f, &layout); - ok(hr == S_OK, "Failed to create text layout, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create text layout, hr %#lx.\n", hr);
/* Start index exceeding layout text length, dummy range returned. */ count = 0; hr = IDWriteTextLayout_HitTestTextRange(layout, 7, 10, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { ok(count == 1, "Unexpected metrics count %u.\n", count); @@ -6419,7 +6419,7 @@ if (SUCCEEDED(hr)) count = 0; hr = IDWriteTextLayout_HitTestTextRange(layout, 0, 10, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { ok(count == 1, "Unexpected metrics count %u.\n", count); @@ -6431,12 +6431,12 @@ if (SUCCEEDED(hr)) range.startPosition = 3; range.length = 3; hr = IDWriteTextLayout_SetFontSize(layout, 20.0f, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_HitTestTextRange(layout, 0, 6, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { ok(count == 1, "Unexpected metrics count %u.\n", count); @@ -6445,20 +6445,20 @@ if (SUCCEEDED(hr)) ok(!!metrics[0].isText, "Expected text range.\n");
hr = IDWriteTextLayout_GetLineMetrics(layout, &line, 1, &count); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(line.height == metrics[0].height, "Unexpected range height.\n"); } /* With inline object. */ hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0; hr = IDWriteTextLayout_HitTestTextRange(layout, 0, 6, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { ok(count == 2, "Unexpected metrics count %u.\n", count); @@ -6472,7 +6472,7 @@ if (SUCCEEDED(hr)) count = 0; hr = IDWriteTextLayout_HitTestTextRange(layout, 7, 10, 0.0f, 0.0f, metrics, ARRAY_SIZE(metrics), &count); todo_wine - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (SUCCEEDED(hr)) { ok(count == 1, "Unexpected metrics count %u.\n", count);