jscript/tests: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-12-06 16:02:19 +01:00 committed by Alexandre Julliard
parent 22471237bf
commit 887d16c98c
2 changed files with 14 additions and 20 deletions

View File

@ -828,9 +828,6 @@ static void test_jscript_uninitializing(void)
ULONG ref; ULONG ref;
HRESULT hres; HRESULT hres;
static const WCHAR script_textW[] =
{'f','u','n','c','t','i','o','n',' ','f','(',')',' ','{','}',0};
script = create_jscript(); script = create_jscript();
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
@ -850,7 +847,7 @@ static void test_jscript_uninitializing(void)
test_state(script, SCRIPTSTATE_INITIALIZED); test_state(script, SCRIPTSTATE_INITIALIZED);
hres = IActiveScriptParse_ParseScriptText(parse, script_textW, NULL, NULL, NULL, 0, 1, 0x42, NULL, NULL); hres = IActiveScriptParse_ParseScriptText(parse, L"function f() {}", NULL, NULL, NULL, 0, 1, 0x42, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);

View File

@ -2484,9 +2484,6 @@ static void test_isvisible(BOOL global_members)
IActiveScript *engine; IActiveScript *engine;
HRESULT hres; HRESULT hres;
static const WCHAR script_textW[] =
{'v','a','r',' ','v',' ','=',' ','t','e','s','t','V','a','l',';',0};
engine = create_script(); engine = create_script();
if(!engine) if(!engine)
return; return;
@ -2519,12 +2516,12 @@ static void test_isvisible(BOOL global_members)
if(!global_members) if(!global_members)
SET_EXPECT(GetItemInfo_testVal); SET_EXPECT(GetItemInfo_testVal);
hres = IActiveScriptParse_ParseScriptText(parser, script_textW, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); hres = IActiveScriptParse_ParseScriptText(parser, L"var v = testVal;", NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
if(!global_members) if(!global_members)
CHECK_CALLED(GetItemInfo_testVal); CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScriptParse_ParseScriptText(parser, script_textW, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); hres = IActiveScriptParse_ParseScriptText(parser, L"var v = testVal;", NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
IActiveScript_Release(engine); IActiveScript_Release(engine);
@ -3035,17 +3032,17 @@ static void run_bom_tests(void)
int i; int i;
HRESULT hres; HRESULT hres;
struct bom_test bom_tests[] = { struct bom_test bom_tests[] = {
{{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK}, {L"var a = 1; reportSuccess();", S_OK},
{{0xFEFF,'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK}, {L"\xfeffvar a = 1; reportSuccess();", S_OK},
{{'v',0xFEFF,'a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, JS_E_OUT_OF_MEMORY}, {L"v\xfeff" "ar a = 1; reportSuccess();", JS_E_OUT_OF_MEMORY},
{{'v','a','r',0xFEFF,' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK}, {L"var\xfeff a = 1; reportSuccess();", S_OK},
{{'v','a','r',' ','a',' ','=',' ','1',';',' ',0xFEFF,'r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK}, {L"var a = 1; \xfeffreportSuccess();", S_OK},
{{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t',0xFEFF,'S','u','c','c','e','s','s','(',')',';','\0'}, JS_E_OUT_OF_MEMORY}, {L"var a = 1; report\xfeffSuccess();", JS_E_OUT_OF_MEMORY},
{{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s',0xFEFF,'(',')',';','\0'}, S_OK}, {L"var a = 1; reportSuccess\xfeff();", S_OK},
{{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',0xFEFF,')',';','\0'}, S_OK}, {L"var a = 1; reportSuccess(\xfeff);", S_OK},
{{'v','a','r',' ','a',' ','=',0xFEFF,' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',0xFEFF,')',';','\0'}, S_OK}, {L"var a =\xfeff 1; reportSuccess(\xfeff);", S_OK},
{{0xFEFF,'v','a','r',' ','a',' ','=',0xFEFF,0xFEFF,' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',0xFEFF,')',';','\0'}, S_OK}, {L"\xfeffvar a =\xfeff\xfeff 1; reportSuccess(\xfeff);", S_OK},
{{0}} {L""}
}; };
engine_clsid = &CLSID_JScript; engine_clsid = &CLSID_JScript;