summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_test_progressbar.c
diff options
context:
space:
mode:
authorStephen 'Okra' Houston <smhouston88@gmail.com>2019-01-24 04:02:54 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-02-11 15:41:04 -0800
commit7b195738957282f20927d94425f0cf51399bfcad (patch)
tree123fd5f17ff86a5fa321fdecba47fae50c63f926 /src/tests/elementary/elm_test_progressbar.c
parent56dbd2bf86286dead989b4983886e923ca944d9c (diff)
elm_progressbar test: Add test for custom format strings to show when %% is not escaped correctly.
This adds a test that sets a custom progressbar format string that includes a custom percent (%%) that should be escaped to just one percent (%). This case has been broken and fixed many times and is broken again so it makes sense to now add a check for it to try and prevent the continual breakage. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7745
Diffstat (limited to '')
-rw-r--r--src/tests/elementary/elm_test_progressbar.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_progressbar.c b/src/tests/elementary/elm_test_progressbar.c
index 81eeee9738..2ad2808de6 100644
--- a/src/tests/elementary/elm_test_progressbar.c
+++ b/src/tests/elementary/elm_test_progressbar.c
@@ -26,6 +26,22 @@ EFL_START_TEST(elm_progressbar_legacy_type_check)
26} 26}
27EFL_END_TEST 27EFL_END_TEST
28 28
29EFL_START_TEST(elm_progressbar_custom_unit_check)
30{
31 Evas_Object *win, *progressbar;
32 char format[50];
33
34 snprintf(format, sizeof(format), "%d percent (%d%%)", 50, 50);
35
36 win = win_add(NULL, "progressbar", ELM_WIN_BASIC);
37
38 progressbar = elm_progressbar_add(win);
39 elm_progressbar_unit_format_set(progressbar, format);
40 elm_progressbar_value_set(progressbar, .50);
41 ck_assert(!strcmp(elm_object_part_text_get(progressbar, "elm.text.status"), "50 percent (50%)"));
42}
43EFL_END_TEST
44
29EFL_START_TEST(elm_atspi_role_get) 45EFL_START_TEST(elm_atspi_role_get)
30{ 46{
31 Evas_Object *win, *progressbar; 47 Evas_Object *win, *progressbar;
@@ -44,5 +60,6 @@ EFL_END_TEST
44void elm_test_progressbar(TCase *tc) 60void elm_test_progressbar(TCase *tc)
45{ 61{
46 tcase_add_test(tc, elm_progressbar_legacy_type_check); 62 tcase_add_test(tc, elm_progressbar_legacy_type_check);
63 tcase_add_test(tc, elm_progressbar_custom_unit_check);
47 tcase_add_test(tc, elm_atspi_role_get); 64 tcase_add_test(tc, elm_atspi_role_get);
48} 65}