Robert Shearman : ole32: Add tests for IsRunning, GetTimeOfLastChange, BindToObject, BindToStorage and Inverse.

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 8 15:38:18 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 71a7393f451cca87d0c1625dbc294fa84e0c094e
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=71a7393f451cca87d0c1625dbc294fa84e0c094e

Author: Robert Shearman <rob at codeweavers.com>
Date:   Mon May  8 15:55:01 2006 +0100

ole32: Add tests for IsRunning, GetTimeOfLastChange, BindToObject, BindToStorage and Inverse.

---

 dlls/ole32/tests/moniker.c |  102 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 101 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c
index 2e7cd7d..bb22b74 100644
--- a/dlls/ole32/tests/moniker.c
+++ b/dlls/ole32/tests/moniker.c
@@ -482,6 +482,10 @@ static void test_class_moniker(void)
     IMoniker *moniker;
     DWORD moniker_type;
     DWORD hash;
+    IBindCtx *bindctx;
+    IMoniker *inverse;
+    IUnknown *unknown;
+    FILETIME filetime;
 
     hr = CreateClassMoniker(&CLSID_StdComponentCategoriesMgr, &moniker);
     todo_wine ok_ole_success(hr, CreateClassMoniker);
@@ -511,6 +515,30 @@ static void test_class_moniker(void)
         "dwMkSys != MKSYS_CLASSMONIKER, instead was 0x%08lx",
         moniker_type);
 
+    hr = CreateBindCtx(0, &bindctx);
+    ok_ole_success(hr, CreateBindCtx);
+
+    /* IsRunning test */
+    hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL);
+    ok(hr == E_NOTIMPL, "IMoniker_IsRunning should return E_NOTIMPL, not 0x%08lx\n", hr);
+
+    hr = IMoniker_GetTimeOfLastChange(moniker, bindctx, NULL, &filetime);
+    ok(hr == MK_E_UNAVAILABLE, "IMoniker_GetTimeOfLastChange should return MK_E_UNAVAILABLE, not 0x%08lx\n", hr);
+
+    hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    ok_ole_success(hr, IMoniker_BindToStorage);
+    IUnknown_Release(unknown);
+
+    hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    ok_ole_success(hr, IMoniker_BindToStorage);
+    IUnknown_Release(unknown);
+
+    IBindCtx_Release(bindctx);
+
+    hr = IMoniker_Inverse(moniker, &inverse);
+    ok_ole_success(hr, IMoniker_Inverse);
+    IMoniker_Release(inverse);
+
     IMoniker_Release(moniker);
 }
 
@@ -582,6 +610,9 @@ static void test_item_moniker(void)
     IMoniker *moniker;
     DWORD moniker_type;
     DWORD hash;
+    IBindCtx *bindctx;
+    IMoniker *inverse;
+    IUnknown *unknown;
     static const WCHAR wszDelimeter[] = {'!',0};
     static const WCHAR wszObjectName[] = {'T','e','s','t',0};
     static const WCHAR expected_display_name[] = { '!','T','e','s','t',0 };
@@ -613,6 +644,25 @@ static void test_item_moniker(void)
         "dwMkSys != MKSYS_ITEMMONIKER, instead was 0x%08lx",
         moniker_type);
 
+    hr = CreateBindCtx(0, &bindctx);
+    ok_ole_success(hr, CreateBindCtx);
+
+    /* IsRunning test */
+    hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL);
+    ok(hr == S_FALSE, "IMoniker_IsRunning should return S_FALSE, not 0x%08lx\n", hr);
+
+    hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    ok(hr == E_INVALIDARG, "IMoniker_BindToStorage should return E_INVALIDARG, not 0x%08lx\n", hr);
+
+    hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    ok(hr == E_INVALIDARG, "IMoniker_BindToObject should return E_INVALIDARG, not 0x%08lx\n", hr);
+
+    IBindCtx_Release(bindctx);
+
+    hr = IMoniker_Inverse(moniker, &inverse);
+    ok_ole_success(hr, IMoniker_Inverse);
+    IMoniker_Release(inverse);
+
     IMoniker_Release(moniker);
 }
 
