From f5a2b4ee5d6b2d7ed1a42c8310abfa1b0b8fb6bb Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 23 Nov 2016 10:09:03 +0000 Subject: [PATCH] [JSCRIPT_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 svn path=/trunk/; revision=73355 --- rostests/winetests/jscript/api.js | 38 ++++++++++++++++++++++++++++ rostests/winetests/jscript/jscript.c | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/rostests/winetests/jscript/api.js b/rostests/winetests/jscript/api.js index 1ca974d8b9c..5a78b3a15a1 100644 --- a/rostests/winetests/jscript/api.js +++ b/rostests/winetests/jscript/api.js @@ -629,6 +629,12 @@ tmp = "abcd".indexOf(); ok(tmp == -1, "indexOf = " + tmp); tmp = "abcd".indexOf("b", bigInt); ok(tmp == -1, "indexOf = " + tmp); +tmp = "abcd".indexOf("abcd",0); +ok(tmp === 0, "indexOf = " + tmp); +tmp = "abcd".indexOf("abcd",1); +ok(tmp === -1, "indexOf = " + tmp); +tmp = ("ab" + String.fromCharCode(0) + "cd").indexOf(String.fromCharCode(0)); +ok(tmp === 2, "indexOf = " + tmp); tmp = "abcd".lastIndexOf("bc",1); ok(tmp === 1, "lastIndexOf = " + tmp); @@ -650,6 +656,12 @@ tmp = strObj.lastIndexOf("b"); ok(tmp === 1, "lastIndexOf = " + tmp); tmp = "bbb".lastIndexOf("b", bigInt); ok(tmp === 2, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("abcd",4); +ok(tmp === 0, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("abcd",0); +ok(tmp === 0, "lastIndexOf = " + tmp); +tmp = ("ab" + String.fromCharCode(0) + "cd").lastIndexOf(String.fromCharCode(0)); +ok(tmp === 2, "lastIndexOf = " + tmp); tmp = "".toLowerCase(); ok(tmp === "", "''.toLowerCase() = " + tmp); @@ -661,6 +673,8 @@ tmp = "tEsT".toLowerCase(); ok(tmp === "test", "''.toLowerCase() = " + tmp); tmp = "tEsT".toLowerCase(3); ok(tmp === "test", "''.toLowerCase(3) = " + tmp); +tmp = ("tE" + String.fromCharCode(0) + "sT").toLowerCase(); +ok(tmp === "te" + String.fromCharCode(0) + "st", "''.toLowerCase() = " + tmp); tmp = "".toUpperCase(); ok(tmp === "", "''.toUpperCase() = " + tmp); @@ -672,6 +686,8 @@ tmp = "tEsT".toUpperCase(); ok(tmp === "TEST", "''.toUpperCase() = " + tmp); tmp = "tEsT".toUpperCase(3); ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp); +tmp = ("tE" + String.fromCharCode(0) + "sT").toUpperCase(); +ok(tmp === "TE" + String.fromCharCode(0) + "ST", "''.toUpperCase() = " + tmp); tmp = "".anchor(); ok(tmp === "", "''.anchor() = " + tmp); @@ -917,6 +933,11 @@ ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp); tmp = arr.toString("test"); ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp); +arr = ["a", "b"]; + +tmp = arr.join(String.fromCharCode(0)); +ok(tmp === "a" + String.fromCharCode(0) + "b", "arr.join(String.fromCharCode(0)) = " + tmp); + arr = new Object(); arr.length = 3; arr[0] = "aa"; @@ -2130,6 +2151,23 @@ ok(Date.parse("Tue, 22 Mar 2016 09:57:55 -0300") === Date.parse("Tue, 22 Mar 201 ok(Date.parse("Tue, 22 Mar 2016 09:57:55 +0400") === Date.parse("Tue, 22 Mar 2016 09:57:55 UTC+0400"), "Date.parse(\"Tue, 22 Mar 2016 09:57:55 +0400\") = " + Date.parse("Tue, 22 Mar 2016 09:57:55 +0400")); +tmp = (new Date()).toGMTString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toLocaleDateString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date(1600, 1, 1, 0, 0, 0, 0)).toLocaleDateString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date(1600, 1, 1, 0, 0, 0, 0)).toLocaleString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toLocaleTimeString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toTimeString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toUTCString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); + ok(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI)); ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI); Math.PI = "test"; diff --git a/rostests/winetests/jscript/jscript.c b/rostests/winetests/jscript/jscript.c index 5dfae9fcf00..5f16dc461e4 100644 --- a/rostests/winetests/jscript/jscript.c +++ b/rostests/winetests/jscript/jscript.c @@ -668,7 +668,7 @@ static void test_aggregation(void) hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void**)&unk); - ok(hres == CLASS_E_NOAGGREGATION || broken(E_INVALIDARG) /* win2k */, + ok(hres == CLASS_E_NOAGGREGATION, "CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres); ok(!unk || broken(unk != NULL), "unk = %p\n", unk); } -- 2.17.1