oleaut32: Add test for INT and UINT property return values.

This commit is contained in:
Vincent Povirk 2009-08-19 09:50:52 -05:00 committed by Alexandre Julliard
parent c8c839a9bc
commit 2ae20e45c7
3 changed files with 49 additions and 1 deletions

View File

@ -562,6 +562,22 @@ static HRESULT WINAPI Widget_get_prop_with_lcid(
return S_OK;
}
static HRESULT WINAPI Widget_get_prop_int(
IWidget* iface, INT *i)
{
trace("get_prop_int(%p)\n", i);
*i = -13;
return S_OK;
}
static HRESULT WINAPI Widget_get_prop_uint(
IWidget* iface, UINT *i)
{
trace("get_prop_uint(%p)\n", i);
*i = 42;
return S_OK;
}
static const struct IWidgetVtbl Widget_VTable =
{
Widget_QueryInterface,
@ -591,7 +607,9 @@ static const struct IWidgetVtbl Widget_VTable =
Widget_Error,
Widget_CloneInterface,
Widget_put_prop_with_lcid,
Widget_get_prop_with_lcid
Widget_get_prop_with_lcid,
Widget_get_prop_int,
Widget_get_prop_uint
};
static HRESULT WINAPI StaticWidget_QueryInterface(IStaticWidget *iface, REFIID riid, void **ppvObject)
@ -1299,6 +1317,28 @@ todo_wine
}
VariantClear(&varresult);
/* test propget of INT value */
dispparams.cNamedArgs = 0;
dispparams.cArgs = 0;
dispparams.rgvarg = NULL;
dispparams.rgdispidNamedArgs = NULL;
hr = IDispatch_Invoke(pDispatch, DISPID_TM_PROP_INT, &IID_NULL, 0x40c, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
ok_ole_success(hr, ITypeInfo_Invoke);
todo_wine ok(V_VT(&varresult) == VT_I4, "got %x\n", V_VT(&varresult));
ok(V_I4(&varresult) == -13, "got %x\n", V_I4(&varresult));
VariantClear(&varresult);
/* test propget of INT value */
dispparams.cNamedArgs = 0;
dispparams.cArgs = 0;
dispparams.rgvarg = NULL;
dispparams.rgdispidNamedArgs = NULL;
hr = IDispatch_Invoke(pDispatch, DISPID_TM_PROP_UINT, &IID_NULL, 0x40c, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
ok_ole_success(hr, ITypeInfo_Invoke);
todo_wine ok(V_VT(&varresult) == VT_UI4, "got %x\n", V_VT(&varresult));
ok(V_UI4(&varresult) == 42, "got %x\n", V_UI4(&varresult));
VariantClear(&varresult);
IDispatch_Release(pDispatch);
IWidget_Release(pWidget);

View File

@ -131,6 +131,12 @@ library TestTypelib
[id(DISPID_TM_PROP_WITH_LCID), propget]
HRESULT prop_with_lcid([in,lcid] long lcid, [out,retval] INT *i);
[id(DISPID_TM_PROP_INT), propget]
HRESULT prop_int([out,retval] INT *i);
[id(DISPID_TM_PROP_UINT), propget]
HRESULT prop_uint([out,retval] UINT *i);
}
[

View File

@ -35,5 +35,7 @@
#define DISPID_TM_TESTDUAL 16
#define DISPID_TM_STRUCTARGS 17
#define DISPID_TM_PROP_WITH_LCID 18
#define DISPID_TM_PROP_INT 19
#define DISPID_TM_PROP_UINT 20
#define DISPID_NOA_BSTRRET 1