@@ -620,9 +670,12 @@ static void test_anti_moniker(void)
 {
     HRESULT hr;
     IMoniker *moniker;
-    IMoniker *inverse;
     DWORD moniker_type;
     DWORD hash;
+    IBindCtx *bindctx;
+    FILETIME filetime;
+    IMoniker *inverse;
+    IUnknown *unknown;
     static const WCHAR expected_display_name[] = { '\\','.','.',0 };
 
     hr = CreateAntiMoniker(&moniker);
@@ -653,6 +706,24 @@ static void test_anti_moniker(void)
     ok(hr == MK_E_NOINVERSE, "IMoniker_Inverse should have returned MK_E_NOINVERSE instead of 0x%08lx\n", hr);
     ok(inverse == NULL, "inverse should have been set to NULL instead of %p\n", inverse);
 
+    hr = CreateBindCtx(0, &bindctx);
+    ok_ole_success(hr, CreateBindCtx);
+
+    /* IsRunning test */
+    hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL);
+    ok(hr == S_FALSE, "IMoniker_IsRunning should return S_FALSE, not 0x%08lx\n", hr);
+
+    hr = IMoniker_GetTimeOfLastChange(moniker, bindctx, NULL, &filetime);
+    ok(hr == E_NOTIMPL, "IMoniker_GetTimeOfLastChange should return E_NOTIMPL, not 0x%08lx\n", hr);
+
+    hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    ok(hr == E_NOTIMPL, "IMoniker_BindToObject should return E_NOTIMPL, not 0x%08lx\n", hr);
+
+    hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    ok(hr == E_NOTIMPL, "IMoniker_BindToStorage should return E_NOTIMPL, not 0x%08lx\n", hr);
+
+    IBindCtx_Release(bindctx);
+
     IMoniker_Release(moniker);
 }
 
@@ -664,6 +735,10 @@ static void test_generic_composite_monik
     IMoniker *moniker2;
     DWORD moniker_type;
     DWORD hash;
+    IBindCtx *bindctx;
+    FILETIME filetime;
+    IMoniker *inverse;
+    IUnknown *unknown;
     static const WCHAR wszDelimeter1[] = {'!',0};
     static const WCHAR wszObjectName1[] = {'T','e','s','t',0};
     static const WCHAR wszDelimeter2[] = {'#',0};
@@ -701,6 +776,31 @@ static void test_generic_composite_monik
         "dwMkSys != MKSYS_GENERICCOMPOSITE, instead was 0x%08lx",
         moniker_type);
 
+    hr = CreateBindCtx(0, &bindctx);
+    ok_ole_success(hr, CreateBindCtx);
+
+    /* IsRunning test */
+    hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL);
+    todo_wine
+    ok(hr == S_FALSE, "IMoniker_IsRunning should return S_FALSE, not 0x%08lx\n", hr);
+
+    hr = IMoniker_GetTimeOfLastChange(moniker, bindctx, NULL, &filetime);
+    ok(hr == MK_E_NOTBINDABLE, "IMoniker_GetTimeOfLastChange should return MK_E_NOTBINDABLE, not 0x%08lx\n", hr);
+
+    hr = IMoniker_BindToObject(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    todo_wine
+    ok(hr == E_INVALIDARG, "IMoniker_BindToObject should return E_INVALIDARG, not 0x%08lx\n", hr);
+
+    todo_wine
+    hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IUnknown, (void **)&unknown);
+    ok(hr == E_INVALIDARG, "IMoniker_BindToStorage should return E_INVALIDARG, not 0x%08lx\n", hr);
+
+    IBindCtx_Release(bindctx);
+
+    hr = IMoniker_Inverse(moniker, &inverse);
+    ok_ole_success(hr, IMoniker_Inverse);
+    IMoniker_Release(inverse);
+
     IMoniker_Release(moniker);
 }
 




More information about the wine-cvs mailing list