66f916b703ece9d3c90ded0363d1f89416889031
[apps/native/boot-animation.git] / test / unit / unit_test / unit_test_main.c
1 /*
2  * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #include "../../../inc/test.h"
19 #if (TEST_MODE == TEST_UNIT)
20
21 #include "../inc/unit.h"
22 #include "unit_test_assert_test/unit_test_assert.h"
23 #include "unit_test_function_test/unit_test_function.h"
24 #include "unit_test_group_test/unit_test_group.h"
25
26 #include <Elementary.h>
27
28 static bool __create(void * data)
29 {
30         unit_test_assert();
31         unit_test_function();
32         unit_test_group();
33
34         return true;
35 }
36
37 static void __app_control(app_control_h app_control_handle, void * data)
38 {
39 }
40
41 static void __resume(void * data)
42 {
43 }
44
45 static void __pause(void * data)
46 {
47 }
48
49 static void __terminate(void * data)
50 {
51         __TU("If there's no log, test is successful.");
52 }
53
54 int main(int argc, char *argv[])
55 {
56         ui_app_lifecycle_callback_s lifecycle_callback = {NULL, };
57
58         lifecycle_callback.create = __create;
59         lifecycle_callback.app_control = __app_control;
60         lifecycle_callback.resume = __resume;
61         lifecycle_callback.pause = __pause;
62         lifecycle_callback.terminate = __terminate;
63
64         int ret = ui_app_main(argc, argv, &lifecycle_callback, NULL);
65         if (ret != APP_ERROR_NONE) {
66                 __T("app_main() is failed. err = %d", ret);
67         }
68
69         return 0;
70 }
71
72 #endif