From 03510be55be240aede90d113007dc8e3f14f3625 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 31 Aug 2006 17:19:34 +0100 Subject: [PATCH] ole32: Add a test for OleLoad. --- dlls/ole32/tests/ole2.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dlls/ole32/tests/ole2.c b/dlls/ole32/tests/ole2.c index e9055ce3b77..c7a3023111d 100644 --- a/dlls/ole32/tests/ole2.c +++ b/dlls/ole32/tests/ole2.c @@ -759,6 +759,37 @@ static void test_OleCreate(IStorage *pStorage) trace("end\n"); } +static void test_OleLoad(IStorage *pStorage) +{ + HRESULT hr; + IOleObject *pObject; + + static const char *methods_oleload[] = + { + "OleObject_QueryInterface", + "OleObject_AddRef", + "OleObject_QueryInterface", + "OleObject_AddRef", + "OleObject_GetMiscStatus", + "OleObject_QueryInterface", + "OleObjectPersistStg_AddRef", + "OleObjectPersistStg_Load", + "OleObjectPersistStg_Release", + "OleObject_SetClientSite", + "OleObject_Release", + "OleObject_QueryInterface", + "OleObject_Release", + NULL + }; + + expected_method_list = methods_oleload; + trace("OleLoad:\n"); + hr = OleLoad(pStorage, &IID_IOleObject, (IOleClientSite *)0xdeadbeef, (void **)&pObject); + ok_ole_success(hr, "OleLoad"); + IOleObject_Release(pObject); + ok(!*expected_method_list, "Method sequence starting from %s not called\n", *expected_method_list); +} + START_TEST(ole2) { DWORD dwRegister; @@ -780,6 +811,8 @@ START_TEST(ole2) ok_ole_success(hr, "IStorage_Stat"); ok(IsEqualCLSID(&CLSID_Equation3, &statstg.clsid), "Wrong CLSID in storage\n"); + test_OleLoad(pStorage); + IStorage_Release(pStorage); hr = CoRevokeClassObject(dwRegister);