efl_ui_tab_pager: modified test for regression test

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
This commit is contained in:
Bowon Ryu 2018-10-10 18:05:18 +09:00 committed by Jaehyun Cho
parent a6e74bfc8c
commit bc9ffbebb0
1 changed files with 10 additions and 5 deletions

View 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);