Module: wine Branch: master Commit: dba91c064357a79e253a4bf47cd944bc92758941 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dba91c064357a79e253a4bf47c...
Author: Huw Davies huw@codeweavers.com Date: Tue Mar 2 14:49:47 2010 +0000
oleaut32: Add a test for non-oleautomation error handling.
---
dlls/oleaut32/tests/tmarshal.c | 19 +++++++++++++++++++ dlls/oleaut32/tests/tmarshal.idl | 3 +++ dlls/oleaut32/tests/tmarshal_dispids.h | 1 + 3 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c index ae4f2aa..33adf3c 100644 --- a/dlls/oleaut32/tests/tmarshal.c +++ b/dlls/oleaut32/tests/tmarshal.c @@ -895,12 +895,18 @@ static BSTR WINAPI NonOleAutomation_BstrRet(INonOleAutomation *iface) return SysAllocString(wszTestString); }
+static HRESULT WINAPI NonOleAutomation_Error(INonOleAutomation *iface) +{ + return E_NOTIMPL; +} + static INonOleAutomationVtbl NonOleAutomation_VTable = { NonOleAutomation_QueryInterface, NonOleAutomation_AddRef, NonOleAutomation_Release, NonOleAutomation_BstrRet, + NonOleAutomation_Error };
static INonOleAutomation NonOleAutomation = { &NonOleAutomation_VTable }; @@ -1239,6 +1245,19 @@ static void test_typelibmarshal(void) ok(V_BSTR(&varresult) != NULL, "V_BSTR(&varresult) should not be NULL\n");
VariantClear(&varresult); + + dispparams.cNamedArgs = 0; + dispparams.cArgs = 0; + dispparams.rgdispidNamedArgs = NULL; + dispparams.rgvarg = NULL; + 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)); + ok(excepinfo.wCode == 0x0 && excepinfo.scode == E_NOTIMPL, + "EXCEPINFO differs from expected: wCode = 0x%x, scode = 0x%08x\n", + excepinfo.wCode, excepinfo.scode); + VariantClear(&varresult); + ITypeInfo_Release(pTypeInfo);
/* tests call put_Name without named arg */ diff --git a/dlls/oleaut32/tests/tmarshal.idl b/dlls/oleaut32/tests/tmarshal.idl index 41079d0..5dc3a12 100644 --- a/dlls/oleaut32/tests/tmarshal.idl +++ b/dlls/oleaut32/tests/tmarshal.idl @@ -184,6 +184,9 @@ library TestTypelib { [id(DISPID_NOA_BSTRRET)] BSTR BstrRet(); + + [id(DISPID_NOA_ERROR)] + HRESULT Error(); }
diff --git a/dlls/oleaut32/tests/tmarshal_dispids.h b/dlls/oleaut32/tests/tmarshal_dispids.h index 1cfd87b..ad8ba1b 100644 --- a/dlls/oleaut32/tests/tmarshal_dispids.h +++ b/dlls/oleaut32/tests/tmarshal_dispids.h @@ -40,3 +40,4 @@ #define DISPID_TM_BYREF_UINT 21
#define DISPID_NOA_BSTRRET 1 +#define DISPID_NOA_ERROR 2