=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: ole32/tests: Don' t crash if EnumFormatEtc failed.

Alexandre Julliard julliard at winehq.org
Tue Jul 3 15:58:56 CDT 2018


Module: wine
Branch: master
Commit: 355f6b24d2c33a48cea0fa7ef40a303f5030e4d2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=355f6b24d2c33a48cea0fa7ef40a303f5030e4d2

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sun Jul  1 11:40:01 2018 +0200

ole32/tests: Don't crash if EnumFormatEtc failed.

Signed-off-by: André Hentschel <nerv at dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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);




More information about the wine-cvs mailing list