summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorWooHyun Jung <wh0705.jung@samsung.com>2019-08-26 11:27:18 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-27 15:35:01 +0200
commit5636bb8b0b4e78db883bbf9bbb99e940c27c0584 (patch)
treea93b7fb3160681d325f5f0cce360801158a08163 /src/tests
parentcfc0d4866ccb037e121eef984be244280cc10c6a (diff)
efl_ui_slider: refactor for better data flow and code readability
1. efl_ui_range_value_set only sets value 2. remove internal eo functions (such as xxx_knob, val_fetch, and val_set) 3. make access_value_and_text works correctly @ref T7893 Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9720
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/efl_ui_test_slider.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/tests/elementary/efl_ui_test_slider.c b/src/tests/elementary/efl_ui_test_slider.c
index a891841329..6547ae406e 100644
--- a/src/tests/elementary/efl_ui_test_slider.c
+++ b/src/tests/elementary/efl_ui_test_slider.c
@@ -13,8 +13,12 @@ slider_changed(void *data EINA_UNUSED, const Efl_Event *ev)
13{ 13{
14 event_counter++; 14 event_counter++;
15 if (event_counter == 1) 15 if (event_counter == 1)
16 efl_event_callback_del(ev->object, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL); 16 efl_event_callback_del(ev->object, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, slider_changed, NULL);
17 else if (event_counter == 2) 17 else if (event_counter == 2)
18 efl_event_callback_del(ev->object, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL);
19 else if (event_counter == 3)
20 efl_event_callback_del(ev->object, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, slider_changed, NULL);
21 else if (event_counter == 4)
18 ecore_main_loop_quit(); 22 ecore_main_loop_quit();
19} 23}
20 24
@@ -28,6 +32,8 @@ EFL_START_TEST(efl_ui_test_slider_events)
28 slider = efl_add(EFL_UI_SLIDER_CLASS, win, 32 slider = efl_add(EFL_UI_SLIDER_CLASS, win,
29 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL), 33 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL),
30 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_STEADY, slider_changed, NULL), 34 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_STEADY, slider_changed, NULL),
35 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, slider_changed, NULL),
36 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, slider_changed, NULL),
31 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(400, 100)) 37 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(400, 100))
32 ); 38 );
33 39
@@ -48,7 +54,7 @@ EFL_START_TEST(efl_ui_test_slider_events)
48 evas_event_feed_mouse_move(e, sx + (sw / 2), sy + (sh / 2), 0, NULL); 54 evas_event_feed_mouse_move(e, sx + (sw / 2), sy + (sh / 2), 0, NULL);
49 evas_event_feed_mouse_up(e, 1, 0, 0, NULL); 55 evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
50 ecore_main_loop_begin(); 56 ecore_main_loop_begin();
51 ck_assert_int_eq(event_counter, 2); 57 ck_assert_int_eq(event_counter, 4);
52} 58}
53EFL_END_TEST 59EFL_END_TEST
54 60
@@ -62,6 +68,8 @@ EFL_START_TEST(efl_ui_test_slider_step)
62 slider = efl_add(EFL_UI_SLIDER_CLASS, win, 68 slider = efl_add(EFL_UI_SLIDER_CLASS, win,
63 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL), 69 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL),
64 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_STEADY, slider_changed, NULL), 70 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_STEADY, slider_changed, NULL),
71 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, slider_changed, NULL),
72 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, slider_changed, NULL),
65 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(400, 100)) 73 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(400, 100))
66 ); 74 );
67 efl_ui_range_limits_set(slider, 0, 100); 75 efl_ui_range_limits_set(slider, 0, 100);