Module: wine Branch: master Commit: 693b40f7dcf2d14a8d4ef18762ebce241a8687ff URL: http://source.winehq.org/git/wine.git/?a=commit;h=693b40f7dcf2d14a8d4ef18762...
Author: Michael Stefaniuc mstefani@winehq.org Date: Tue Jul 25 20:57:20 2017 +0200
dmloader/tests: Add some EnableCache() tests.
Signed-off-by: Michael Stefaniuc mstefani@winehq.org Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dmloader/tests/loader.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
diff --git a/dlls/dmloader/tests/loader.c b/dlls/dmloader/tests/loader.c index 136b054..74d8e3c 100644 --- a/dlls/dmloader/tests/loader.c +++ b/dlls/dmloader/tests/loader.c @@ -107,6 +107,40 @@ static void test_directory(void) IDirectMusicLoader_Release(loader); }
+static void test_caching(void) +{ + IDirectMusicLoader8 *loader = NULL; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, &IID_IDirectMusicLoader8, + (void**)&loader); + ok(hr == S_OK, "Couldn't create Loader %#x\n", hr); + + /* Invalid GUID */ + if (0) /* Crashes on Windows */ + IDirectMusicLoader_EnableCache(loader, NULL, TRUE); + hr = IDirectMusicLoader_EnableCache(loader, &IID_IDirectMusicLoader8, TRUE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + + /* Caching is enabled by default */ + hr = IDirectMusicLoader_EnableCache(loader, &CLSID_DirectMusicContainer, TRUE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &GUID_DirectMusicAllTypes, TRUE); + todo_wine ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + + /* Disabling/enabling the cache for all types */ + hr = IDirectMusicLoader_EnableCache(loader, &GUID_DirectMusicAllTypes, FALSE); + ok(hr == S_OK, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &CLSID_DirectMusicContainer, FALSE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &GUID_DirectMusicAllTypes, TRUE); + ok(hr == S_OK, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &CLSID_DirectMusicContainer, TRUE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + + IDirectMusicLoader_Release(loader); +} + static void test_release_object(void) { HRESULT hr; @@ -362,6 +396,7 @@ START_TEST(loader) return; } test_directory(); + test_caching(); test_release_object(); test_simple_playing(); test_COM();