Author: cwittich
Date: Fri Feb 13 12:05:50 2009
New Revision: 39590
URL:
http://svn.reactos.org/svn/reactos?rev=39590&view=rev
Log:
sync jscript_winetest with wine 1.1.15
Modified:
trunk/rostests/winetests/jscript/api.js
trunk/rostests/winetests/jscript/jscript.c
trunk/rostests/winetests/jscript/run.c
Modified: trunk/rostests/winetests/jscript/api.js
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/api.js?…
==============================================================================
--- trunk/rostests/winetests/jscript/api.js [iso-8859-1] (original)
+++ trunk/rostests/winetests/jscript/api.js [iso-8859-1] Fri Feb 13 12:05:50 2009
@@ -519,6 +519,9 @@
tmp = Math.round(1.1, 3, 4);
ok(tmp === 1, "Math.round(1.1, 3, 4) = " + tmp);
+tmp = Math.round();
+ok(isNaN(tmp), "Math.round() is not NaN");
+
tmp = Math.ceil(0.5);
ok(tmp === 1, "Math.ceil(0.5) = " + tmp);
@@ -584,6 +587,14 @@
tmp = Math.pow(2, 2, 3);
ok(tmp === 4, "Math.pow(2, 2, 3) = " + tmp);
+
+tmp = Math.random();
+ok(typeof(tmp) == "number", "typeof(tmp) = " + typeof(tmp));
+ok(0 <= tmp && tmp <= 1, "Math.random() = " + tmp);
+
+tmp = Math.random(100);
+ok(typeof(tmp) == "number", "typeof(tmp) = " + typeof(tmp));
+ok(0 <= tmp && tmp <= 1, "Math.random(100) = " + tmp);
var func = function (a) {
var a = 1;
Modified: trunk/rostests/winetests/jscript/jscript.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/jscript…
==============================================================================
--- trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] Fri Feb 13 12:05:50 2009
@@ -295,14 +295,19 @@
hres = IUnknown_QueryInterface(unk, &IID_IActiveScriptParse,
(void**)&parse);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
+ if (FAILED(hres))
+ {
+ IActiveScript_Release(script);
+ return;
+ }
test_state(script, SCRIPTSTATE_UNINITIALIZED);
test_safety(unk);
- hres = IActiveScriptParse_InitNew(parse);
+ hres = IActiveScriptParse64_InitNew(parse);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
- hres = IActiveScriptParse_InitNew(parse);
+ hres = IActiveScriptParse64_InitNew(parse);
ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n",
hres);
hres = IActiveScript_SetScriptSite(script, NULL);
@@ -340,7 +345,7 @@
test_state(script, SCRIPTSTATE_CLOSED);
test_script_dispatch(script, FALSE);
- IActiveScriptParse_Release(parse);
+ IUnknown_Release(parse);
IActiveScript_Release(script);
ref = IUnknown_Release(unk);
@@ -366,6 +371,11 @@
hres = IUnknown_QueryInterface(unk, &IID_IActiveScriptParse,
(void**)&parse);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
+ if (FAILED(hres))
+ {
+ IActiveScript_Release(script);
+ return;
+ }
test_state(script, SCRIPTSTATE_UNINITIALIZED);
@@ -377,11 +387,11 @@
test_state(script, SCRIPTSTATE_UNINITIALIZED);
SET_EXPECT(OnStateChange_INITIALIZED);
- hres = IActiveScriptParse_InitNew(parse);
+ hres = IActiveScriptParse64_InitNew(parse);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
CHECK_CALLED(OnStateChange_INITIALIZED);
- hres = IActiveScriptParse_InitNew(parse);
+ hres = IActiveScriptParse64_InitNew(parse);
ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n",
hres);
SET_EXPECT(OnStateChange_CONNECTED);
@@ -403,7 +413,7 @@
test_state(script, SCRIPTSTATE_CLOSED);
test_script_dispatch(script, FALSE);
- IActiveScriptParse_Release(parse);
+ IUnknown_Release(parse);
IActiveScript_Release(script);
ref = IUnknown_Release(unk);
Modified: trunk/rostests/winetests/jscript/run.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/run.c?r…
==============================================================================
--- trunk/rostests/winetests/jscript/run.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/jscript/run.c [iso-8859-1] Fri Feb 13 12:05:50 2009
@@ -574,8 +574,13 @@
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse,
(void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
-
- hres = IActiveScriptParse_InitNew(parser);
+ if (FAILED(hres))
+ {
+ IActiveScript_Release(engine);
+ return;
+ }
+
+ hres = IActiveScriptParse64_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
@@ -588,11 +593,11 @@
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n",
hres);
- hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0,
0, NULL, NULL);
+ hres = IActiveScriptParse64_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0,
0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
IActiveScript_Release(engine);
- IActiveScriptParse_Release(parser);
+ IUnknown_Release(parser);
}
static void parse_script_a(const char *src)
@@ -696,8 +701,13 @@
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse,
(void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
-
- hres = IActiveScriptParse_InitNew(parser);
+ if (FAILED(hres))
+ {
+ IActiveScript_Release(engine);
+ return;
+ }
+
+ hres = IActiveScriptParse64_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
@@ -717,16 +727,16 @@
if(!global_members)
SET_EXPECT(GetItemInfo_testVal);
- hres = IActiveScriptParse_ParseScriptText(parser, script_textW, NULL, NULL, NULL, 0,
0, 0, NULL, NULL);
+ hres = IActiveScriptParse64_ParseScriptText(parser, script_textW, 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 = IActiveScriptParse64_ParseScriptText(parser, script_textW, NULL, NULL, NULL,
0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
IActiveScript_Release(engine);
- IActiveScriptParse_Release(parser);
+ IUnknown_Release(parser);
}
static void run_tests(void)