[JSCRIPT_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409

svn path=/trunk/; revision=73355
This commit is contained in:
Amine Khaldi 2016-11-23 10:09:03 +00:00
parent a7a057e3a2
commit f5a2b4ee5d
2 changed files with 39 additions and 1 deletions

View file

@ -629,6 +629,12 @@ tmp = "abcd".indexOf();
ok(tmp == -1, "indexOf = " + tmp); ok(tmp == -1, "indexOf = " + tmp);
tmp = "abcd".indexOf("b", bigInt); tmp = "abcd".indexOf("b", bigInt);
ok(tmp == -1, "indexOf = " + tmp); 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); tmp = "abcd".lastIndexOf("bc",1);
ok(tmp === 1, "lastIndexOf = " + tmp); ok(tmp === 1, "lastIndexOf = " + tmp);
@ -650,6 +656,12 @@ tmp = strObj.lastIndexOf("b");
ok(tmp === 1, "lastIndexOf = " + tmp); ok(tmp === 1, "lastIndexOf = " + tmp);
tmp = "bbb".lastIndexOf("b", bigInt); tmp = "bbb".lastIndexOf("b", bigInt);
ok(tmp === 2, "lastIndexOf = " + tmp); 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(); tmp = "".toLowerCase();
ok(tmp === "", "''.toLowerCase() = " + tmp); ok(tmp === "", "''.toLowerCase() = " + tmp);
@ -661,6 +673,8 @@ tmp = "tEsT".toLowerCase();
ok(tmp === "test", "''.toLowerCase() = " + tmp); ok(tmp === "test", "''.toLowerCase() = " + tmp);
tmp = "tEsT".toLowerCase(3); tmp = "tEsT".toLowerCase(3);
ok(tmp === "test", "''.toLowerCase(3) = " + tmp); ok(tmp === "test", "''.toLowerCase(3) = " + tmp);
tmp = ("tE" + String.fromCharCode(0) + "sT").toLowerCase();
ok(tmp === "te" + String.fromCharCode(0) + "st", "''.toLowerCase() = " + tmp);
tmp = "".toUpperCase(); tmp = "".toUpperCase();
ok(tmp === "", "''.toUpperCase() = " + tmp); ok(tmp === "", "''.toUpperCase() = " + tmp);
@ -672,6 +686,8 @@ tmp = "tEsT".toUpperCase();
ok(tmp === "TEST", "''.toUpperCase() = " + tmp); ok(tmp === "TEST", "''.toUpperCase() = " + tmp);
tmp = "tEsT".toUpperCase(3); tmp = "tEsT".toUpperCase(3);
ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp); ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp);
tmp = ("tE" + String.fromCharCode(0) + "sT").toUpperCase();
ok(tmp === "TE" + String.fromCharCode(0) + "ST", "''.toUpperCase() = " + tmp);
tmp = "".anchor(); tmp = "".anchor();
ok(tmp === "<A NAME=\"undefined\"></A>", "''.anchor() = " + tmp); ok(tmp === "<A NAME=\"undefined\"></A>", "''.anchor() = " + tmp);
@ -917,6 +933,11 @@ ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp);
tmp = arr.toString("test"); tmp = arr.toString("test");
ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp); 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 = new Object();
arr.length = 3; arr.length = 3;
arr[0] = "aa"; 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"), 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")); "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(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI));
ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI); ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI);
Math.PI = "test"; Math.PI = "test";

View file

@ -668,7 +668,7 @@ static void test_aggregation(void)
hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IUnknown, (void**)&unk); &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); "CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres);
ok(!unk || broken(unk != NULL), "unk = %p\n", unk); ok(!unk || broken(unk != NULL), "unk = %p\n", unk);
} }