Commit 57a1a147 authored by Alexandre Julliard's avatar Alexandre Julliard

jscript/tests: Don't crash if we fail to get the IActiveScriptParse interface.

parent b11507eb
......@@ -295,6 +295,11 @@ 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);
......@@ -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);
......
......@@ -574,6 +574,11 @@ 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);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
......@@ -696,6 +701,11 @@ 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);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment