Robert Shearman : oleaut: Test some error conditions in ITypeInfo::
GetIDsOfNames and ITypeInfo::Invoke.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Feb 16 14:05:54 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 6ad326a607c130a5c4d69167c29826c5e44da23f
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=6ad326a607c130a5c4d69167c29826c5e44da23f
Author: Robert Shearman <rob at codeweavers.com>
Date: Thu Feb 16 19:33:08 2006 +0100
oleaut: Test some error conditions in ITypeInfo::GetIDsOfNames and ITypeInfo::Invoke.
---
dlls/oleaut32/tests/typelib.c | 41 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index b5e4fad..72021dd 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -31,6 +31,8 @@
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08lx\n", hr)
+static const WCHAR wszStdOle2[] = {'s','t','d','o','l','e','2','.','t','l','b',0};
+
static void ref_count_test(LPCWSTR type_lib)
{
ITypeLib *iface;
@@ -69,7 +71,6 @@ static void test_TypeComp(void)
DESCKIND desckind;
BINDPTR bindptr;
ITypeInfo *pTypeInfo;
- static const WCHAR wszStdOle2[] = {'s','t','d','o','l','e','2','.','t','l','b',0};
static WCHAR wszStdFunctions[] = {'S','t','d','F','u','n','c','t','i','o','n','s',0};
static WCHAR wszSavePicture[] = {'S','a','v','e','P','i','c','t','u','r','e',0};
static WCHAR wszOLE_TRISTATE[] = {'O','L','E','_','T','R','I','S','T','A','T','E',0};
@@ -362,10 +363,44 @@ static void test_CreateDispTypeInfo(void
SysFreeString(methdata[3].szName);
}
+static void test_TypeInfo(void)
+{
+ ITypeLib *pTypeLib;
+ ITypeInfo *pTypeInfo;
+ HRESULT hr;
+ static WCHAR szBogus[] = { 'b','o','g','u','s',0 };
+ OLECHAR* bogus = szBogus;
+ DISPID dispidMember;
+ DISPPARAMS dispparams;
+
+ hr = LoadTypeLib(wszStdOle2, &pTypeLib);
+ ok_ole_success(hr, LoadTypeLib);
+
+ hr = ITypeLib_GetTypeInfo(pTypeLib, 1, &pTypeInfo);
+ ok_ole_success(hr, ITypeLib_GetTypeInfo);
+ ITypeLib_Release(pTypeLib);
+
+ /* test nonexistent method name */
+ hr = ITypeInfo_GetIDsOfNames(pTypeInfo, &bogus, 1, &dispidMember);
+ ok(hr == DISP_E_UNKNOWNNAME,
+ "ITypeInfo_GetIDsOfNames should have returned DISP_E_UNKNOWNNAME instead of 0x%08lx\n",
+ hr);
+
+ /* test invalid memberid */
+ dispparams.cNamedArgs = 0;
+ dispparams.cArgs = 0;
+ dispparams.rgdispidNamedArgs = NULL;
+ dispparams.rgvarg = NULL;
+ hr = ITypeInfo_Invoke(pTypeInfo, NULL, 0xdeadbeef, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
+ ok(hr == DISP_E_MEMBERNOTFOUND, "ITypeInfo_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr);
+
+ ITypeInfo_Release(pTypeInfo);
+}
+
START_TEST(typelib)
{
- static const WCHAR type_lib_stdole32[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0};
- ref_count_test(type_lib_stdole32);
+ ref_count_test(wszStdOle2);
test_TypeComp();
test_CreateDispTypeInfo();
+ test_TypeInfo();
}
More information about the wine-cvs
mailing list