dmscript/tests: Test unimplemented IPersistStream methods in DMScript. (2nd try)

Michael Stefaniuc mstefani at redhat.de
Tue May 27 15:41:10 CDT 2014


---
Fixes brown paper bag compile warning.
Supersedes patch 104831.


 dlls/dmscript/script.c         |  2 --
 dlls/dmscript/tests/dmscript.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/dlls/dmscript/script.c b/dlls/dmscript/script.c
index 872b7af..6b9be6f 100644
--- a/dlls/dmscript/script.c
+++ b/dlls/dmscript/script.c
@@ -430,8 +430,6 @@ static HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_GetClassID (LPPERSIS
 }
 
 static HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
-  ICOM_THIS_MULTI(IDirectMusicScriptImpl, PersistStreamVtbl, iface);  
-  FIXME("(%p): stub, always S_FALSE\n", This);
   return S_FALSE;
 }
 
diff --git a/dlls/dmscript/tests/dmscript.c b/dlls/dmscript/tests/dmscript.c
index b2912a4..204cf7c 100644
--- a/dlls/dmscript/tests/dmscript.c
+++ b/dlls/dmscript/tests/dmscript.c
@@ -175,6 +175,33 @@ static void test_COM_scripttrack(void)
     while (IDirectMusicTrack_Release(dmt));
 }
 
+static void test_dmscript(void)
+{
+    IDirectMusicScript *dms;
+    IPersistStream *ps;
+    CLSID class;
+    ULARGE_INTEGER size;
+    HRESULT hr;
+
+    hr = CoCreateInstance(&CLSID_DirectMusicScript, NULL, CLSCTX_INPROC_SERVER,
+            &IID_IDirectMusicScript, (void**)&dms);
+    ok(hr == S_OK, "DirectMusicScript create failed: %08x, expected S_OK\n", hr);
+
+    /* Unimplemented IPersistStream methods */
+    hr = IDirectMusicScript_QueryInterface(dms, &IID_IPersistStream, (void**)&ps);
+    ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr);
+    hr = IPersistStream_GetClassID(ps, &class);
+    ok(hr == E_NOTIMPL, "IPersistStream_GetClassID failed: %08x\n", hr);
+    hr = IPersistStream_IsDirty(ps);
+    ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %08x\n", hr);
+    hr = IPersistStream_GetSizeMax(ps, &size);
+    ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %08x\n", hr);
+    hr = IPersistStream_Save(ps, NULL, TRUE);
+    ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %08x\n", hr);
+
+    while (IDirectMusicScript_Release(dms));
+}
+
 START_TEST(dmscript)
 {
     CoInitialize(NULL);
@@ -187,6 +214,7 @@ START_TEST(dmscript)
     }
     test_COM();
     test_COM_scripttrack();
+    test_dmscript();
 
     CoUninitialize();
 }
-- 
1.8.3.1



More information about the wine-patches mailing list