Michael Stefaniuc : jscript/tests: Use wide-char string literals.

Alexandre Julliard julliard at winehq.org
Tue Dec 8 15:38:13 CST 2020


Module: wine
Branch: master
Commit: 887d16c98c20f0f25f6217fd7adbb13da9499ac2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=887d16c98c20f0f25f6217fd7adbb13da9499ac2

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Sun Dec  6 16:02:19 2020 +0100

jscript/tests: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/jscript/tests/jscript.c |  5 +----
 dlls/jscript/tests/run.c     | 29 +++++++++++++----------------
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c
index c1b83d47799..e96127fbc5e 100644
--- a/dlls/jscript/tests/jscript.c
+++ b/dlls/jscript/tests/jscript.c
@@ -828,9 +828,6 @@ static void test_jscript_uninitializing(void)
     ULONG ref;
     HRESULT hres;
 
-    static const WCHAR script_textW[] =
-        {'f','u','n','c','t','i','o','n',' ','f','(',')',' ','{','}',0};
-
     script = create_jscript();
 
     hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
@@ -850,7 +847,7 @@ static void test_jscript_uninitializing(void)
 
     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);
 
     hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c
index 7cd0755497c..1deb460f715 100644
--- a/dlls/jscript/tests/run.c
+++ b/dlls/jscript/tests/run.c
@@ -2484,9 +2484,6 @@ static void test_isvisible(BOOL global_members)
     IActiveScript *engine;
     HRESULT hres;
 
-    static const WCHAR script_textW[] =
-        {'v','a','r',' ','v',' ','=',' ','t','e','s','t','V','a','l',';',0};
-
     engine = create_script();
     if(!engine)
         return;
@@ -2519,12 +2516,12 @@ static void test_isvisible(BOOL global_members)
 
     if(!global_members)
         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);
     if(!global_members)
         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);
 
     IActiveScript_Release(engine);
@@ -3035,17 +3032,17 @@ static void run_bom_tests(void)
     int i;
     HRESULT hres;
     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},
-        {{0xFEFF,'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, 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},
-        {{'v','a','r',0xFEFF,' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK},
-        {{'v','a','r',' ','a',' ','=',' ','1',';',' ',0xFEFF,'r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, 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},
-        {{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s',0xFEFF,'(',')',';','\0'}, S_OK},
-        {{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',0xFEFF,')',';','\0'}, 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},
-        {{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},
-        {{0}}
+        {L"var a = 1; reportSuccess();", S_OK},
+        {L"\xfeffvar a = 1; reportSuccess();", S_OK},
+        {L"v\xfeff" "ar a = 1; reportSuccess();", JS_E_OUT_OF_MEMORY},
+        {L"var\xfeff a = 1; reportSuccess();", S_OK},
+        {L"var a = 1; \xfeffreportSuccess();", S_OK},
+        {L"var a = 1; report\xfeffSuccess();", JS_E_OUT_OF_MEMORY},
+        {L"var a = 1; reportSuccess\xfeff();", S_OK},
+        {L"var a = 1; reportSuccess(\xfeff);", S_OK},
+        {L"var a =\xfeff 1; reportSuccess(\xfeff);", S_OK},
+        {L"\xfeffvar a =\xfeff\xfeff 1; reportSuccess(\xfeff);", S_OK},
+        {L""}
     };
 
     engine_clsid = &CLSID_JScript;




More information about the wine-cvs mailing list