[PATCH 1/6] dwrite/tests: Do not segfault in tests if NULL is returned.

Giovanni Mascellani gmascellani at codeweavers.com
Mon Mar 8 03:31:14 CST 2021


Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 dlls/dwrite/tests/layout.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 43a00b7e22e..d186f47cc94 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -4714,6 +4714,7 @@ if (font) {
     ok(scale == 1.0f, "got %f\n", scale);
     ok(font != NULL, "got %p\n", font);
 
+if (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);
@@ -4722,6 +4723,7 @@ if (font) {
     ok(!lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW));
     IDWriteLocalizedStrings_Release(strings);
     IDWriteFont_Release(font);
+}
 
     /* 2. Hiragana character, force Tahoma font does not support Japanese */
     g_source = str2W;
@@ -4735,6 +4737,7 @@ if (font) {
     ok(scale == 1.0f, "got %f\n", scale);
     ok(font != NULL, "got %p\n", font);
 
+if (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);
@@ -4744,6 +4747,7 @@ todo_wine
     ok(lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW));
     IDWriteLocalizedStrings_Release(strings);
     IDWriteFont_Release(font);
+}
 
     IDWriteFontFallback_Release(fallback);
     IDWriteFactory2_Release(factory2);
-- 
2.30.1




More information about the wine-devel mailing list