Misha Koshelev : msi/tests: automation:
Test invoking methods as properties & vice versa.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon May 14 10:52:46 CDT 2007
Module: wine
Branch: master
Commit: 6bb7c911f50f7f9d5acb6f52cb46072704042cb9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6bb7c911f50f7f9d5acb6f52cb46072704042cb9
Author: Misha Koshelev <mk144210 at bcm.edu>
Date: Fri May 11 14:08:04 2007 -0500
msi/tests: automation: Test invoking methods as properties & vice versa.
---
dlls/msi/tests/automation.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index 5a34459..e0240fd 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -394,6 +394,7 @@ static void test_dispatch(void)
{
static WCHAR szOpenPackage[] = { 'O','p','e','n','P','a','c','k','a','g','e',0 };
static WCHAR szOpenPackageException[] = {'O','p','e','n','P','a','c','k','a','g','e',',','P','a','c','k','a','g','e','P','a','t','h',',','O','p','t','i','o','n','s',0};
+ static WCHAR szProductState[] = { 'P','r','o','d','u','c','t','S','t','a','t','e',0 };
HRESULT hr;
DISPID dispid;
OLECHAR *name;
@@ -444,6 +445,30 @@ static void test_dispatch(void)
ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
ok_exception(hr, szOpenPackageException);
+
+ /* Test invoking a method as a DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT */
+ VariantInit(&vararg[0]);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult, &excepinfo, NULL);
+ todo_wine ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
+
+ VariantInit(&vararg[0]);
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
+ todo_wine ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
+
+ /* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD */
+ name = (WCHAR *)szProductState;
+ hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
+ ok(SUCCEEDED(hr), "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
+
+ dispparams.rgvarg = NULL;
+ dispparams.cArgs = 0;
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT, &dispparams, &varresult, &excepinfo, NULL);
+ todo_wine ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
+
+ dispparams.rgvarg = NULL;
+ dispparams.cArgs = 0;
+ hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
+ todo_wine ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
}
/* invocation helper function */
More information about the wine-cvs
mailing list