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); \
30 Evas_Object *main_win;
31 Evas_Object *controlbar;
33 Elm_Controlbar_Item *item1;
34 Elm_Controlbar_Item *item2;
35 Elm_Controlbar_Item *item3;
37 static void startup(void);
38 static void cleanup(void);
40 void (*tet_startup)(void) = startup;
41 void (*tet_cleanup)(void) = cleanup;
43 static void utc_UIFW_elm_controlbar_item_select_func_01(void);
44 static void utc_UIFW_elm_controlbar_item_select_func_02(void);
47 POSITIVE_TC_IDX = 0x01,
51 struct tet_testlist tet_testlist[] = {
52 { utc_UIFW_elm_controlbar_item_select_func_01, POSITIVE_TC_IDX },
53 { utc_UIFW_elm_controlbar_item_select_func_02, NEGATIVE_TC_IDX },
57 static void startup(void)
59 tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
61 main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
62 evas_object_show(main_win);
64 controlbar = elm_controlbar_add(main_win);
65 item1 = elm_controlbar_tab_item_append(controlbar, NULL, "Controlbar", NULL);
66 item2 = elm_controlbar_tool_item_append(controlbar, NULL, "Controlbar", NULL, NULL);
67 button = elm_button_add(controlbar);
68 elm_button_label_set(button, "button");
69 item3 = elm_controlbar_object_item_append(controlbar, button, 3);
72 static void cleanup(void)
74 if ( NULL != main_win ) {
75 evas_object_del(main_win);
79 tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");
81 evas_object_del(controlbar);
82 evas_object_del(button);
86 * @brief Positive test case of elm_controlbar_item_select()
88 static void utc_UIFW_elm_controlbar_item_select_func_01(void)
90 Elm_Controlbar_Item *item;
92 elm_controlbar_item_select(item1);
93 item = elm_controlbar_selected_item_get(controlbar);
96 tet_infoline("elm_controlbar_item_select() failed in positive test case");
100 tet_result(TET_PASS);
104 * @brief Negative test case of ug_init elm_controlbar_item_select()
106 static void utc_UIFW_elm_controlbar_item_select_func_02(void)
108 Elm_Controlbar_Item *item;
110 elm_controlbar_item_select(item2);
111 item = elm_controlbar_selected_item_get(controlbar);
114 tet_infoline("elm_controlbar_item_select() failed in negative test case");
115 tet_result(TET_FAIL);
119 elm_controlbar_item_select(item3);
120 item = elm_controlbar_selected_item_get(controlbar);
123 tet_infoline("elm_controlbar_item_select() failed in negative test case");
124 tet_result(TET_FAIL);
128 tet_result(TET_PASS);