exactness: Fixed test

Signed-off-by: Aharon Hillel <a.hillel@partner.samsung.com>

SVN revision: 66390
devs/tasn/jenkins
Aharon Hillel 11 years ago committed by Tom Hacohen
parent f50af6f41b
commit 1be85311bc
  1. 79
      src/bin/test_gengrid.c

@ -22,8 +22,8 @@ static const char *img[9] =
"wood_01.jpg",
};
static Elm_Gengrid_Item_Class gic, ggic;
static Elm_Gengrid_Item_Class gic;
static int photo_idx = 0;
static void
_horizontal_grid(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
@ -309,7 +309,7 @@ _before_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
sel = elm_gengrid_selected_item_get(grid);
if (!sel)
return;
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[rand() % 9]);
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[(photo_idx++) % 9]);
ti = malloc(sizeof(*ti));
ti->mode = 0;
ti->path = eina_stringshare_add(buf);
@ -328,7 +328,7 @@ _after_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN
sel = elm_gengrid_selected_item_get(grid);
if (!sel)
return;
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[rand() % 9]);
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[(photo_idx++) % 9]);
ti = malloc(sizeof(*ti));
ti->mode = 0;
ti->path = eina_stringshare_add(buf);
@ -356,7 +356,7 @@ _prepend_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __
Evas_Object *grid = data;
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[rand() % 9]);
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[(photo_idx++) % 9]);
ti = malloc(sizeof(*ti));
ti->mode = 0;
ti->path = eina_stringshare_add(buf);
@ -370,7 +370,7 @@ _append_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
Evas_Object *grid = data;
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[rand() % 9]);
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[(photo_idx++) % 9]);
ti = malloc(sizeof(*ti));
ti->mode = 0;
ti->path = eina_stringshare_add(buf);
@ -470,70 +470,3 @@ TEST_START(test_gengrid2)
evas_object_show(win);
}
TEST_END
TEST_START(test_gengrid3)
{
Evas_Object *bg, *grid;
static Testitem ti[144];
int i, n;
char buf[PATH_MAX];
bg = elm_bg_add(win);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
grid = elm_gengrid_add(win);
elm_gengrid_item_size_set(grid, 150, 150);
elm_gengrid_group_item_size_set(grid, 31, 31);
//elm_gengrid_horizontal_set(grid, EINA_TRUE);
elm_gengrid_horizontal_set(grid, EINA_FALSE);
elm_gengrid_multi_select_set(grid, EINA_TRUE);
elm_gengrid_reorder_mode_set(grid, EINA_TRUE);
evas_object_smart_callback_add(grid, "selected", grid_selected, NULL);
evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL);
evas_object_smart_callback_add(grid, "longpressed", grid_longpress, NULL);
evas_object_smart_callback_add(grid, "moved", grid_moved, NULL);
evas_object_smart_callback_add(grid, "drag,start,up", grid_drag_up, NULL);
evas_object_smart_callback_add(grid, "drag,start,right", grid_drag_right, NULL);
evas_object_smart_callback_add(grid, "drag,start,down", grid_drag_down, NULL);
evas_object_smart_callback_add(grid, "drag,start,left", grid_drag_left, NULL);
evas_object_smart_callback_add(grid, "drag,stop", grid_drag_stop, NULL);
evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
gic.item_style = "default";
gic.func.text_get = grid_text_get;
gic.func.content_get = grid_content_get;
gic.func.state_get = grid_state_get;
gic.func.del = grid_del;
ggic.item_style = "group_index";
ggic.func.text_get = grid_text_get;
ggic.func.content_get = NULL;
ggic.func.state_get = NULL;
ggic.func.del = NULL;
n = 0;
for (i = 0; i < 12 * 12; i++)
{
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[n]);
n = (n + 1) % 9;
ti[i].mode = i;
ti[i].path = eina_stringshare_add(buf);
if (i == 0 || i == 18 || i == 53 || i == 100)
//if (i == 0 || i == 18)
ti[i].item = elm_gengrid_item_append(grid, &ggic, &(ti[i]), grid_sel, NULL);
else
ti[i].item = elm_gengrid_item_append(grid, &gic, &(ti[i]), grid_sel, NULL);
if (!(i % 5))
elm_gengrid_item_selected_set(ti[i].item, EINA_TRUE);
}
evas_object_show(grid);
elm_win_resize_object_add(win, grid);
evas_object_resize(win, 600, 600);
evas_object_show(win);
}
TEST_END

Loading…
Cancel
Save