2 #include <Elementary.h>
3 //#include "winset_test.h"
4 //#include "winset_until.h"
5 #include "uts_elm_imageslider_add_test.h"
8 // For checking the result of the positive test case.
9 #define TET_CHECK_PASS(x1, y...) \
11 Evas_Object *err = y; \
14 tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
15 tet_result(TET_FAIL); \
20 // For checking the result of the negative test case.
21 #define TET_CHECK_FAIL(x1, y...) \
23 Evas_Object *err = y; \
26 tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
27 tet_result(TET_FAIL); \
32 // Declare the global variables
33 Evas_Object *main_win, *main_bg;
34 Evas_Object *test_win, *test_bg;
35 Evas_Object *test_eo = NULL;
36 // Declare internal functions
37 void _elm_precondition(void);
38 static void _win_del(void *data, Evas_Object *obj, void *event_info);
42 static void _win_del(void *data, Evas_Object *obj, void *event_info)
48 void _elm_precondition(void)
52 main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
53 elm_win_title_set(main_win, "Elementary Unit Test Suite");
54 evas_object_smart_callback_add(main_win, "delete,request", _win_del, NULL);
55 main_bg = elm_bg_add(main_win);
56 evas_object_size_hint_weight_set(main_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
57 elm_win_resize_object_add(main_win, main_bg);
58 evas_object_show(main_bg);
60 // set an initial window size
61 evas_object_resize(main_win, 320, 480);
63 evas_object_show(main_win);
69 // Start up function for each test purpose
73 tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
79 test_win = elm_win_add(NULL, "Image Silder", ELM_WIN_BASIC);
80 elm_win_title_set(test_win, "Image Slider");
81 elm_win_autodel_set(test_win, 1);
83 test_bg = elm_bg_add(test_win);
84 elm_win_resize_object_add(test_win, test_bg);
85 evas_object_size_hint_weight_set(test_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
86 evas_object_show(test_bg);
88 evas_object_resize(test_win, 480, 800);
89 evas_object_show(test_win);
91 tet_infoline("[[ TET_MSG ]]:: Completing startup");
94 // Clean up function for each test purpose
98 // Clean up the used resources.
99 if ( NULL != main_win ) {
103 if ( NULL != main_bg ) {
107 if ( NULL != test_win ) {
111 if ( NULL != test_bg ) {
115 if ( NULL != test_eo ) {
121 tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");
125 // Positive test case.
126 void uts_elm_imageslider_add_test_001()
128 test_eo = elm_imageslider_add(test_win);
129 TET_CHECK_PASS(NULL, test_win);
131 tet_result(TET_PASS);
132 tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, An Image Slider is added successfully.");
137 // Negative test case.
138 void uts_elm_imageslider_add_test_002()
140 test_eo = elm_imageslider_add(NULL);
141 TET_CHECK_FAIL(NULL, test_eo);
143 tet_result(TET_PASS);
144 tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Image Slider has failed.");