2 #include <Elementary.h>
5 // For checking the result of the positive test case.
6 #define TET_CHECK_PASS(x1, y...) \
11 tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
12 tet_result(TET_FAIL); \
17 #define TET_CHECK_STRING_PASS(x, y)\
19 if (x == NULL || y == NULL)\
21 tet_printf("[TET_CHECK_STRING_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__);\
22 tet_printf("[TET_CHECK_STRING_PASS]:: Test string is NULL");\
23 tet_result(TET_FAIL);\
28 tet_printf("[TET_CHECK_STRING_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__);\
29 tet_result(TET_FAIL);\
35 // For checking the result of the negative test case.
36 #define TET_CHECK_FAIL(x1, y...) \
38 const char *err = y; \
41 tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
42 tet_result(TET_FAIL); \
47 #define TET_CHECK_STRING_FAIL(x, y)\
49 if (x == NULL || y == NULL)\
51 if (strcmp(x, y) == 0)\
53 tet_printf("[TET_CHECK_STRING_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
54 tet_result(TET_FAIL);\
59 Evas_Object *main_win;
61 static void startup(void);
62 static void cleanup(void);
64 void (*tet_startup)(void) = startup;
65 void (*tet_cleanup)(void) = cleanup;
67 static void utc_UIFW_elm_multibuttonentry_label_get_func_01(void);
68 static void utc_UIFW_elm_multibuttonentry_label_get_func_02(void);
71 POSITIVE_TC_IDX = 0x01,
75 struct tet_testlist tet_testlist[] = {
76 { utc_UIFW_elm_multibuttonentry_label_get_func_01, POSITIVE_TC_IDX },
77 { utc_UIFW_elm_multibuttonentry_label_get_func_02, NEGATIVE_TC_IDX },
81 // Declare the global variables
82 Evas_Object *main_win, *main_bg;
83 Evas_Object *test_win, *test_bg;
84 Evas_Object *test_eo = NULL;
85 // Declare internal functions
86 void _elm_precondition(void);
87 static void _win_del(void *data, Evas_Object *obj, void *event_info);
91 static void _win_del(void *data, Evas_Object *obj, void *event_info)
97 void _elm_precondition(void)
101 main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
102 elm_win_title_set(main_win, "Elementary Unit Test Suite");
103 evas_object_smart_callback_add(main_win, "delete,request", _win_del, NULL);
104 main_bg = elm_bg_add(main_win);
105 evas_object_size_hint_weight_set(main_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
106 elm_win_resize_object_add(main_win, main_bg);
107 evas_object_show(main_bg);
109 // set an initial window size
110 evas_object_resize(main_win, 320, 480);
112 evas_object_show(main_win);
117 // Start up function for each test purpose
121 tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
127 test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC);
128 elm_win_title_set(test_win, "Multi Button Entry");
129 elm_win_autodel_set(test_win, 1);
131 test_bg = elm_bg_add(test_win);
132 elm_win_resize_object_add(test_win, test_bg);
133 evas_object_size_hint_weight_set(test_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
134 evas_object_show(test_bg);
136 evas_object_resize(test_win, 480, 800);
137 evas_object_show(test_win);
139 tet_infoline("[[ TET_MSG ]]:: Completing startup");
142 // Clean up function for each test purpose
146 tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");
148 // Clean up the used resources.
149 if ( NULL != main_win ) {
150 evas_object_del(main_win);
154 if ( NULL != main_bg ) {
155 evas_object_del(main_bg);
159 if ( NULL != test_win ) {
160 evas_object_del(test_win);
164 if ( NULL != test_bg ) {
165 evas_object_del(test_bg);
169 if ( NULL != test_eo ) {
170 evas_object_del(test_eo);
174 // clean up and shut down
177 tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== ");
181 * @brief Positive test case of elm_multibuttonentry_label_get()
183 static void utc_UIFW_elm_multibuttonentry_label_get_func_01(void)
185 const char *ret_str = NULL;
187 test_eo = elm_multibuttonentry_add(test_win);
188 elm_multibuttonentry_label_set(test_eo, "test");
189 ret_str = elm_multibuttonentry_label_get(test_eo);
190 TET_CHECK_STRING_PASS("test", ret_str);
192 tet_result(TET_PASS);
193 tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_label_get().");
199 * @brief Negative test case of ug_init elm_multibuttonentry_label_get()
201 static void utc_UIFW_elm_multibuttonentry_label_get_func_02(void)
203 const char *ret_str = NULL;
205 test_eo = elm_multibuttonentry_add(test_win);
206 elm_multibuttonentry_label_set(test_eo, "test");
207 elm_multibuttonentry_label_set(test_eo, NULL);
208 ret_str = elm_multibuttonentry_label_get(test_eo);
209 TET_CHECK_STRING_FAIL("test", ret_str);
211 tet_result(TET_PASS);
212 tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_label_get().");