summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-03 14:56:24 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-18 18:18:56 +0200
commit99174b10f604bdfaed13ff7585a15b60f88b1c55 (patch)
tree66b74e67574aa9cafe0b121777cddb483fb81d3d /src/tests
parent7767ce884abc59f36ac07068abb9e8e5b58c10fe (diff)
tests/check: add unit test for elm_toggle (check) callback
verify that the "changed" callback is triggered as expected Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9832
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/elm_test_check.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_check.c b/src/tests/elementary/elm_test_check.c
index d95e301143..3f801e5aed 100644
--- a/src/tests/elementary/elm_test_check.c
+++ b/src/tests/elementary/elm_test_check.c
@@ -49,6 +49,37 @@ EFL_START_TEST(elm_test_check_onoff_text)
49} 49}
50EFL_END_TEST 50EFL_END_TEST
51 51
52EFL_START_TEST(elm_test_check_callbacks)
53{
54 Evas_Object *win, *check;
55 int called = 0;
56
57 win = win_add(NULL, "check", ELM_WIN_BASIC);
58 evas_object_resize(win, 500, 500);
59
60 check = elm_check_add(win);
61 elm_object_style_set(check, "toggle");
62 elm_object_text_set(check, "TEST TEST TEST");
63 evas_object_smart_callback_add(check, "changed", event_callback_single_call_int_data, &called);
64
65 evas_object_resize(check, 200, 100);
66 evas_object_show(win);
67 evas_object_show(check);
68 get_me_to_those_events(check);
69
70 click_object_at(check, 150, 50);
71 ecore_main_loop_iterate();
72 ck_assert_int_eq(elm_check_state_get(check), 1);
73 ck_assert_int_eq(called, 1);
74
75 called = 0;
76 click_object_at(check, 150, 50);
77 ecore_main_loop_iterate();
78 ck_assert_int_eq(elm_check_state_get(check), 0);
79 ck_assert_int_eq(called, 1);
80}
81EFL_END_TEST
82
52EFL_START_TEST(elm_test_check_state) 83EFL_START_TEST(elm_test_check_state)
53{ 84{
54 Evas_Object *win, *check; 85 Evas_Object *win, *check;
@@ -88,5 +119,6 @@ void elm_test_check(TCase *tc)
88 tcase_add_test(tc, elm_test_check_legacy_type_check); 119 tcase_add_test(tc, elm_test_check_legacy_type_check);
89 tcase_add_test(tc, elm_test_check_onoff_text); 120 tcase_add_test(tc, elm_test_check_onoff_text);
90 tcase_add_test(tc, elm_test_check_state); 121 tcase_add_test(tc, elm_test_check_state);
122 tcase_add_test(tc, elm_test_check_callbacks);
91 tcase_add_test(tc, elm_atspi_role_get); 123 tcase_add_test(tc, elm_atspi_role_get);
92} 124}