summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2015-12-25 03:31:14 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2015-12-25 03:31:17 +0900
commitbc39c70543ee4a8af45cda8f8f08fbcb673ef640 (patch)
treef32ac994e75995fb6fa9e175f424653c8460cb1b
parentf7726c72290cd7341132939c5b6f8c0468f60e87 (diff)
genlist: Make more realistic scenario.
With this, we can test with arrow keys and find more bugs.
-rw-r--r--src/bin/test_genlist.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index 9ed37254e..ab09b3cd9 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -4121,20 +4121,23 @@ _gl_del_text_get(void *data, Evas_Object *obj EINA_UNUSED,
4121{ 4121{
4122 char buf[256] = { 0 }; 4122 char buf[256] = { 0 };
4123 int num = (int)(uintptr_t)data; 4123 int num = (int)(uintptr_t)data;
4124 int num_category = num % 4; 4124 int num_category = num % 10;
4125 4125
4126 if (num_category == 0) 4126 if (num_category == 3)
4127 snprintf(buf, sizeof(buf), 4127 snprintf(buf, sizeof(buf),
4128 "Item #%.02i - 1. Item Del", num); 4128 "Item #%.02i - 1. Item Del", num);
4129 else if (num_category == 1) 4129 else if (num_category == 5)
4130 snprintf(buf, sizeof(buf), 4130 snprintf(buf, sizeof(buf),
4131 "Item #%.02i - 2. Genlist Clear and Item Append", num); 4131 "Item #%.02i - 2. Genlist Clear and Item Append", num);
4132 else if (num_category == 2) 4132 else if (num_category == 7)
4133 snprintf(buf, sizeof(buf), 4133 snprintf(buf, sizeof(buf),
4134 "Item #%.02i - 3. Genlist Del", num); 4134 "Item #%.02i - 3. Genlist Del", num);
4135 else if (num_category == 3) 4135 else if (num_category == 9)
4136 snprintf(buf, sizeof(buf), 4136 snprintf(buf, sizeof(buf),
4137 "Item #%.02i - 4. Genlist Clear on double-click", num); 4137 "Item #%.02i - 4. Genlist Clear on double-click", num);
4138 else
4139 snprintf(buf, sizeof(buf),
4140 "Item #%.02i - Normal item", num);
4138 4141
4139 return strdup(buf); 4142 return strdup(buf);
4140} 4143}
@@ -4143,19 +4146,19 @@ static void
4143_gl_del_sel(void *data, Evas_Object *obj, void *event_info) 4146_gl_del_sel(void *data, Evas_Object *obj, void *event_info)
4144{ 4147{
4145 int num = (int)(uintptr_t)data; 4148 int num = (int)(uintptr_t)data;
4146 int num_category = num % 4; 4149 int num_category = num % 10;
4147 Elm_Object_Item *it = event_info; 4150 Elm_Object_Item *it = event_info;
4148 Elm_Genlist_Item_Class *itc = 4151 Elm_Genlist_Item_Class *itc =
4149 (Elm_Genlist_Item_Class *)elm_genlist_item_item_class_get(it); 4152 (Elm_Genlist_Item_Class *)elm_genlist_item_item_class_get(it);
4150 4153
4151 if (num_category == 0) 4154 if (num_category == 3)
4152 elm_object_item_del(it); 4155 elm_object_item_del(it);
4153 else if (num_category == 1) 4156 else if (num_category == 5)
4154 { 4157 {
4155 elm_genlist_clear(obj); 4158 elm_genlist_clear(obj);
4156 _gl_del_item_append(obj, itc); 4159 _gl_del_item_append(obj, itc);
4157 } 4160 }
4158 else if (num_category == 2) 4161 else if (num_category == 7)
4159 { 4162 {
4160 evas_object_del(obj); 4163 evas_object_del(obj);
4161 } 4164 }