1 /* Unit test suite for various shell Association objects
3 * Copyright 2012 Detlef Riekenberg
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/test.h"
31 static void test_IQueryAssociations_QueryInterface(void)
33 IQueryAssociations *qa;
34 IQueryAssociations *qa2;
38 /* this works since XP */
39 hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&qa);
42 win_skip("CoCreateInstance for IQueryAssociations returned 0x%x\n", hr);
46 hr = IQueryAssociations_QueryInterface(qa, &IID_IQueryAssociations, (void**)&qa2);
47 ok(hr == S_OK, "QueryInterface (IQueryAssociations) returned 0x%x\n", hr);
49 IQueryAssociations_Release(qa2);
52 hr = IQueryAssociations_QueryInterface(qa, &IID_IUnknown, (void**)&unk);
53 ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%x\n", hr);
55 IUnknown_Release(unk);
58 hr = IQueryAssociations_QueryInterface(qa, &IID_IUnknown, NULL);
59 ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
61 IQueryAssociations_Release(qa);
65 static void test_IApplicationAssociationRegistration_QueryInterface(void)
67 IApplicationAssociationRegistration *appreg;
68 IApplicationAssociationRegistration *appreg2;
72 /* this works since Vista */
73 hr = CoCreateInstance(&CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC_SERVER,
74 &IID_IApplicationAssociationRegistration, (LPVOID*)&appreg);
77 skip("IApplicationAssociationRegistration not created: 0x%x\n", hr);
81 hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IApplicationAssociationRegistration,
83 ok(hr == S_OK, "QueryInterface (IApplicationAssociationRegistration) returned 0x%x\n", hr);
85 IApplicationAssociationRegistration_Release(appreg2);
88 hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IUnknown, (void**)&unk);
89 ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%x\n", hr);
91 IUnknown_Release(unk);
94 hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IUnknown, NULL);
95 ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
97 IApplicationAssociationRegistration_Release(appreg);
105 test_IQueryAssociations_QueryInterface();
106 test_IApplicationAssociationRegistration_QueryInterface();