summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-01 12:26:02 -0400
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2019-07-03 12:22:17 -0400
commitb5e65ed99324f9d13f954f79cfb35179a688b55c (patch)
treee845a7b3cb04be58584c7b7edd358857824402b6
parentf619ad88a402f5cc3ad77931ff715fd08bc6b65e (diff)
tests/radio: add explicit test for verifying legacy radio callback triggering
the 'changed' callback should never be triggered when programmatically changing a radio's state ref T8042
-rw-r--r--src/tests/elementary/elm_test_radio.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_radio.c b/src/tests/elementary/elm_test_radio.c
index c196850015..677fdb0b1e 100644
--- a/src/tests/elementary/elm_test_radio.c
+++ b/src/tests/elementary/elm_test_radio.c
@@ -97,9 +97,46 @@ EFL_START_TEST(elm_test_radio_selection)
97} 97}
98EFL_END_TEST 98EFL_END_TEST
99 99
100EFL_START_TEST(elm_test_radio_callback)
101{
102 radio_change_count = 0;
103 Evas_Object *rd, *rdg;
104 Evas_Object *win = win_add(NULL, "radio", ELM_WIN_BASIC);
105 evas_object_resize(win, 100, 100);
106
107 // radio 1
108 rd = elm_radio_add(win);
109 evas_object_resize(rd, 100, 100);
110
111 // rdg radio group
112 rdg = rd;
113 evas_object_smart_callback_add(rdg, "changed", _rdg_changed_cb, NULL);
114
115 elm_radio_state_value_set(rd, 1);
116 elm_object_text_set(rd, "Radio Group Test #1");
117 evas_object_show(rd);
118
119
120 // radio 2
121 rd = elm_radio_add(win);
122 evas_object_resize(rd, 100, 100);
123 elm_radio_state_value_set(rd, 2);
124 elm_object_text_set(rd, "Radio Group Test #2");
125 elm_radio_group_add(rd, rdg);
126 evas_object_show(rd);
127 evas_object_show(win);
128
129 elm_radio_value_set(rdg, 2);
130 elm_radio_value_set(rdg, 1);
131 elm_radio_value_set(rdg, 2);
132 ck_assert_int_eq(radio_change_count, 0);
133}
134EFL_END_TEST
135
100void elm_test_radio(TCase *tc) 136void elm_test_radio(TCase *tc)
101{ 137{
102 tcase_add_test(tc, elm_radio_legacy_type_check); 138 tcase_add_test(tc, elm_radio_legacy_type_check);
103 tcase_add_test(tc, elm_atspi_role_get); 139 tcase_add_test(tc, elm_atspi_role_get);
104 tcase_add_test(tc, elm_test_radio_selection); 140 tcase_add_test(tc, elm_test_radio_selection);
141 tcase_add_test(tc, elm_test_radio_callback);
105} 142}