Commit 1742012f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

oleaut32: Added more tests.

parent 44936abd
...@@ -153,6 +153,35 @@ static void end_host_object(DWORD tid, HANDLE thread) ...@@ -153,6 +153,35 @@ static void end_host_object(DWORD tid, HANDLE thread)
static ItestDual TestDual, TestDualDisp; static ItestDual TestDual, TestDualDisp;
static HRESULT WINAPI TestSecondIface_QueryInterface(ITestSecondIface *iface, REFIID riid, void **ppv)
{
return ItestDual_QueryInterface(&TestDual, riid, ppv);
}
static ULONG WINAPI TestSecondIface_AddRef(ITestSecondIface *iface)
{
return 2;
}
static ULONG WINAPI TestSecondIface_Release(ITestSecondIface *iface)
{
return 1;
}
static HRESULT WINAPI TestSecondIface_test(ITestSecondIface *iface)
{
return 1;
}
static const ITestSecondIfaceVtbl TestSecondIfaceVtbl = {
TestSecondIface_QueryInterface,
TestSecondIface_AddRef,
TestSecondIface_Release,
TestSecondIface_test
};
static ITestSecondIface TestSecondIface = { &TestSecondIfaceVtbl };
static HRESULT WINAPI TestDual_QueryInterface(ItestDual *iface, REFIID riid, void **ppvObject) static HRESULT WINAPI TestDual_QueryInterface(ItestDual *iface, REFIID riid, void **ppvObject)
{ {
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDispatch)) { if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDispatch)) {
...@@ -161,6 +190,9 @@ static HRESULT WINAPI TestDual_QueryInterface(ItestDual *iface, REFIID riid, voi ...@@ -161,6 +190,9 @@ static HRESULT WINAPI TestDual_QueryInterface(ItestDual *iface, REFIID riid, voi
}else if(IsEqualGUID(riid, &IID_ItestDual)) { }else if(IsEqualGUID(riid, &IID_ItestDual)) {
*ppvObject = &TestDual; *ppvObject = &TestDual;
return S_OK; return S_OK;
}else if(IsEqualGUID(riid, &IID_ITestSecondIface)) {
*ppvObject = &TestSecondIface;
return S_OK;
} }
*ppvObject = NULL; *ppvObject = NULL;
...@@ -786,6 +818,13 @@ static HRESULT WINAPI StaticWidget_TestDual(IStaticWidget *iface, ItestDual *p) ...@@ -786,6 +818,13 @@ static HRESULT WINAPI StaticWidget_TestDual(IStaticWidget *iface, ItestDual *p)
return S_OK; return S_OK;
} }
static HRESULT WINAPI StaticWidget_TestSecondIface(IStaticWidget *iface, ITestSecondIface *p)
{
trace("TestSecondIface()\n");
ok(p == &TestSecondIface, "wrong ItestSecondIface\n");
return S_OK;
}
static const IStaticWidgetVtbl StaticWidgetVtbl = { static const IStaticWidgetVtbl StaticWidgetVtbl = {
StaticWidget_QueryInterface, StaticWidget_QueryInterface,
StaticWidget_AddRef, StaticWidget_AddRef,
...@@ -794,7 +833,8 @@ static const IStaticWidgetVtbl StaticWidgetVtbl = { ...@@ -794,7 +833,8 @@ static const IStaticWidgetVtbl StaticWidgetVtbl = {
StaticWidget_GetTypeInfo, StaticWidget_GetTypeInfo,
StaticWidget_GetIDsOfNames, StaticWidget_GetIDsOfNames,
StaticWidget_Invoke, StaticWidget_Invoke,
StaticWidget_TestDual StaticWidget_TestDual,
StaticWidget_TestSecondIface
}; };
static IStaticWidget StaticWidget = { &StaticWidgetVtbl }; static IStaticWidget StaticWidget = { &StaticWidgetVtbl };
...@@ -1624,6 +1664,20 @@ static void test_StaticWidget(void) ...@@ -1624,6 +1664,20 @@ static void test_StaticWidget(void)
ok(V_VT(&varresult) == VT_EMPTY, "vt %x\n", V_VT(&varresult)); ok(V_VT(&varresult) == VT_EMPTY, "vt %x\n", V_VT(&varresult));
VariantClear(&varresult); VariantClear(&varresult);
/* call TestSecondIface */
dispparams.cNamedArgs = 0;
dispparams.cArgs = 1;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = vararg;
V_VT(vararg) = VT_DISPATCH;
V_DISPATCH(vararg) = (IDispatch*)&TestDualDisp;
VariantInit(&varresult);
hr = ITypeInfo_Invoke(type_info, &StaticWidget, DISPID_TM_TESTSECONDIFACE, DISPATCH_METHOD,
&dispparams, &varresult, &excepinfo, NULL);
ok_ole_success(hr, IDispatch_Invoke);
ok(V_VT(&varresult) == VT_EMPTY, "vt %x\n", V_VT(&varresult));
VariantClear(&varresult);
ITypeInfo_Release(type_info); ITypeInfo_Release(type_info);
} }
......
...@@ -66,6 +66,15 @@ library TestTypelib ...@@ -66,6 +66,15 @@ library TestTypelib
[ [
odl, odl,
uuid(3f7e06fe-0bce-46f0-8b7d-3a68393c7968)
]
interface ITestSecondIface : IUnknown
{
HRESULT test();
}
[
odl,
uuid(a1f8cae3-c947-4c5f-b57d-c87b9b5f3586), uuid(a1f8cae3-c947-4c5f-b57d-c87b9b5f3586),
oleautomation, oleautomation,
dual dual
...@@ -168,6 +177,9 @@ library TestTypelib ...@@ -168,6 +177,9 @@ library TestTypelib
{ {
[id(DISPID_TM_TESTDUAL)] [id(DISPID_TM_TESTDUAL)]
HRESULT TestDual([in] ItestDual *p); HRESULT TestDual([in] ItestDual *p);
[id(DISPID_TM_TESTSECONDIFACE)]
HRESULT TestSecondIface([in] ITestSecondIface *p);
} }
[ [
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#define DISPID_TM_VARCARRAY 24 #define DISPID_TM_VARCARRAY 24
#define DISPID_TM_RESTRICTED 25 #define DISPID_TM_RESTRICTED 25
#define DISPID_TM_NEG_RESTRICTED -26 #define DISPID_TM_NEG_RESTRICTED -26
#define DISPID_TM_TESTSECONDIFACE 27
#define DISPID_NOA_BSTRRET 1 #define DISPID_NOA_BSTRRET 1
#define DISPID_NOA_ERROR 2 #define DISPID_NOA_ERROR 2
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