dwrite/tests: Fix indentation warnings on GCC 6.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-08-09 15:59:46 +03:00 committed by Alexandre Julliard
parent db5211d36f
commit 36cce60f8d
3 changed files with 46 additions and 45 deletions

View File

@ -1166,8 +1166,8 @@ static void test_GetScriptProperties(void)
hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, &props);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
if (0) /* crashes on native */
hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, NULL);
if (0) /* crashes on native */
hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, NULL);
sa.script = 0;
hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer1, sa, &props);

View File

@ -841,9 +841,9 @@ static void test_CreateFontFromLOGFONT(void)
hr = IDWriteFactory_GetGdiInterop(factory, &interop);
EXPECT_HR(hr, S_OK);
if (0)
/* null out parameter crashes this call */
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, NULL, NULL);
if (0)
/* null out parameter crashes this call */
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, NULL, NULL);
font = (void*)0xdeadbeef;
hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, NULL, &font);
@ -1012,8 +1012,8 @@ static void test_CreateBitmapRenderTarget(void)
hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop, NULL, 0, 0, &target);
EXPECT_HR(hr, S_OK);
if (0) /* crashes on native */
hr = IDWriteBitmapRenderTarget_GetSize(target, NULL);
if (0) /* crashes on native */
hr = IDWriteBitmapRenderTarget_GetSize(target, NULL);
size.cx = size.cy = -1;
hr = IDWriteBitmapRenderTarget_GetSize(target, &size);
@ -1158,8 +1158,8 @@ if (0) /* crashes on native */
ok(!ds.dsBm.bmBits, "got %p\n", ds.dsBm.bmBits);
/* transform tests, current hdc transform is not immediately affected */
if (0) /* crashes on native */
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, NULL);
if (0) /* crashes on native */
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, NULL);
memset(&m, 0xcc, sizeof(m));
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m);
@ -1405,8 +1405,8 @@ static void test_GetFamilyNames(void)
hr = IDWriteFont_GetFontFamily(font, &family);
EXPECT_HR(hr, S_OK);
if (0) /* crashes on native */
hr = IDWriteFontFamily_GetFamilyNames(family, NULL);
if (0) /* crashes on native */
hr = IDWriteFontFamily_GetFamilyNames(family, NULL);
hr = IDWriteFontFamily_GetFamilyNames(family, &names);
ok(hr == S_OK, "got 0x%08x\n", hr);
@ -1420,8 +1420,8 @@ if (0) /* crashes on native */
IDWriteLocalizedStrings_Release(names2);
/* GetStringLength */
if (0) /* crashes on native */
hr = IDWriteLocalizedStrings_GetStringLength(names, 0, NULL);
if (0) /* crashes on native */
hr = IDWriteLocalizedStrings_GetStringLength(names, 0, NULL);
len = 100;
hr = IDWriteLocalizedStrings_GetStringLength(names, 10, &len);
@ -1440,8 +1440,8 @@ if (0) /* crashes on native */
hr = IDWriteLocalizedStrings_GetString(names, 10, NULL, 0);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
if (0)
hr = IDWriteLocalizedStrings_GetString(names, 0, NULL, 100);
if (0)
hr = IDWriteLocalizedStrings_GetString(names, 0, NULL, 100);
buffer[0] = 1;
hr = IDWriteLocalizedStrings_GetString(names, 10, buffer, 100);
@ -1512,8 +1512,8 @@ static void test_CreateFontFace(void)
hr = IDWriteFont_QueryInterface(font, &IID_IDWriteFontFace, (void**)&fontface);
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
if (0) /* crashes on native */
hr = IDWriteFont_CreateFontFace(font, NULL);
if (0) /* crashes on native */
hr = IDWriteFont_CreateFontFace(font, NULL);
fontface = NULL;
hr = IDWriteFont_CreateFontFace(font, &fontface);
@ -1845,8 +1845,8 @@ static void test_GetMetrics(void)
DeleteDC(hdc);
DeleteObject(hfont);
if (0) /* crashes on native */
IDWriteFont_GetMetrics(font, NULL);
if (0) /* crashes on native */
IDWriteFont_GetMetrics(font, NULL);
memset(&metrics, 0, sizeof(metrics));
IDWriteFont_GetMetrics(font, &metrics);
@ -2648,9 +2648,9 @@ if (0) { /* crashes on win10 */
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);
if (face2)
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);
@ -2681,8 +2681,8 @@ if (face2)
ok(indices[0] == 0, "got index %i\n", indices[0]);
ok(indices[1] == 11, "got index %i\n", indices[1]);
if (0) /* crashes on native */
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 1, NULL);
if (0) /* crashes on native */
hr = IDWriteFontFace_GetGlyphIndices(face, NULL, 1, NULL);
hr = IDWriteFontFace_GetGlyphIndices(face, codePoints, 1, indices);
ok(hr == S_OK, "got 0x%08x\n", hr);
@ -4129,8 +4129,8 @@ static void test_GetKerningPairAdjustments(void)
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 0, NULL, NULL);
ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "got 0x%08x\n", hr);
if (0) /* crashes on native */
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1, NULL, NULL);
if (0) /* crashes on native */
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1, NULL, NULL);
adjustments[0] = 1;
hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1, NULL, adjustments);
@ -4836,8 +4836,9 @@ static void test_GetGdiCompatibleMetrics_face(IDWriteFontFace *face)
expected.subscriptSizeX = round(round(design_metrics1.subscriptSizeX * scale) / scale);
expected.subscriptSizeY = round(round(design_metrics1.subscriptSizeY * scale) / scale);
expected.superscriptPositionX = round(round(design_metrics1.superscriptPositionX * scale) / scale);
if (0) /* this fails for 3 emsizes, Tahoma from [5, 2048] range */
if (0) /* this fails for 3 emsizes, Tahoma from [5, 2048] range */ {
expected.superscriptPositionY = round(round(design_metrics1.superscriptPositionY * scale) / scale);
}
expected.superscriptSizeX = round(round(design_metrics1.superscriptSizeX * scale) / scale);
expected.superscriptSizeY = round(round(design_metrics1.superscriptSizeY * scale) / scale);
expected.hasTypographicMetrics = design_metrics1.hasTypographicMetrics;
@ -4903,8 +4904,8 @@ static void test_GetPanose(void)
IDWriteFontFace *fontface;
DWRITE_PANOSE panose;
if (0) /* crashes on native */
IDWriteFont1_GetPanose(font1, NULL);
if (0) /* crashes on native */
IDWriteFont1_GetPanose(font1, NULL);
memset(&panose, 0, sizeof(panose));
IDWriteFont1_GetPanose(font1, &panose);
@ -5210,9 +5211,9 @@ static void test_GetRecommendedRenderingMode(void)
if (hr != S_OK)
win_skip("IDWriteFontFace3::GetRecommendedRenderingMode() is not supported.\n");
if (0) /* crashes on native */
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0,
DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, NULL);
if (0) /* crashes on native */
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0,
DWRITE_MEASURING_MODE_GDI_CLASSIC, NULL, NULL);
mode = 10;
hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0,

