Commit 141c182e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

combase/tests: Link directly to combase.

parent 0bf71745
TESTDLL = combase.dll
IMPORTS = combase
C_SRCS = \
roapi.c \
......
......@@ -26,38 +26,8 @@
#include "initguid.h"
#include "roapi.h"
#include "wine/test.h"
static HRESULT (WINAPI *pRoActivateInstance)(HSTRING, IInspectable **);
static HRESULT (WINAPI *pRoInitialize)(RO_INIT_TYPE);
static void (WINAPI *pRoUninitialize)(void);
static HRESULT (WINAPI *pRoGetActivationFactory)(HSTRING, REFIID, void **);
static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *);
static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING);
#define SET(x) p##x = (void*)GetProcAddress(hmod, #x)
static BOOL init_functions(void)
{
HMODULE hmod = LoadLibraryA("combase.dll");
if (!hmod)
{
win_skip("Failed to load combase.dll, skipping tests\n");
return FALSE;
}
SET(RoActivateInstance);
SET(RoInitialize);
SET(RoUninitialize);
SET(RoGetActivationFactory);
SET(WindowsCreateString);
SET(WindowsDeleteString);
return TRUE;
}
static void test_ActivationFactories(void)
{
HRESULT hr;
......@@ -65,47 +35,38 @@ static void test_ActivationFactories(void)
IActivationFactory *factory = NULL;
IInspectable *inspect = NULL;
if(!pRoGetActivationFactory || !pRoActivateInstance)
{
win_skip("RoGetActivationFactory not available\n");
return;
}
hr = pWindowsCreateString(L"Windows.Data.Xml.Dom.XmlDocument",
hr = WindowsCreateString(L"Windows.Data.Xml.Dom.XmlDocument",
ARRAY_SIZE(L"Windows.Data.Xml.Dom.XmlDocument") - 1, &str);
ok(hr == S_OK, "got %08x\n", hr);
hr = pWindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str2);
hr = WindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str2);
ok(hr == S_OK, "got %08x\n", hr);
hr = pRoInitialize(RO_INIT_MULTITHREADED);
hr = RoInitialize(RO_INIT_MULTITHREADED);
ok(hr == S_OK, "got %08x\n", hr);
hr = pRoGetActivationFactory(str2, &IID_IActivationFactory, (void **)&factory);
hr = RoGetActivationFactory(str2, &IID_IActivationFactory, (void **)&factory);
ok(hr == REGDB_E_CLASSNOTREG, "got %08x\n", hr);
hr = pRoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
todo_wine ok(hr == S_OK, "got %08x\n", hr);
if(factory)
IActivationFactory_Release(factory);
hr = pRoActivateInstance(str2, &inspect);
hr = RoActivateInstance(str2, &inspect);
ok(hr == REGDB_E_CLASSNOTREG, "got %08x\n", hr);
hr = pRoActivateInstance(str, &inspect);
hr = RoActivateInstance(str, &inspect);
todo_wine ok(hr == S_OK, "got %08x\n", hr);
if(inspect)
IInspectable_Release(inspect);
pWindowsDeleteString(str2);
pWindowsDeleteString(str);
pRoUninitialize();
WindowsDeleteString(str2);
WindowsDeleteString(str);
RoUninitialize();
}
START_TEST(roapi)
{
if (!init_functions())
return;
test_ActivationFactories();
}
......@@ -42,6 +42,8 @@ typedef HRESULT (WINAPI *PFNGETACTIVATIONFACTORY)(HSTRING, IActivationFactory **
extern "C" {
#endif
HRESULT WINAPI RoActivateInstance(HSTRING classid, IInspectable **instance);
HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_factory);
HRESULT WINAPI RoInitialize(RO_INIT_TYPE type);
void WINAPI RoUninitialize(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment