From 19b6c4cfc77e05e4ea21de59096e02a9c3ee6d5f Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 30 May 2014 23:09:20 +0200 Subject: [PATCH] dmscript/tests: Test some IPersistStream methods of DMScriptTrack. --- dlls/dmscript/tests/dmscript.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dlls/dmscript/tests/dmscript.c b/dlls/dmscript/tests/dmscript.c index 204cf7c3ac1..02fddc3c7e0 100644 --- a/dlls/dmscript/tests/dmscript.c +++ b/dlls/dmscript/tests/dmscript.c @@ -202,6 +202,37 @@ static void test_dmscript(void) while (IDirectMusicScript_Release(dms)); } +static void test_scripttrack(void) +{ + IDirectMusicTrack *dmt; + IPersistStream *ps; + CLSID class; + ULARGE_INTEGER size; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicScriptTrack, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicTrack, (void**)&dmt); + ok(hr == S_OK, "DirectMusicScriptTrack create failed: %08x, expected S_OK\n", hr); + + /* IPersistStream */ + hr = IDirectMusicTrack_QueryInterface(dmt, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + hr = IPersistStream_GetClassID(ps, &class); + todo_wine ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr); + todo_wine ok(IsEqualGUID(&class, &CLSID_DirectMusicScriptTrack), + "Expected class CLSID_DirectMusicScriptTrack got %s\n", wine_dbgstr_guid(&class)); + + /* Unimplemented IPersistStream methods */ + hr = IPersistStream_IsDirty(ps); + todo_wine 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 (IDirectMusicTrack_Release(dmt)); +} + START_TEST(dmscript) { CoInitialize(NULL); @@ -215,6 +246,7 @@ START_TEST(dmscript) test_COM(); test_COM_scripttrack(); test_dmscript(); + test_scripttrack(); CoUninitialize(); }