Module: wine Branch: master Commit: d041a46caa18308748557c58dae27b25f94b440c URL: http://source.winehq.org/git/wine.git/?a=commit;h=d041a46caa18308748557c58da...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jan 30 14:38:30 2014 +0100
wmp/tests: Added tests.
---
configure | 1 + configure.ac | 1 + dlls/wmp/tests/Makefile.in | 4 +++ dlls/wmp/tests/oleobj.c | 62 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+)
diff --git a/configure b/configure index 0411c35..6f5652a 100755 --- a/configure +++ b/configure @@ -17173,6 +17173,7 @@ wine_fn_config_dll wmi enable_wmi wine_fn_config_dll wmiutils enable_wmiutils clean wine_fn_config_test dlls/wmiutils/tests wmiutils_test wine_fn_config_dll wmp enable_wmp clean +wine_fn_config_test dlls/wmp/tests wmp_test wine_fn_config_dll wmvcore enable_wmvcore wine_fn_config_dll wnaspi32 enable_wnaspi32 implib wine_fn_config_dll wow32 enable_win16 implib diff --git a/configure.ac b/configure.ac index d3b9a91..9a8393c 100644 --- a/configure.ac +++ b/configure.ac @@ -3216,6 +3216,7 @@ WINE_CONFIG_DLL(wmi) WINE_CONFIG_DLL(wmiutils,,[clean]) WINE_CONFIG_TEST(dlls/wmiutils/tests) WINE_CONFIG_DLL(wmp,,[clean]) +WINE_CONFIG_TEST(dlls/wmp/tests) WINE_CONFIG_DLL(wmvcore) WINE_CONFIG_DLL(wnaspi32,,[implib]) WINE_CONFIG_DLL(wow32,enable_win16,[implib]) diff --git a/dlls/wmp/tests/Makefile.in b/dlls/wmp/tests/Makefile.in new file mode 100644 index 0000000..ac30f90 --- /dev/null +++ b/dlls/wmp/tests/Makefile.in @@ -0,0 +1,4 @@ +TESTDLL = wmp.dll +IMPORTS = ole32 + +C_SRCS = oleobj.c diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c new file mode 100644 index 0000000..45dea43 --- /dev/null +++ b/dlls/wmp/tests/oleobj.c @@ -0,0 +1,62 @@ +/* + * Copyright 2014 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_LEAN_AND_MEAN +#define COBJMACROS +#include <initguid.h> +#include <windows.h> +#include <wmp.h> + +#include "wine/test.h" + +static void test_wmp(void) +{ + IProvideClassInfo2 *class_info; + IOleObject *oleobj; + GUID guid; + LONG ref; + HRESULT hres; + + hres = CoCreateInstance(&CLSID_WindowsMediaPlayer, NULL, CLSCTX_INPROC_SERVER, &IID_IOleObject, (void**)&oleobj); + if(hres == REGDB_E_CLASSNOTREG) { + win_skip("CLSID_WindowsMediaPlayer not registered\n"); + return; + } + ok(hres == S_OK, "Coult not create CLSID_WindowsMediaPlayer instance: %08x\n", hres); + + hres = IOleObject_QueryInterface(oleobj, &IID_IProvideClassInfo2, (void**)&class_info); + ok(hres == S_OK, "Could not get IProvideClassInfo2 iface: %08x\n", hres); + + hres = IProvideClassInfo2_GetGUID(class_info, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &guid); + ok(hres == S_OK, "GetGUID failed: %08x\n", hres); + ok(IsEqualGUID(&guid, &IID__WMPOCXEvents), "guid = %s\n", wine_dbgstr_guid(&guid)); + + IProvideClassInfo2_Release(class_info); + + ref = IOleObject_Release(oleobj); + ok(!ref, "ref = %d\n", ref); +} + +START_TEST(oleobj) +{ + CoInitialize(NULL); + + test_wmp(); + + CoUninitialize(); +}