mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
sync jscript_winetest with wine 1.1.15
svn path=/trunk/; revision=39590
This commit is contained in:
parent
a95d7474d9
commit
1d451b9296
3 changed files with 44 additions and 13 deletions
|
@ -519,6 +519,9 @@ ok(tmp === 1, "Math.round(true) = " + tmp);
|
|||
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);
|
||||
|
||||
|
@ -585,6 +588,14 @@ ok(tmp === 2, "Math.pow(2, 2) = " + tmp);
|
|||
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;
|
||||
if(a) return;
|
||||
|
|
|
@ -295,14 +295,19 @@ static void test_jscript(void)
|
|||
|
||||
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 @@ static void test_jscript(void)
|
|||
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 @@ static void test_jscript2(void)
|
|||
|
||||
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 @@ static void test_jscript2(void)
|
|||
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 @@ static void test_jscript2(void)
|
|||
test_state(script, SCRIPTSTATE_CLOSED);
|
||||
test_script_dispatch(script, FALSE);
|
||||
|
||||
IActiveScriptParse_Release(parse);
|
||||
IUnknown_Release(parse);
|
||||
IActiveScript_Release(script);
|
||||
|
||||
ref = IUnknown_Release(unk);
|
||||
|
|
|
@ -574,8 +574,13 @@ static void parse_script(BSTR script_str)
|
|||
|
||||
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
|
||||
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
|
||||
if (FAILED(hres))
|
||||
{
|
||||
IActiveScript_Release(engine);
|
||||
return;
|
||||
}
|
||||
|
||||
hres = IActiveScriptParse_InitNew(parser);
|
||||
hres = IActiveScriptParse64_InitNew(parser);
|
||||
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
|
||||
|
||||
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
|
||||
|
@ -588,11 +593,11 @@ static void parse_script(BSTR script_str)
|
|||
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 @@ static void test_isvisible(BOOL global_members)
|
|||
|
||||
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
|
||||
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
|
||||
if (FAILED(hres))
|
||||
{
|
||||
IActiveScript_Release(engine);
|
||||
return;
|
||||
}
|
||||
|
||||
hres = IActiveScriptParse_InitNew(parser);
|
||||
hres = IActiveScriptParse64_InitNew(parser);
|
||||
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
|
||||
|
||||
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
|
||||
|
@ -717,16 +727,16 @@ 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 = 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)
|
||||
|
|
Loading…
Reference in a new issue