diff options
Diffstat (limited to 'tests/unit-core/test-abort.c')
-rw-r--r-- | tests/unit-core/test-abort.c | 76 |
1 files changed, 33 insertions, 43 deletions
diff --git a/tests/unit-core/test-abort.c b/tests/unit-core/test-abort.c index 6105feec..6d50b213 100644 --- a/tests/unit-core/test-abort.c +++ b/tests/unit-core/test-abort.c @@ -13,15 +13,13 @@ * limitations under the License. */ -#include "config.h" #include "jerryscript.h" +#include "config.h" #include "test-common.h" static jerry_value_t -callback_func (const jerry_call_info_t *call_info_p, - const jerry_value_t args_p[], - const jerry_length_t args_count) +callback_func (const jerry_call_info_t *call_info_p, const jerry_value_t args_p[], const jerry_length_t args_count) { JERRY_UNUSED (call_info_p); JERRY_UNUSED (args_p); @@ -50,21 +48,17 @@ main (void) jerry_release_value (callback_name); jerry_release_value (global); - const jerry_char_t inf_loop_code_src1[] = TEST_STRING_LITERAL ( - "while(true) {\n" - " with ({}) {\n" - " try {\n" - " callback();\n" - " } catch (e) {\n" - " } finally {\n" - " }\n" - " }\n" - "}" - ); - - jerry_value_t parsed_code_val = jerry_parse (inf_loop_code_src1, - sizeof (inf_loop_code_src1) - 1, - NULL); + const jerry_char_t inf_loop_code_src1[] = TEST_STRING_LITERAL ("while(true) {\n" + " with ({}) {\n" + " try {\n" + " callback();\n" + " } catch (e) {\n" + " } finally {\n" + " }\n" + " }\n" + "}"); + + jerry_value_t parsed_code_val = jerry_parse (inf_loop_code_src1, sizeof (inf_loop_code_src1) - 1, NULL); TEST_ASSERT (!jerry_value_is_error (parsed_code_val)); res = jerry_run (parsed_code_val); @@ -74,30 +68,26 @@ main (void) jerry_release_value (res); jerry_release_value (parsed_code_val); - const jerry_char_t inf_loop_code_src2[] = TEST_STRING_LITERAL ( - "function f() {" - " while(true) {\n" - " with ({}) {\n" - " try {\n" - " callback();\n" - " } catch (e) {\n" - " } finally {\n" - " }\n" - " }\n" - " }" - "}\n" - "function g() {\n" - " for (a in { x:5 })\n" - " f();\n" - "}\n" - "\n" - "with({})\n" - " f();\n" - ); - - parsed_code_val = jerry_parse (inf_loop_code_src2, - sizeof (inf_loop_code_src2) - 1, - NULL); + const jerry_char_t inf_loop_code_src2[] = TEST_STRING_LITERAL ("function f() {" + " while(true) {\n" + " with ({}) {\n" + " try {\n" + " callback();\n" + " } catch (e) {\n" + " } finally {\n" + " }\n" + " }\n" + " }" + "}\n" + "function g() {\n" + " for (a in { x:5 })\n" + " f();\n" + "}\n" + "\n" + "with({})\n" + " f();\n"); + + parsed_code_val = jerry_parse (inf_loop_code_src2, sizeof (inf_loop_code_src2) - 1, NULL); TEST_ASSERT (!jerry_value_is_error (parsed_code_val)); res = jerry_run (parsed_code_val); |