efl_ui_tab_pager: modified test for regression test 98/190998/1
authorBowon Ryu <bowon.ryu@samsung.com>
Wed, 10 Oct 2018 09:05:18 +0000 (18:05 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Wed, 10 Oct 2018 09:15:04 +0000 (18:15 +0900)
Summary: Fixed randomly generated tab items to be generated sequentially in test code.

Test Plan: elementary_test -to efl.ui.tab_pager

Reviewers: Jaehyun_Cho, jsuya

Reviewed By: jsuya

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7154

Change-Id: Ic0f72f95f7590e5f5aadc1938ac049230f725d8d
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/bin/elementary/test_ui_tab_pager.c

index 23e71fb..5d3d9d4 100644 (file)
@@ -3,7 +3,6 @@
 #endif
 #include <Elementary.h>
 
-#define TAB_PAGE_NUM 5
 #define TAB_LABEL_COUNT 15
 #define TAB_ICON_COUNT 9
 
@@ -23,6 +22,9 @@ typedef struct _Tab_Change_Data {
    Eo *icon_check;
 } Tab_Change_Data;
 
+static int tab_label_count;
+static int tab_icon_count;
+
 static void _current_cb(void *data, Evas_Object *obj, void *event_info);
 static void _pack_cb(void *data, Evas_Object *obj, void *event_info);
 static void _unpack_cb(void *data, Evas_Object *obj, void *event_info);
@@ -44,14 +46,14 @@ static char *tab_icons[] = {
 
 static char *tab_label_get()
 {
-       int index = rand() % (TAB_LABEL_COUNT - 1);
-       return tab_labels[index];
+       if (tab_label_count == TAB_LABEL_COUNT) tab_label_count = 0;
+       return tab_labels[tab_label_count++];
 }
 
 static char *tab_icon_get()
 {
-       int index = rand() % (TAB_ICON_COUNT - 1);
-       return tab_icons[index];
+       if (tab_icon_count == TAB_ICON_COUNT) tab_icon_count = 0;
+       return tab_icons[tab_icon_count++];
 }
 
 static void
@@ -157,6 +159,9 @@ test_ui_tab_pager(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
    efl_ui_pager_transition_set(tp, tran);
 */
 
+   tab_label_count = 0;
+   tab_icon_count = 0;
+
    for (i = 0 ; i < 3 ; i ++)
    {
       page = tab_page_add(tp);