test: Add a logic to check a size of Check

If I pack a check without any api calls into a box,
then it doesn't have the hint_min size which is defined on check edc.
I guess there are problems on sizing logic currently, so this patch helps people
to test the problem.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10038
This commit is contained in:
Wonki Kim 2019-09-21 04:28:24 +00:00 committed by Marcel Hollerbach
parent 654e783d28
commit fe8715e9f6
2 changed files with 31 additions and 0 deletions

View File

@ -115,6 +115,10 @@ test_check(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
evas_object_show(ck);
evas_object_show(ic);
ck = elm_check_add(win);
elm_box_pack_end(bx, ck);
evas_object_show(ck);
ck = elm_check_add(win);
elm_box_pack_end(bx, ck);
elm_object_text_set(ck, "text is visible when check state is true.");

View File

@ -6,6 +6,32 @@
#include <Elementary.h>
#include "elm_suite.h"
EFL_START_TEST(elm_test_check_size)
{
Evas_Object *win, *check, *box;
int width, height;
win = elm_win_util_standard_add("check", "Check");
box = elm_box_add(win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, box);
evas_object_show(box);
check = elm_check_add(box);
elm_box_pack_end(box, check);
evas_object_show(check);
evas_object_show(win);
get_me_to_those_events(check);
evas_object_size_hint_min_get(check, &width, &height);
ck_assert_int_gt(width, 0);
ck_assert_int_gt(height, 0);
}
EFL_END_TEST
EFL_START_TEST(elm_test_check_legacy_type_check)
{
Evas_Object *win, *check;
@ -122,6 +148,7 @@ EFL_END_TEST
void elm_test_check(TCase *tc)
{
tcase_add_test(tc, elm_test_check_size);
tcase_add_test(tc, elm_test_check_legacy_type_check);
tcase_add_test(tc, elm_test_check_onoff_text);
tcase_add_test(tc, elm_test_check_state);