Commit 49e1a1a5 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

shell32/tests: Simple tests for IApplicationAssociationRegistration.

parent 2d4d571f
......@@ -23,6 +23,7 @@
#include "shlwapi.h"
#include "shlguid.h"
#include "shobjidl.h"
#include "wine/test.h"
......@@ -61,11 +62,47 @@ static void test_IQueryAssociations_QueryInterface(void)
}
static void test_IApplicationAssociationRegistration_QueryInterface(void)
{
IApplicationAssociationRegistration *appreg;
IApplicationAssociationRegistration *appreg2;
IUnknown *unk;
HRESULT hr;
/* this works since Vista */
hr = CoCreateInstance(&CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC_SERVER,
&IID_IApplicationAssociationRegistration, (LPVOID*)&appreg);
if (FAILED(hr)) {
skip("IApplicationAssociationRegistration not created: 0x%x\n", hr);
return;
}
hr = IUnknown_QueryInterface(appreg, &IID_IApplicationAssociationRegistration, (void**)&appreg2);
ok(hr == S_OK, "QueryInterface (IApplicationAssociationRegistration) returned 0x%x\n", hr);
if (SUCCEEDED(hr)) {
IUnknown_Release(appreg2);
}
hr = IUnknown_QueryInterface(appreg, &IID_IUnknown, (void**)&unk);
ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%x\n", hr);
if (SUCCEEDED(hr)) {
IUnknown_Release(unk);
}
hr = IUnknown_QueryInterface(appreg, &IID_IUnknown, NULL);
ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
IApplicationAssociationRegistration_Release(appreg);
}
START_TEST(assoc)
{
CoInitialize(NULL);
test_IQueryAssociations_QueryInterface();
test_IApplicationAssociationRegistration_QueryInterface();
CoUninitialize();
}
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