Module: wine Branch: master Commit: 49e1a1a5dc441b6ab6eead2bcf6782c29907d4e1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=49e1a1a5dc441b6ab6eead2bcf...
Author: Detlef Riekenberg wine.dev@web.de Date: Mon Jan 16 00:06:16 2012 +0100
shell32/tests: Simple tests for IApplicationAssociationRegistration.
---
dlls/shell32/tests/assoc.c | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/dlls/shell32/tests/assoc.c b/dlls/shell32/tests/assoc.c index 8d09ec2..488f8e9 100644 --- a/dlls/shell32/tests/assoc.c +++ b/dlls/shell32/tests/assoc.c @@ -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(); }