wmp/tests: Added tests.

This commit is contained in:
Jacek Caban 2014-01-30 14:38:30 +01:00 committed by Alexandre Julliard
parent fe7c32081f
commit d041a46caa
4 changed files with 68 additions and 0 deletions

1
configure vendored
View File

@ -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

View File

@ -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])

View File

@ -0,0 +1,4 @@
TESTDLL = wmp.dll
IMPORTS = ole32
C_SRCS = oleobj.c

62
dlls/wmp/tests/oleobj.c Normal file
View File

@ -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();
}