summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tests/elementary/elm_test_actionslider.c10
-rw-r--r--src/tests/elementary/suite_helpers.c9
-rw-r--r--src/tests/elementary/suite_helpers.h1
3 files changed, 11 insertions, 9 deletions
diff --git a/src/tests/elementary/elm_test_actionslider.c b/src/tests/elementary/elm_test_actionslider.c
index 4350791df2..4210ec6c13 100644
--- a/src/tests/elementary/elm_test_actionslider.c
+++ b/src/tests/elementary/elm_test_actionslider.c
@@ -44,14 +44,6 @@ EFL_END_TEST
44static const char *test_val; 44static const char *test_val;
45 45
46static void 46static void
47test_pos_changed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
48{
49 int *called = data;
50
51 (*called)++;
52}
53
54static void
55test_selected_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 47test_selected_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
56{ 48{
57 /* if the test crashes with a crazy stack trace, this assert failed */ 49 /* if the test crashes with a crazy stack trace, this assert failed */
@@ -80,7 +72,7 @@ EFL_START_TEST(elm_actionslider_test_callbacks)
80 elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT | 72 elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT |
81 ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT); 73 ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT);
82 evas_object_smart_callback_add(as, "pos_changed", 74 evas_object_smart_callback_add(as, "pos_changed",
83 test_pos_changed_cb, &called); 75 event_callback_that_is_called_exactly_one_time_and_sets_a_single_int_data_pointer_when_called, &called);
84 evas_object_smart_callback_add(as, "selected", test_selected_cb, &called); 76 evas_object_smart_callback_add(as, "selected", test_selected_cb, &called);
85 77
86 get_me_to_those_events(as); 78 get_me_to_those_events(as);
diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c
index 727db9be98..b9c8d3e71d 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -456,3 +456,12 @@ click_part(Eo *obj, const char *part)
456 edje_object_message_signal_process(obj); 456 edje_object_message_signal_process(obj);
457 efl_unref(part_obj); 457 efl_unref(part_obj);
458} 458}
459
460void
461event_callback_that_is_called_exactly_one_time_and_sets_a_single_int_data_pointer_when_called(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
462{
463 int *called = data;
464
465 ck_assert_int_eq(*called, 0);
466 *called = 1;
467}
diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h
index 9c1bd2a866..f1e01d70db 100644
--- a/src/tests/elementary/suite_helpers.h
+++ b/src/tests/elementary/suite_helpers.h
@@ -13,4 +13,5 @@ void fail_on_errors_setup(void);
13void get_me_to_those_events(Eo *obj); 13void get_me_to_those_events(Eo *obj);
14void click_object(Eo *obj); 14void click_object(Eo *obj);
15void click_part(Eo *obj, const char *part); 15void click_part(Eo *obj, const char *part);
16void event_callback_that_is_called_exactly_one_time_and_sets_a_single_int_data_pointer_when_called(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
16#endif 17#endif