apply FSL license
[pkgs/u/ui-gadget.git] / TC / unit / utc_ApplicationFW_ug_get_window_func.c
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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
19
20
21 #include <tet_api.h>
22 #include <ui-gadget.h>
23 #include <Elementary.h>
24 #include <Ecore_X.h>
25
26 static void startup(void);
27 static void cleanup(void);
28
29 void (*tet_startup)(void) = startup;
30 void (*tet_cleanup)(void) = cleanup;
31
32 static void utc_ApplicationFW_ug_get_window_func_01(void);
33
34 enum {
35         POSITIVE_TC_IDX = 0x01,
36 };
37
38 struct tet_testlist tet_testlist[] = {
39         { utc_ApplicationFW_ug_get_window_func_01, POSITIVE_TC_IDX },
40         { NULL, 0},
41 };
42
43 static void startup(void)
44 {
45         char *err;
46         Evas_Object *win;
47
48         elm_init(0, NULL);
49         win = elm_win_add(NULL, "UI gadget test", ELM_WIN_BASIC);
50         if (!win) {
51                 err = "Cannot create window";
52                 goto startup_err;
53         }
54
55         if (UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE)) {
56                 err = "ug_init() failed";
57                 goto startup_err;
58         }
59
60         return;
61
62 startup_err:
63         tet_infoline(err);
64         tet_delete(POSITIVE_TC_IDX, err);
65 }
66
67
68 static void cleanup(void)
69 {
70         elm_shutdown();
71 }
72
73 /**
74  * @brief Positive test case of ug_get_window()
75  */
76 static void utc_ApplicationFW_ug_get_window_func_01(void)
77 {
78         Evas_Object *win;
79         win = ug_get_window();
80         if (!win) {
81                 tet_infoline("ug_get_window() failed in positive test case");
82                 tet_result(TET_FAIL);
83                 return;
84         }
85         tet_result(TET_PASS);
86 }