fix build error - elm_controlbar.c
[framework/uifw/elementary.git] / TC / elm_ts / conformant / utc_UIFW_elm_conformant_content_unset_func.c
1 #include <tet_api.h>\r
2 #include <Elementary.h>\r
3 \r
4 // Definitions\r
5 // For checking the result of the positive test case.\r
6 #define TET_CHECK_PASS(x1, y...) \\r
7 { \\r
8         Evas_Object *err = y; \\r
9         if (err == (x1)) \\r
10                 { \\r
11                         tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
12                         tet_result(TET_FAIL); \\r
13                         return; \\r
14                 } \\r
15 }\r
16 \r
17 // For checking the result of the negative test case.\r
18 #define TET_CHECK_FAIL(x1, y...) \\r
19 { \\r
20         Evas_Object *err = y; \\r
21         if (err != (x1)) \\r
22                 { \\r
23                         tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
24                         tet_result(TET_FAIL); \\r
25                         return; \\r
26                 } \\r
27 }\r
28 \r
29 \r
30 Evas_Object *main_win;\r
31 \r
32 static void startup(void);\r
33 static void cleanup(void);\r
34 \r
35 void (*tet_startup)(void) = startup;\r
36 void (*tet_cleanup)(void) = cleanup;\r
37 \r
38 static void utc_UIFW_elm_conformant_content_unset_func_01(void);\r
39 static void utc_UIFW_elm_conformant_content_unset_func_02(void);\r
40 \r
41 enum {\r
42         POSITIVE_TC_conf = 0x01,\r
43         NEGATIVE_TC_conf,\r
44 };\r
45 \r
46 struct tet_testlist tet_testlist[] = {\r
47         { utc_UIFW_elm_conformant_content_unset_func_01, POSITIVE_TC_conf },\r
48         { utc_UIFW_elm_conformant_content_unset_func_02, NEGATIVE_TC_conf },\r
49         { NULL, 0}\r
50 };\r
51 \r
52 static void startup(void)\r
53 {\r
54         tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");\r
55         elm_init(0, NULL);\r
56         main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);\r
57         evas_object_show(main_win);     \r
58 }\r
59 \r
60 static void cleanup(void)\r
61 {\r
62         if ( NULL != main_win ) {\r
63                 evas_object_del(main_win);\r
64                 main_win = NULL;\r
65         }\r
66         elm_shutdown();\r
67         tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");\r
68 }\r
69 \r
70 /**\r
71  * @brief Positive test case of elm_conformant_content_unset()\r
72  */\r
73 static void utc_UIFW_elm_conformant_content_unset_func_01(void)\r
74 {\r
75         Evas_Object *conf = NULL, *conform= NULL;
76         Evas_Object* entry = NULL;\r
77         conf = elm_conformant_add(main_win);\r
78         evas_object_show(conf);
79         entry = elm_scrolled_entry_add(NULL);
80         evas_object_show(entry);
81         elm_conformant_content_set(conf,entry);
82         elm_conformant_content_unset(conf);
83         conform = elm_object_parent_widget_get(entry);\r
84         if (conform) {
85                 tet_infoline("elm_conformant_content_unset() failed in positive test case");\r
86                 tet_result(TET_FAIL);\r
87                 return;\r
88         }\r
89         tet_result(TET_PASS);\r
90 }\r
91 \r
92 /**\r
93  * @brief Negative test case of elm_conformant_content_unset()\r
94  */\r
95 static void utc_UIFW_elm_conformant_content_unset_func_02(void)\r
96 {\r
97         Evas_Object *conf = NULL, *conform= NULL;
98         Evas_Object* entry = NULL;\r
99         conf = elm_conformant_add(main_win);\r
100         evas_object_show(conf);
101         entry = elm_scrolled_entry_add(main_win);
102         evas_object_show(entry);
103         elm_conformant_content_set(conf,entry);
104         elm_conformant_content_unset(NULL);
105         conform = elm_object_parent_widget_get(entry);\r
106         if (!conform) {\r
107                 tet_infoline("elm_conformant_content_unset() failed in negative test case");
108                 tet_result(TET_FAIL);\r
109                 return;\r
110         }\r
111         tet_result(TET_PASS);\r
112 }\r