2 #include <Elementary.h>
4 #define ICON_DIR "usr/share/elementary/images"
7 // For checking the result of the positive test case.
8 #define TET_CHECK_PASS(x1, y...) \
10 Evas_Object *err = y; \
13 tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
14 tet_result(TET_FAIL); \
19 // For checking the result of the negative test case.
20 #define TET_CHECK_FAIL(x1, y...) \
22 Evas_Object *err = y; \
25 tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
26 tet_result(TET_FAIL); \
32 Evas_Object *main_win, *popup;
35 static void startup(void);
36 static void cleanup(void);
38 void (*tet_startup)(void) = startup;
39 void (*tet_cleanup)(void) = cleanup;
41 static void utc_UIFW_elm_popup_title_icon_set_func_01(void);
42 static void utc_UIFW_elm_popup_title_icon_set_func_02(void);
45 POSITIVE_TC_IDX = 0x01,
49 struct tet_testlist tet_testlist[] = {
50 { utc_UIFW_elm_popup_title_icon_set_func_01, POSITIVE_TC_IDX },
51 { utc_UIFW_elm_popup_title_icon_set_func_02, NEGATIVE_TC_IDX },
55 static void startup(void)
57 tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
59 main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
60 evas_object_show(main_win);
61 popup = elm_popup_add(main_win);
62 evas_object_show(popup);
65 static void cleanup(void)
67 if ( NULL != main_win ) {
68 evas_object_del(main_win);
71 if ( NULL != popup ) {
72 evas_object_del(popup);
76 tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");
80 * @brief Positive test case of elm_popup_title_icon_set()
82 static void utc_UIFW_elm_popup_title_icon_set_func_01(void)
85 Evas_Object *icon = elm_icon_add(popup);
86 snprintf(buf, sizeof(buf), "%s/logo_small.png", ICON_DIR);
87 elm_icon_file_set(icon, buf, NULL);
88 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
89 elm_icon_scale_set(icon, 1, 1);
91 elm_popup_title_icon_set(popup,icon);
96 * @brief Negative test case of ug_init elm_popup_title_icon_set()
98 static void utc_UIFW_elm_popup_title_icon_set_func_02(void)
101 Evas_Object *icon = elm_icon_add(popup);
102 snprintf(buf, sizeof(buf), "%s/logo_small.png", ICON_DIR);
103 elm_icon_file_set(icon, buf, NULL);
104 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
105 elm_icon_scale_set(icon, 1, 1);
107 elm_popup_title_icon_set(NULL,icon);
108 tet_result(TET_PASS);