View File

@ -982,8 +982,8 @@ static void test_CreateTextFormat(void)
DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format);
ok(hr == S_OK, "got 0x%08x\n", hr);
if (0) /* crashes on native */
hr = IDWriteTextFormat_GetFontCollection(format, NULL);
if (0) /* crashes on native */
hr = IDWriteTextFormat_GetFontCollection(format, NULL);
collection = NULL;
hr = IDWriteTextFormat_GetFontCollection(format, &collection);
@ -2234,8 +2234,8 @@ static void test_SetLocaleName(void)
hr = IDWriteTextLayout_GetLocaleName(layout, 0, NULL, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
if (0) /* crashes on native */
hr = IDWriteTextLayout_GetLocaleName(layout, 0, NULL, 1, NULL);
if (0) /* crashes on native */
hr = IDWriteTextLayout_GetLocaleName(layout, 0, NULL, 1, NULL);
buffW[0] = 0;
range.length = 0;
@ -2446,8 +2446,8 @@ static void test_fallback(void)
return;
}
if (0) /* crashes on native */
hr = IDWriteTextLayout2_GetFontFallback(layout2, NULL);
if (0) /* crashes on native */
hr = IDWriteTextLayout2_GetFontFallback(layout2, NULL);
fallback = (void*)0xdeadbeef;
hr = IDWriteTextLayout2_GetFontFallback(layout2, &fallback);
@ -4370,9 +4370,9 @@ todo_wine {
ok(scale == 1.0f, "got %f\n", scale);
todo_wine
ok(font != NULL, "got %p\n", font);
if (font)
if (font) {
IDWriteFont_Release(font);
}
/* same latin text, full length */
g_source = strW;
mappedlength = 0;
@ -4387,9 +4387,9 @@ todo_wine {
ok(scale == 1.0f, "got %f\n", scale);
todo_wine
ok(font != NULL, "got %p\n", font);
if (font)
if (font) {
IDWriteFont_Release(font);
}
/* string 'a\x3058b' */
g_source = str2W;
mappedlength = 0;
@ -4404,9 +4404,9 @@ todo_wine {
ok(scale == 1.0f, "got %f\n", scale);
todo_wine
ok(font != NULL, "got %p\n", font);
if (font)
if (font) {
IDWriteFont_Release(font);
}
g_source = str2W;
mappedlength = 0;
scale = 0.0f;
@ -4544,8 +4544,8 @@ static void test_FontFallbackBuilder(void)
hr = IDWriteFontFallbackBuilder_AddMapping(builder, &range, 1, &familyW, 1, NULL, NULL, NULL, 4.0f);
ok(hr == S_OK, "got 0x%08x\n", hr);
if (0) /* crashes on native */
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, NULL);
if (0) /* crashes on native */
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, NULL);
hr = IDWriteFontFallbackBuilder_CreateFontFallback(builder, &fallback);
ok(hr == S_OK, "got 0x%08x\n", hr);