Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
29ccac79
Commit
29ccac79
authored
Sep 13, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added object member assignment tests.
parent
151056bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
+89
-0
run.c
dlls/vbscript/tests/run.c
+89
-0
No files found.
dlls/vbscript/tests/run.c
View file @
29ccac79
...
...
@@ -60,6 +60,8 @@ DEFINE_EXPECT(global_success_d);
DEFINE_EXPECT
(
global_success_i
);
DEFINE_EXPECT
(
global_vbvar_d
);
DEFINE_EXPECT
(
global_vbvar_i
);
DEFINE_EXPECT
(
testobj_propput_d
);
DEFINE_EXPECT
(
testobj_propput_i
);
#define DISPID_GLOBAL_REPORTSUCCESS 1000
#define DISPID_GLOBAL_TRACE 1001
...
...
@@ -67,6 +69,9 @@ DEFINE_EXPECT(global_vbvar_i);
#define DISPID_GLOBAL_GETVT 1003
#define DISPID_GLOBAL_ISENGLOC 1004
#define DISPID_GLOBAL_VBVAR 1005
#define DISPID_GLOBAL_TESTOBJ 1006
#define DISPID_TESTOBJ_PROPPUT 2001
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -226,6 +231,64 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
testObj_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
{
if
(
!
strcmp_wa
(
bstrName
,
"propput"
))
{
CHECK_EXPECT
(
testobj_propput_d
);
test_grfdex
(
grfdex
,
fdexNameCaseInsensitive
);
*
pid
=
DISPID_TESTOBJ_PROPPUT
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
}
static
HRESULT
WINAPI
testObj_InvokeEx
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
switch
(
id
)
{
case
DISPID_TESTOBJ_PROPPUT
:
CHECK_EXPECT
(
testobj_propput_i
);
ok
(
wFlags
==
DISPATCH_PROPERTYPUT
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
pdp
->
rgvarg
!=
NULL
,
"rgvarg == NULL
\n
"
);
ok
(
pdp
->
rgdispidNamedArgs
!=
NULL
,
"rgdispidNamedArgs == NULL
\n
"
);
ok
(
pdp
->
cArgs
==
1
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
pdp
->
cNamedArgs
==
1
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
ok
(
pdp
->
rgdispidNamedArgs
[
0
]
==
DISPID_PROPERTYPUT
,
"pdp->rgdispidNamedArgs[0] = %d
\n
"
,
pdp
->
rgdispidNamedArgs
[
0
]);
ok
(
!
pvarRes
,
"pvarRes != NULL
\n
"
);
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
ok
(
V_VT
(
pdp
->
rgvarg
)
==
VT_I2
,
"V_VT(psp->rgvargs) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
));
ok
(
V_I2
(
pdp
->
rgvarg
)
==
1
,
"V_I2(psp->rgvargs) = %d
\n
"
,
V_I2
(
pdp
->
rgvarg
));
return
S_OK
;
}
ok
(
0
,
"unexpected call %d
\n
"
,
id
);
return
E_FAIL
;
}
static
IDispatchExVtbl
testObjVtbl
=
{
DispatchEx_QueryInterface
,
DispatchEx_AddRef
,
DispatchEx_Release
,
DispatchEx_GetTypeInfoCount
,
DispatchEx_GetTypeInfo
,
DispatchEx_GetIDsOfNames
,
DispatchEx_Invoke
,
testObj_GetDispID
,
testObj_InvokeEx
,
DispatchEx_DeleteMemberByName
,
DispatchEx_DeleteMemberByDispID
,
DispatchEx_GetMemberProperties
,
DispatchEx_GetMemberName
,
DispatchEx_GetNextDispID
,
DispatchEx_GetNameSpaceParent
};
static
IDispatchEx
testObj
=
{
&
testObjVtbl
};
static
HRESULT
WINAPI
Global_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
{
...
...
@@ -255,6 +318,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
*
pid
=
DISPID_GLOBAL_ISENGLOC
;
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"testObj"
))
{
test_grfdex
(
grfdex
,
fdexNameCaseInsensitive
);
*
pid
=
DISPID_GLOBAL_TESTOBJ
;
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"vbvar"
))
{
CHECK_EXPECT
(
global_vbvar_d
);
test_grfdex
(
grfdex
,
fdexNameCaseInsensitive
);
...
...
@@ -376,6 +444,21 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok
(
V_I2
(
pdp
->
rgvarg
)
==
3
,
"V_I2(psp->rgvargs) = %d
\n
"
,
V_I2
(
pdp
->
rgvarg
));
return
S_OK
;
case
DISPID_GLOBAL_TESTOBJ
:
ok
(
wFlags
==
(
DISPATCH_PROPERTYGET
|
DISPATCH_METHOD
),
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
!
pdp
->
rgvarg
,
"rgvarg == NULL
\n
"
);
ok
(
!
pdp
->
rgdispidNamedArgs
,
"rgdispidNamedArgs != NULL
\n
"
);
ok
(
!
pdp
->
cArgs
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pdp
->
cNamedArgs
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
ok
(
pvarRes
!=
NULL
,
"pvarRes == NULL
\n
"
);
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
V_VT
(
pvarRes
)
=
VT_DISPATCH
;
V_DISPATCH
(
pvarRes
)
=
(
IDispatch
*
)
&
testObj
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %d
\n
"
,
id
);
...
...
@@ -690,6 +773,12 @@ static void run_tests(void)
CHECK_CALLED
(
global_vbvar_d
);
CHECK_CALLED
(
global_vbvar_i
);
SET_EXPECT
(
testobj_propput_d
);
SET_EXPECT
(
testobj_propput_i
);
parse_script_a
(
"testObj.propput = 1"
);
CHECK_CALLED
(
testobj_propput_d
);
CHECK_CALLED
(
testobj_propput_i
);
run_from_res
(
"lang.vbs"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment