2 #include <Elementary.h>
5 // For checking the result of the positive test case.
6 #define TET_CHECK_PASS(x1, y...) \
8 Elm_Object_Item *err = y; \
9 Elm_Object_Item *val = x1; \
12 tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
13 tet_result(TET_FAIL); \
18 // For checking the result of the negative test case.
19 #define TET_CHECK_FAIL(x1, y...) \
21 Elm_Object_Item *err = y; \
22 Elm_Object_Item *val = x1; \
25 tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
26 tet_result(TET_FAIL); \
32 Evas_Object *main_win;
34 static void startup(void);
35 static void cleanup(void);
37 void (*tet_startup)(void) = startup;
38 void (*tet_cleanup)(void) = cleanup;
40 static void utc_UIFW_elm_multibuttonentry_item_append_func_01(void);
41 static void utc_UIFW_elm_multibuttonentry_item_append_func_02(void);
44 POSITIVE_TC_IDX = 0x01,
48 struct tet_testlist tet_testlist[] = {
49 { utc_UIFW_elm_multibuttonentry_item_append_func_01, POSITIVE_TC_IDX },
50 { utc_UIFW_elm_multibuttonentry_item_append_func_02, NEGATIVE_TC_IDX },
54 // Declare the global variables
55 Evas_Object *main_win, *main_bg;
56 Evas_Object *test_win, *test_bg;
57 Evas_Object *test_eo = NULL;
58 // Declare internal functions
59 void _elm_precondition(void);
60 static void _win_del(void *data, Evas_Object *obj, void *event_info);
64 static void _win_del(void *data, Evas_Object *obj, void *event_info)
70 void _elm_precondition(void)
73 main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
74 elm_win_title_set(main_win, "Elementary Unit Test Suite");
75 evas_object_smart_callback_add(main_win, "delete,request", _win_del, NULL);
76 main_bg = elm_bg_add(main_win);
77 evas_object_size_hint_weight_set(main_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
78 elm_win_resize_object_add(main_win, main_bg);
79 evas_object_show(main_bg);
81 // set an initial window size
82 evas_object_resize(main_win, 320, 480);
84 evas_object_show(main_win);
89 // Start up function for each test purpose
93 tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
99 test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC);
100 elm_win_title_set(test_win, "Multi Button Entry");
101 elm_win_autodel_set(test_win, 1);
103 test_bg = elm_bg_add(test_win);
104 elm_win_resize_object_add(test_win, test_bg);
105 evas_object_size_hint_weight_set(test_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
106 evas_object_show(test_bg);
108 evas_object_resize(test_win, 480, 800);
109 evas_object_show(test_win);
111 tet_infoline("[[ TET_MSG ]]:: Completing startup");
114 // Clean up function for each test purpose
118 tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");
120 // Clean up the used resources.
121 if ( NULL != main_win ) {
122 evas_object_del(main_win);
126 if ( NULL != main_bg ) {
127 evas_object_del(main_bg);
131 if ( NULL != test_win ) {
132 evas_object_del(test_win);
136 if ( NULL != test_bg ) {
137 evas_object_del(test_bg);
141 if ( NULL != test_eo ) {
142 evas_object_del(test_eo);
146 // clean up and shut down
149 tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== ");
153 * @brief Positive test case of elm_multibuttonentry_item_append()
155 static void utc_UIFW_elm_multibuttonentry_item_append_func_01(void)
157 Elm_Object_Item *added_item = NULL, *last_item = NULL;
159 test_eo = elm_multibuttonentry_add(test_win);
160 added_item = elm_multibuttonentry_item_append(test_eo, "item1", NULL);
161 TET_CHECK_PASS(NULL, added_item);
163 last_item = elm_multibuttonentry_last_item_get(test_eo);
164 if (added_item != last_item) {
165 tet_infoline("elm_multibuttonentry_item_append() failed in positive test case");
166 tet_result(TET_FAIL);
169 tet_result(TET_PASS);
170 tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_append().");
174 * @brief Negative test case of ug_init elm_multibuttonentry_item_append()
176 static void utc_UIFW_elm_multibuttonentry_item_append_func_02(void)
179 Elm_Object_Item *added_item = NULL;
181 test_eo = elm_multibuttonentry_add(test_win);
182 added_item = elm_multibuttonentry_item_append(test_eo, NULL, NULL);
183 TET_CHECK_FAIL(NULL, added_item);
185 tet_result(TET_PASS);
186 tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_append().");