vbscript: Fixed locale-related test failures.
This commit is contained in:
parent
93eff3e862
commit
2be12eacaf
|
@ -154,8 +154,8 @@ TestUCase "test", "TEST"
|
||||||
TestUCase "123aBC?", "123ABC?"
|
TestUCase "123aBC?", "123ABC?"
|
||||||
TestUCase "", ""
|
TestUCase "", ""
|
||||||
TestUCase 1, "1"
|
TestUCase 1, "1"
|
||||||
TestUCase true, "TRUE"
|
if isEnglishLang then TestUCase true, "TRUE"
|
||||||
TestUCase 0.123, "0.123"
|
TestUCase 0.123, doubleAsString(0.123)
|
||||||
TestUCase Empty, ""
|
TestUCase Empty, ""
|
||||||
Call ok(getVT(UCase(Null)) = "VT_NULL", "getVT(UCase(Null)) = " & getVT(UCase(Null)))
|
Call ok(getVT(UCase(Null)) = "VT_NULL", "getVT(UCase(Null)) = " & getVT(UCase(Null)))
|
||||||
|
|
||||||
|
@ -168,8 +168,8 @@ TestLCase "test", "test"
|
||||||
TestLCase "123aBC?", "123abc?"
|
TestLCase "123aBC?", "123abc?"
|
||||||
TestLCase "", ""
|
TestLCase "", ""
|
||||||
TestLCase 1, "1"
|
TestLCase 1, "1"
|
||||||
TestLCase true, "true"
|
if isEnglishLang then TestLCase true, "true"
|
||||||
TestLCase 0.123, "0.123"
|
TestLCase 0.123, doubleAsString(0.123)
|
||||||
TestLCase Empty, ""
|
TestLCase Empty, ""
|
||||||
Call ok(getVT(LCase(Null)) = "VT_NULL", "getVT(LCase(Null)) = " & getVT(LCase(Null)))
|
Call ok(getVT(LCase(Null)) = "VT_NULL", "getVT(LCase(Null)) = " & getVT(LCase(Null)))
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ DEFINE_EXPECT(Next);
|
||||||
#define DISPID_GLOBAL_PROPARGPUT 1011
|
#define DISPID_GLOBAL_PROPARGPUT 1011
|
||||||
#define DISPID_GLOBAL_PROPARGPUT1 1012
|
#define DISPID_GLOBAL_PROPARGPUT1 1012
|
||||||
#define DISPID_GLOBAL_COLLOBJ 1013
|
#define DISPID_GLOBAL_COLLOBJ 1013
|
||||||
|
#define DISPID_GLOBAL_DOUBLEASSTRING 1014
|
||||||
|
|
||||||
#define DISPID_TESTOBJ_PROPGET 2000
|
#define DISPID_TESTOBJ_PROPGET 2000
|
||||||
#define DISPID_TESTOBJ_PROPPUT 2001
|
#define DISPID_TESTOBJ_PROPPUT 2001
|
||||||
|
@ -90,7 +91,7 @@ DEFINE_EXPECT(Next);
|
||||||
|
|
||||||
static const WCHAR testW[] = {'t','e','s','t',0};
|
static const WCHAR testW[] = {'t','e','s','t',0};
|
||||||
|
|
||||||
static BOOL strict_dispid_check;
|
static BOOL strict_dispid_check, is_english;
|
||||||
static const char *test_name = "(null)";
|
static const char *test_name = "(null)";
|
||||||
static int test_counter;
|
static int test_counter;
|
||||||
|
|
||||||
|
@ -815,6 +816,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
|
||||||
*pid = DISPID_GLOBAL_COUNTER;
|
*pid = DISPID_GLOBAL_COUNTER;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
if(!strcmp_wa(bstrName, "doubleAsString")) {
|
||||||
|
test_grfdex(grfdex, fdexNameCaseInsensitive);
|
||||||
|
*pid = DISPID_GLOBAL_DOUBLEASSTRING;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
if(strict_dispid_check && strcmp_wa(bstrName, "x"))
|
if(strict_dispid_check && strcmp_wa(bstrName, "x"))
|
||||||
ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
|
ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
|
||||||
|
@ -905,12 +911,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
|
||||||
ok(pei != NULL, "pei == NULL\n");
|
ok(pei != NULL, "pei == NULL\n");
|
||||||
|
|
||||||
V_VT(pvarRes) = VT_BOOL;
|
V_VT(pvarRes) = VT_BOOL;
|
||||||
if(is_lang_english()) {
|
V_BOOL(pvarRes) = is_english ? VARIANT_TRUE : VARIANT_FALSE;
|
||||||
V_BOOL(pvarRes) = VARIANT_TRUE;
|
|
||||||
}else {
|
|
||||||
skip("Skipping some tests in non-English UIs\n");
|
|
||||||
V_BOOL(pvarRes) = VARIANT_FALSE;
|
|
||||||
}
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
case DISPID_GLOBAL_VBVAR:
|
case DISPID_GLOBAL_VBVAR:
|
||||||
|
@ -1069,6 +1070,15 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
|
||||||
V_VT(pvarRes) = VT_I2;
|
V_VT(pvarRes) = VT_I2;
|
||||||
V_I2(pvarRes) = test_counter++;
|
V_I2(pvarRes) = test_counter++;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
|
case DISPID_GLOBAL_DOUBLEASSTRING:
|
||||||
|
ok(wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
|
||||||
|
ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
|
||||||
|
ok(V_VT(pdp->rgvarg) == VT_R8, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
|
||||||
|
ok(pvarRes != NULL, "pvarRes == NULL\n");
|
||||||
|
|
||||||
|
V_VT(pvarRes) = VT_BSTR;
|
||||||
|
return VarBstrFromR8(V_R8(pdp->rgvarg), 0, 0, &V_BSTR(pvarRes));
|
||||||
}
|
}
|
||||||
|
|
||||||
ok(0, "unexpected call %d\n", id);
|
ok(0, "unexpected call %d\n", id);
|
||||||
|
@ -1590,6 +1600,10 @@ START_TEST(run)
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
|
|
||||||
|
is_english = is_lang_english();
|
||||||
|
if(!is_english)
|
||||||
|
skip("Skipping some tests in non-English UIs\n");
|
||||||
|
|
||||||
argc = winetest_get_mainargs(&argv);
|
argc = winetest_get_mainargs(&argv);
|
||||||
|
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
|
|
Loading…
Reference in New Issue