From 0af0c86532e68d5c2a548af5e1ea780940e46cdd Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Fri, 18 Jul 2014 15:27:38 +0400 Subject: [PATCH] Unit test: single var_decl, followed by exitval. --- .../test_var_decl_opcode_in_decl_lex_env.c | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/unit/test_var_decl_opcode_in_decl_lex_env.c diff --git a/tests/unit/test_var_decl_opcode_in_decl_lex_env.c b/tests/unit/test_var_decl_opcode_in_decl_lex_env.c new file mode 100644 index 000000000..a1419ac98 --- /dev/null +++ b/tests/unit/test_var_decl_opcode_in_decl_lex_env.c @@ -0,0 +1,39 @@ +/* Copyright 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "globals.h" +#include "interpreter.h" +#include "mem-allocator.h" +#include "opcodes.h" + +/** + * Unit test's main function. + */ +int +main( int __unused argc, + char __unused **argv) +{ + const OPCODE test_program[] = { + getop_var_decl( 0), + getop_exitval( 0) + }; + + mem_Init(); + + init_int( test_program); + + return run_int() ? 0 + : 1; +} /* main */