2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CONTEXT_TEST_SHARED_H__
18 #define __CONTEXT_TEST_SHARED_H__
24 #include <ContextTypes.h>
25 #include <SharedUtil.h>
27 #define ASSERT_RETURN(condition, ret) \
30 g_print("\n>> " RED("FAIL") ": %s(%d) > %s\n", __FUNCTION__, __LINE__, #condition); \
35 #define ASSERT(condition) ASSERT_RETURN(condition, false)
37 #define ASSERT_CMPINT(left, comp, right) \
39 if (!((left) comp (right))) { \
40 g_print("\n>> " RED("FAIL") ": %s(%d) > %s(%d) %s %s(%d)\n", __FUNCTION__, __LINE__, #left, (left), #comp, #right, (right)); \
46 void start_mainloop();
48 bool is_mainloop_running();
51 int read_int(const std::string& msg);
52 std::string read_str();
53 std::string read_str(const std::string& msg);
55 void run_test_case(const char *tcName, bool (*tcFunc)(void));