Commit 462ef661 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

oleaut32/tests: Add a test to show that support for coercion to arrays of…

oleaut32/tests: Add a test to show that support for coercion to arrays of variants is specific to vararg methods.
parent 97ce5f48
...@@ -1534,6 +1534,30 @@ static void test_typelibmarshal(void) ...@@ -1534,6 +1534,30 @@ static void test_typelibmarshal(void)
ok_ole_success(hr, IDispatch_Invoke); ok_ole_success(hr, IDispatch_Invoke);
VariantClear(&varresult); VariantClear(&varresult);
/* call Array with BSTR argument - type mismatch */
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_BSTR;
V_BSTR(&vararg[0]) = SysAllocString(szSuperman);
dispparams.cNamedArgs = 0;
dispparams.cArgs = 1;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = vararg;
hr = IDispatch_Invoke(pDispatch, DISPID_TM_ARRAY, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
ok(hr == DISP_E_TYPEMISMATCH || hr == DISP_E_BADVARTYPE, "expected DISP_E_TYPEMISMATCH, got %#x\n", hr);
SysFreeString(V_BSTR(&vararg[0]));
/* call ArrayPtr with BSTR argument - type mismatch */
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_BSTR;
V_BSTR(&vararg[0]) = SysAllocString(szSuperman);
dispparams.cNamedArgs = 0;
dispparams.cArgs = 1;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = vararg;
hr = IDispatch_Invoke(pDispatch, DISPID_TM_VARARRAYPTR, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
ok(hr == DISP_E_TYPEMISMATCH || hr == DISP_E_BADVARTYPE, "expected DISP_E_TYPEMISMATCH, got %#x\n", hr);
SysFreeString(V_BSTR(&vararg[0]));
/* call VariantCArray - test marshaling of variant arrays */ /* call VariantCArray - test marshaling of variant arrays */
V_VT(&vararg[0]) = VT_I4; V_VT(&vararg[0]) = VT_I4;
V_I4(&vararg[0]) = 1; V_I4(&vararg[0]) = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment