ole32/tests: Don't crash if EnumFormatEtc failed

André Hentschel nerv at dawncrow.de
Sun Jul 1 04:40:01 CDT 2018


Signed-off-by: André Hentschel <nerv at dawncrow.de>
---
 dlls/ole32/tests/clipboard.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c
index 4890782..e518996 100644
--- a/dlls/ole32/tests/clipboard.c
+++ b/dlls/ole32/tests/clipboard.c
@@ -589,6 +589,11 @@ static void test_enum_fmtetc(IDataObject *src)
     hr = IDataObject_EnumFormatEtc(data, DATADIR_GET, &enum_fmt);
     ok(hr == S_OK, "got %08x\n", hr);
     ok(DataObjectImpl_EnumFormatEtc_calls == 0, "EnumFormatEtc was called\n");
+    if (FAILED(hr))
+    {
+        skip("EnumFormatEtc failed, skipping tests.\n");
+        return;
+    }
 
     if(src) IDataObject_EnumFormatEtc(src, DATADIR_GET, &src_enum);
 
@@ -1422,6 +1427,11 @@ static void test_nonole_clipboard(void)
     ok(hr == S_OK, "got %08x\n", hr);
     hr = IDataObject_EnumFormatEtc(get, DATADIR_GET, &enum_fmt);
     ok(hr == S_OK, "got %08x\n", hr);
+    if (FAILED(hr))
+    {
+        skip("EnumFormatEtc failed, skipping tests.\n");
+        return;
+    }
 
     hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
     ok(hr == S_OK, "got %08x\n", hr);
-- 
2.7.4





More information about the wine-devel mailing list