2 #include <Elementary.h>
5 // For checking the result of the positive test case.
6 #define TET_CHECK_PASS(x1, y...) \
8 Evas_Object *err = y; \
11 tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
12 tet_result(TET_FAIL); \
17 // For checking the result of the negative test case.
18 #define TET_CHECK_FAIL(x1, y...) \
20 Evas_Object *err = y; \
23 tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
24 tet_result(TET_FAIL); \
29 static void startup(void);
30 static void cleanup(void);
32 void (*tet_startup)(void) = startup;
33 void (*tet_cleanup)(void) = cleanup;
35 static void utc_UIFW_elm_label_slide_get_func_01(void);
36 static void utc_UIFW_elm_label_slide_get_func_02(void);
39 POSITIVE_TC_IDX = 0x01,
43 struct tet_testlist tet_testlist[] = {
44 { utc_UIFW_elm_label_slide_get_func_01, POSITIVE_TC_IDX },
45 { utc_UIFW_elm_label_slide_get_func_02, NEGATIVE_TC_IDX },
49 // Declare the global variables
50 Evas_Object *main_win, *main_bg;
51 Evas_Object *test_win, *test_bg;
52 Evas_Object *test_eo = NULL;
53 // Declare internal functions
54 void _elm_precondition(void);
55 static void _win_del(void *data, Evas_Object *obj, void *event_info);
59 static void _win_del(void *data, Evas_Object *obj, void *event_info)
65 void _elm_precondition(void)
69 main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
70 elm_win_title_set(main_win, "Elementary Unit Test Suite");
71 evas_object_smart_callback_add(main_win, "delete,request", _win_del, NULL);
72 main_bg = elm_bg_add(main_win);
73 evas_object_size_hint_weight_set(main_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
74 elm_win_resize_object_add(main_win, main_bg);
75 evas_object_show(main_bg);
77 // set an initial window size
78 evas_object_resize(main_win, 320, 480);
80 evas_object_show(main_win);
86 // Start up function for each test purpose
90 tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
96 test_win = elm_win_add(NULL, "Label", ELM_WIN_BASIC);
97 elm_win_title_set(test_win, "Label");
98 elm_win_autodel_set(test_win, 1);
100 test_bg = elm_bg_add(test_win);
101 elm_win_resize_object_add(test_win, test_bg);
102 evas_object_size_hint_weight_set(test_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
103 evas_object_show(test_bg);
105 evas_object_resize(test_win, 480, 800);
106 evas_object_show(test_win);
108 tet_infoline("[[ TET_MSG ]]:: Completing startup");
111 // Clean up function for each test purpose
115 tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");
117 // Clean up the used resources.
118 if ( NULL != main_win ) {
119 evas_object_del(main_win);
123 if ( NULL != main_bg ) {
124 evas_object_del(main_bg);
128 if ( NULL != test_win ) {
129 evas_object_del(test_win);
133 if ( NULL != test_bg ) {
134 evas_object_del(test_bg);
138 if ( NULL != test_eo ) {
139 evas_object_del(test_eo);
143 // clean up and shut down
146 tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== ");
150 * @brief Positive test case of elm_label_slide_get()
152 static void utc_UIFW_elm_label_slide_get_func_01(void)
154 test_eo = elm_label_add(test_win);
155 elm_label_label_set(test_eo, "test string");
156 elm_label_slide_set(test_eo, EINA_TRUE);
157 Eina_Bool r = elm_label_slide_get(test_eo);
158 TET_CHECK_PASS(EINA_FALSE, r);
160 tet_result(TET_PASS);
161 tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, A Label slide get is success.");
165 * @brief Negative test case of ug_init elm_label_slide_get()
167 static void utc_UIFW_elm_label_slide_get_func_02(void)
169 Eina_Bool r = elm_label_slide_get(NULL);
170 TET_CHECK_FAIL(EINA_TRUE, r);
172 tet_result(TET_PASS);
173 tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, A Label slide get is failed.");