vbscript/tests: Expose todo_wine_ok function to scripts.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2017-10-10 17:08:05 +02:00 committed by Alexandre Julliard
parent 775671c3d8
commit c4d7243833
2 changed files with 15 additions and 7 deletions

View File

@ -190,7 +190,7 @@ sub testThrow
next
call ok(x = 2, "x = " & x)
call ok(y = 1, "y = " & y)
'todo_wine call ok(Err.Number = VB_E_OBJNOTCOLLECTION, "Err.Number = " & Err.Number)
call todo_wine_ok(Err.Number = VB_E_OBJNOTCOLLECTION, "Err.Number = " & Err.Number)
Err.clear()
y = 0
@ -202,19 +202,19 @@ sub testThrow
next
call ok(y = 1, "y = " & y)
call ok(x = 6, "x = " & x)
'todo_wine call ok(Err.Number = VB_E_FORLOOPNOTINITIALIZED, "Err.Number = " & Err.Number)
call todo_wine_ok(Err.Number = VB_E_FORLOOPNOTINITIALIZED, "Err.Number = " & Err.Number)
Err.clear()
y = 0
x = 6
for x = 100 to throwInt(E_TESTERROR)
call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number)
'todo_wine call ok(x = 6, "x = " & x)
call todo_wine_ok(x = 6, "x = " & x)
y = y+1
next
call ok(y = 1, "y = " & y)
'todo_wine call ok(x = 6, "x = " & x)
'todo_wine call ok(Err.Number = VB_E_FORLOOPNOTINITIALIZED, "Err.Number = " & Err.Number)
call todo_wine_ok(x = 6, "x = " & x)
call todo_wine_ok(Err.Number = VB_E_FORLOOPNOTINITIALIZED, "Err.Number = " & Err.Number)
select case throwInt(E_TESTERROR)
case true
@ -308,7 +308,7 @@ sub testForEachError()
y = true
next
call ok(y, "for each not executed")
'todo_wine call ok(Err.Number = VB_E_OBJNOTCOLLECTION, "Err.Number = " & Err.Number)
call todo_wine_ok(Err.Number = VB_E_OBJNOTCOLLECTION, "Err.Number = " & Err.Number)
end sub
call testForEachError()

View File

@ -122,6 +122,7 @@ DEFINE_EXPECT(OnScriptError);
#define DISPID_GLOBAL_TESTOPTIONALARG 1017
#define DISPID_GLOBAL_LETOBJ 1018
#define DISPID_GLOBAL_SETOBJ 1019
#define DISPID_GLOBAL_TODO_WINE_OK 1020
#define DISPID_TESTOBJ_PROPGET 2000
#define DISPID_TESTOBJ_PROPPUT 2001
@ -983,6 +984,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
*pid = DISPID_GLOBAL_OK;
return S_OK;
}
if(!strcmp_wa(bstrName, "todo_wine_ok")) {
test_grfdex(grfdex, fdexNameCaseInsensitive);
*pid = DISPID_GLOBAL_TODO_WINE_OK;
return S_OK;
}
if(!strcmp_wa(bstrName, "trace")) {
test_grfdex(grfdex, fdexNameCaseInsensitive);
*pid = DISPID_GLOBAL_TRACE;
@ -1092,6 +1098,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
switch(id) {
case DISPID_GLOBAL_TODO_WINE_OK:
case DISPID_GLOBAL_OK: {
VARIANT *b;
@ -1115,7 +1122,8 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(V_VT(b) == VT_BOOL, "V_VT(b) = %d\n", V_VT(b));
ok(V_BOOL(b), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
todo_wine_if(id == DISPID_GLOBAL_TODO_WINE_OK)
ok(V_BOOL(b), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
return S_OK;
}