summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-03 18:41:29 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-13 15:57:25 +0100
commit6a9a390d1383b2bd2ae121e8b5b4883942c21e62 (patch)
treec4dfc57bfd789e73a7eb8dcdea77f0a7017695ac
parentf62cee28cbb634731d7c39378dd29530d767b505 (diff)
efl_ui_spin_button: test that max can be reached by clicking inc
this is esp. testing if this is possible with step not beeing a multiple of max. Differential Revision: https://phab.enlightenment.org/D11011
-rw-r--r--src/tests/elementary/efl_ui_test_spin_button.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/elementary/efl_ui_test_spin_button.c b/src/tests/elementary/efl_ui_test_spin_button.c
index 0d73e44271..a731bb67ce 100644
--- a/src/tests/elementary/efl_ui_test_spin_button.c
+++ b/src/tests/elementary/efl_ui_test_spin_button.c
@@ -193,6 +193,23 @@ EFL_START_TEST (spin_double_values)
193} 193}
194EFL_END_TEST 194EFL_END_TEST
195 195
196EFL_START_TEST (spin_double_values_hitting_max_with_step)
197{
198 //idea is to check that spin button can hit max with inc, even if value is not multiple is 2.7
199 efl_ui_range_limits_set(spin, 10, 30);
200 efl_ui_range_value_set(spin, 27);
201 efl_ui_range_step_set(spin, 2.7);
202 get_me_to_those_events(spin);
203
204 for (int i = 0; i < 2; ++i)
205 {
206 click_part(spin, "efl.inc_button");
207 get_me_to_those_events(spin);
208 }
209 ck_assert_int_eq(EINA_DBL_EQ(efl_ui_range_value_get(spin), 30), 1);
210}
211EFL_END_TEST
212
196static inline void 213static inline void
197_try_direct_text_input(const char *text, double result) 214_try_direct_text_input(const char *text, double result)
198{ 215{
@@ -253,6 +270,7 @@ void efl_ui_test_spin_button(TCase *tc)
253 tcase_add_test(tc, spin_value_dec_min); 270 tcase_add_test(tc, spin_value_dec_min);
254 tcase_add_test(tc, spin_wraparound); 271 tcase_add_test(tc, spin_wraparound);
255 tcase_add_test(tc, spin_double_values); 272 tcase_add_test(tc, spin_double_values);
273 tcase_add_test(tc, spin_double_values_hitting_max_with_step);
256 tcase_add_test(tc, spin_direct_text_input); 274 tcase_add_test(tc, spin_direct_text_input);
257 tcase_add_test(tc, spin_direct_text_input_comma_value); 275 tcase_add_test(tc, spin_direct_text_input_comma_value);
258} 276}