[PATCH v3 1/6] oleaut32/tests: Abort earlier if we fail to create a proxy.

Zebediah Figura z.figura12 at gmail.com
Mon Oct 29 23:20:20 CDT 2018


We are not testing anything meaningful in this case.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/oleaut32/tests/tmarshal.c | 51 +++++++++++++---------------------
 1 file changed, 20 insertions(+), 31 deletions(-)

diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c
index 68547f7e98..aab8f2cd34 100644
--- a/dlls/oleaut32/tests/tmarshal.c
+++ b/dlls/oleaut32/tests/tmarshal.c
@@ -35,12 +35,6 @@ static HRESULT (WINAPI *pVarAdd)(LPVARIANT,LPVARIANT,LPVARIANT);
 
 #define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
 
-#ifdef __i386__
-static const int tmarshal_todo = 0;
-#else
-static const int tmarshal_todo = 1;
-#endif
-
 /* ULL suffix is not portable */
 #define ULL_CONST(dw1, dw2) ((((ULONGLONG)dw1) << 32) | (ULONGLONG)dw2)
 
@@ -1436,9 +1430,16 @@ static void test_typelibmarshal(void)
 
     IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
     hr = CoUnmarshalInterface(pStream, &IID_IKindaEnumWidget, (void **)&pKEW);
-    todo_wine_if(tmarshal_todo)
+#ifndef __i386__
+    todo_wine
+#endif
     ok_ole_success(hr, CoUnmarshalInterface);
     IStream_Release(pStream);
+    if (FAILED(hr))
+    {
+        end_host_object(tid, thread);
+        return;
+    }
 
     hr = IKindaEnumWidget_Next(pKEW, &pWidget);
     ok_ole_success(hr, IKindaEnumWidget_Next);
@@ -1463,7 +1464,6 @@ static void test_typelibmarshal(void)
     VariantInit(&varresult);
     hr = IDispatch_Invoke(pDispatch, DISPID_TM_NAME, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
     ok_ole_success(hr, IDispatch_Invoke);
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == S_OK,
         "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
         excepinfo.wCode, excepinfo.scode);
@@ -1483,7 +1483,6 @@ static void test_typelibmarshal(void)
     VariantInit(&varresult);
     hr = IDispatch_Invoke(pDispatch, DISPID_TM_NAME, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
     ok_ole_success(hr, IDispatch_Invoke);
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == S_OK,
         "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
         excepinfo.wCode, excepinfo.scode);
@@ -1615,7 +1614,6 @@ static void test_typelibmarshal(void)
     hr = IDispatch_Invoke(pDispatch, DISPID_TM_CLONEDISPATCH, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
     ok_ole_success(hr, IDispatch_Invoke);
 
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == S_OK,
         "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
         excepinfo.wCode, excepinfo.scode);
@@ -1633,7 +1631,6 @@ static void test_typelibmarshal(void)
     hr = IDispatch_Invoke(pDispatch, DISPID_TM_CLONECOCLASS, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
     ok_ole_success(hr, IDispatch_Invoke);
 
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == S_OK,
        "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
        excepinfo.wCode, excepinfo.scode);
@@ -1650,7 +1647,6 @@ static void test_typelibmarshal(void)
     VariantInit(&varresult);
     hr = IDispatch_Invoke(pDispatch, DISPID_TM_COCLASS, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
     todo_wine ok_ole_success(hr, IDispatch_Invoke);
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == S_OK,
         "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
         excepinfo.wCode, excepinfo.scode);
@@ -1670,7 +1666,6 @@ static void test_typelibmarshal(void)
     hr = IDispatch_Invoke(pDispatch, DISPID_VALUE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
     ok_ole_success(hr, IDispatch_Invoke);
 
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == S_OK,
         "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
         excepinfo.wCode, excepinfo.scode);
@@ -1726,9 +1721,9 @@ static void test_typelibmarshal(void)
     V_I4(&vararg[1]) = 2;
     hr = IWidget_VariantCArray(pWidget, 2, vararg);
     ok_ole_success(hr, IWidget_VariantCArray);
-    todo_wine_if(!tmarshal_todo)
+todo_wine
     ok(V_VT(&vararg[0]) == VT_I4 && V_I4(&vararg[0]) == 2, "vararg[0] = %d[%d]\n", V_VT(&vararg[0]), V_I4(&vararg[0]));
-    todo_wine_if(!tmarshal_todo)
+todo_wine
     ok(V_VT(&vararg[1]) == VT_I4 && V_I4(&vararg[1]) == 3, "vararg[1] = %d[%d]\n", V_VT(&vararg[1]), V_I4(&vararg[1]));
 
     /* call VarArg */
