Commit 748c3ea9 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

ole32: Add a couple more defaulthandler tests.

parent 84c07af4
......@@ -171,7 +171,7 @@ static ULONG WINAPI test_class_Release(IUnknown *iface)
return 1;
}
static IUnknownVtbl test_class_vtbl = {
static const IUnknownVtbl test_class_vtbl = {
test_class_QueryInterface,
test_class_AddRef,
test_class_Release,
......@@ -231,7 +231,7 @@ static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
return E_NOTIMPL;
}
static IClassFactoryVtbl ClassFactoryVtbl = {
static const IClassFactoryVtbl ClassFactoryVtbl = {
ClassFactory_QueryInterface,
ClassFactory_AddRef,
ClassFactory_Release,
......@@ -247,6 +247,8 @@ static void test_default_handler_run(void)
IUnknown *unk;
IRunnableObject *ro;
IOleObject *oleobj;
IPersistStorage *persist;
DWORD class_reg;
HRESULT hres;
......@@ -281,6 +283,14 @@ static void test_default_handler_run(void)
hres = OleCreateDefaultHandler(&test_server_clsid, NULL, &IID_IUnknown, (void**)&unk);
ok(hres == S_OK, "OleCreateDefaultHandler failed: %x\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %x\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IPersistStorage, (void**)&persist);
ok(hres == S_OK, "QueryInterface(IID_IPersistStorage) failed: %x\n", hres);
IPersistStorage_Release(persist);
IOleObject_Release(oleobj);
hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&ro);
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %x\n", hres);
IUnknown_Release(unk);
......@@ -288,11 +298,23 @@ static void test_default_handler_run(void)
SET_EXPECT(CF_QueryInterface_ClassFactory);
SET_EXPECT(CF_CreateInstance);
hres = IRunnableObject_Run(ro, NULL);
todo_wine ok(hres == S_OK, "Run failed: %x\n", hres);
todo_wine
ok(hres == S_OK, "Run failed: %x\n", hres);
CHECK_CALLED(CF_QueryInterface_ClassFactory);
CHECK_CALLED(CF_CreateInstance);
IRunnableObject_Release(ro);
SET_EXPECT(CF_QueryInterface_ClassFactory);
SET_EXPECT(CF_CreateInstance);
hres = CoCreateInstance(&test_server_clsid, NULL, CLSCTX_LOCAL_SERVER,
&IID_IOleObject, (void**)&oleobj);
todo_wine
ok(hres == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %x\n", hres);
todo_wine
CHECK_NOT_CALLED(CF_QueryInterface_ClassFactory);
todo_wine
CHECK_NOT_CALLED(CF_CreateInstance);
SET_EXPECT(CF_QueryInterface_IMarshal);
CoRevokeClassObject(class_reg);
todo_wine CHECK_CALLED(CF_QueryInterface_IMarshal);
......
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