From: Prince Kumar Dubey Date: Wed, 22 Sep 2010 09:36:10 +0000 (+0530) Subject: [SegmentControl] Modified. X-Git-Tag: origin~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a98c5d342633e79dbf78e24bcd97629125b498f;p=framework%2Fuifw%2Felementary.git [SegmentControl] Modified. --- diff --git a/TC/elm_ts/segmentcontrol/Makefile b/TC/elm_ts/segmentcontrol/Makefile index 1bc1c61..189ec19 100644 --- a/TC/elm_ts/segmentcontrol/Makefile +++ b/TC/elm_ts/segmentcontrol/Makefile @@ -13,7 +13,7 @@ TARGETS = utc_UIFW_elm_segment_control_add_func \ utc_UIFW_elm_segment_control_item_object_get_func \ utc_UIFW_elm_segment_control_item_selected_get_func \ utc_UIFW_elm_segment_control_item_selected_set_func \ - utc_UIFW_elm_segment_control_item_label_set_func + utc_UIFW_elm_segment_control_item_label_object_set_func PKGS = elementary diff --git a/TC/elm_ts/segmentcontrol/tc_gen.sh b/TC/elm_ts/segmentcontrol/tc_gen.sh old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/tslist b/TC/elm_ts/segmentcontrol/tslist old mode 100755 new mode 100644 index 3704822..e45c415 --- a/TC/elm_ts/segmentcontrol/tslist +++ b/TC/elm_ts/segmentcontrol/tslist @@ -11,4 +11,5 @@ elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_label_get_func elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_object_get_func elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_selected_get_func elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_selected_set_func +elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_label_object_set_func diff --git a/TC/elm_ts/segmentcontrol/utc_MODULE_API_func.c.in b/TC/elm_ts/segmentcontrol/utc_MODULE_API_func.c.in old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_add_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_add_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_add_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_add_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_count_get_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_count_get_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_del_at_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_del_at_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_del_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_del_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_get_at_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_get_at_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_icon_get_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_icon_get_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_index_get_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_index_get_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_insert_at_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_insert_at_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_label_get_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_label_get_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_label_object_set_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_label_object_set_func.c new file mode 100644 index 0000000..1d038bb --- /dev/null +++ b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_label_object_set_func.c @@ -0,0 +1,111 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *main_win, *segment_control; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_segment_control_item_label_object_set_func_01(void); +static void utc_UIFW_elm_segment_control_item_label_object_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_segment_control_item_label_object_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_segment_control_item_label_object_set_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + segment_control = elm_segment_control_add(main_win); + evas_object_show(segment_control); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != segment_control ) { + evas_object_del(segment_control); + segment_control = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_segment_control_item_label_object_set() + */ +static void utc_UIFW_elm_segment_control_item_label_object_set_func_01(void) +{ + Elm_Segment_Item *item = NULL; + const char *label = NULL; + char *ch = "All"; + item = elm_segment_control_item_add(segment_control, NULL, NULL,EINA_FALSE); + elm_segment_control_item_label_object_set(item, ch); + label = elm_segment_control_item_label_get(segment_control,0); + if (!(strcmp(label,"All"))) { + tet_result(TET_PASS); + return; + } + tet_infoline("elm_segment_control_item_label_set() failed in positive test case"); + tet_result(TET_FAIL); +} + +/** + * @brief Negative test case of ug_init elm_segment_control_item_label_object_set() + */ +static void utc_UIFW_elm_segment_control_item_label_object_set_func_02(void) +{ + Elm_Segment_Item *item = NULL; + const char *label = NULL; + char *ch = "All"; + item = elm_segment_control_item_add(segment_control, NULL, NULL,EINA_FALSE); + elm_segment_control_item_label_object_set(NULL,ch); + label = elm_segment_control_item_label_get(segment_control,0); + if (label) { + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_object_get_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_object_get_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_selected_get_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_selected_get_func.c old mode 100755 new mode 100644 diff --git a/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_selected_set_func.c b/TC/elm_ts/segmentcontrol/utc_UIFW_elm_segment_control_item_selected_set_func.c old mode 100755 new mode 100644