@@ -1799,7 +1794,6 @@ static void test_typelibmarshal(void)
     VariantInit(&varresult);
     hr = IDispatch_Invoke(pDispatch, DISPID_TM_ERROR, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, &excepinfo, NULL);
     ok(hr == DISP_E_EXCEPTION, "IDispatch_Invoke should have returned DISP_E_EXCEPTION instead of 0x%08x\n", hr);
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == E_NOTIMPL,
         "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
         excepinfo.wCode, excepinfo.scode);
@@ -1826,7 +1820,6 @@ static void test_typelibmarshal(void)
     hr = ITypeInfo_Invoke(pTypeInfo, &NonOleAutomation, DISPID_NOA_ERROR, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
     ok(hr == DISP_E_EXCEPTION, "ITypeInfo_Invoke should have returned DISP_E_EXCEPTION instead of 0x%08x\n", hr);
     ok(V_VT(&varresult) == VT_EMPTY, "V_VT(&varresult) should be VT_EMPTY instead of %d\n", V_VT(&varresult));
-    todo_wine_if(tmarshal_todo)
     ok(excepinfo.wCode == 0x0 && excepinfo.scode == E_NOTIMPL,
         "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n",
         excepinfo.wCode, excepinfo.scode);
@@ -2140,8 +2133,16 @@ static void test_external_connection(void)
 
     IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
     hres = CoUnmarshalInterface(stream, &IID_ItestDual, (void**)&iface);
-    todo_wine_if(tmarshal_todo)
+#ifndef __i386__
+    todo_wine
+#endif
     ok(hres == S_OK, "CoUnmarshalInterface failed: %08x\n", hres);
+    if (FAILED(hres))
+    {
+        end_host_object(tid, thread);
+        IStream_Release(stream);
+        return;
+    }
     ok(external_connections == 1, "external_connections = %d\n", external_connections);
 
     IStream_Release(stream);
@@ -2149,19 +2150,16 @@ static void test_external_connection(void)
 
     /* Creating a stub for new iface causes new external connection. */
     hres = ItestDual_QueryInterface(iface, &IID_ITestSecondDisp, (void**)&second);
-    todo_wine_if(tmarshal_todo)
     ok(hres == S_OK, "Could not get ITestSecondDisp iface: %08x\n", hres);
     todo_wine
     ok(external_connections == 2, "external_connections = %d\n", external_connections);
 
-    if (hres == S_OK)
-        ITestSecondDisp_Release(second);
+    ITestSecondDisp_Release(second);
     todo_wine
     ok(external_connections == 2, "external_connections = %d\n", external_connections);
 
     expect_last_release_closes = TRUE;
     ItestDual_Release(iface);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 0, "external_connections = %d\n", external_connections);
 
     end_host_object(tid, thread);
@@ -2173,14 +2171,12 @@ static void test_external_connection(void)
     expect_last_release_closes = FALSE;
     hres = CoMarshalInterface(stream, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
     ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 1, "external_connections = %d\n", external_connections);
 
     expect_last_release_closes = TRUE;
     IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
     hres = CoReleaseMarshalData(stream);
     ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 0, "external_connections = %d\n", external_connections);
 
     /* Two separated marshal data are still one external connection. */
@@ -2191,25 +2187,21 @@ static void test_external_connection(void)
     IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
     hres = CoMarshalInterface(stream, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
     ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 1, "external_connections = %d\n", external_connections);
 
     hres = CoMarshalInterface(stream2, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
     ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 1, "external_connections = %d\n", external_connections);
 
     IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
     hres = CoReleaseMarshalData(stream);
     ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 1, "external_connections = %d\n", external_connections);
 
     expect_last_release_closes = TRUE;
     IStream_Seek(stream2, zero, STREAM_SEEK_SET, NULL);
     hres = CoReleaseMarshalData(stream2);
     ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 0, "external_connections = %d\n", external_connections);
 
     IStream_Release(stream);
@@ -2221,20 +2213,17 @@ static void test_external_connection(void)
 
     hres = CoMarshalInterface(stream, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_TABLEWEAK);
     ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 0, "external_connections = %d\n", external_connections);
 
     IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
     hres = CoUnmarshalInterface(stream, &IID_ItestDual, (void**)&iface);
     ok(hres == S_OK, "CoUnmarshalInterface failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 0, "external_connections = %d\n", external_connections);
     ItestDual_Release(iface);
 
     IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
     hres = CoReleaseMarshalData(stream);
     ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
-    todo_wine_if(tmarshal_todo)
     ok(external_connections == 0, "external_connections = %d\n", external_connections);
 
     IStream_Release(stream);
-- 
2.19.1




More information about the wine-devel mailing list