Page MenuHomePhabricator

test: Add a logic to check a size of Check
ClosedPublic

Authored by akanad on Thu, Sep 19, 7:08 PM.

Details

Summary

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.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
akanad created this revision.Thu, Sep 19, 7:08 PM
akanad requested review of this revision.Thu, Sep 19, 7:08 PM

you can see a check that has no size if you just pack it without calling any api to it after creating.
Actually this is a story about Efl.Ui.Layout not only check.
because efl_canvas_group_change api are not able to effect any in construction time.

EOLIAN static void                                                   
_elm_layout_efl_canvas_group_change(Eo *obj, Elm_Layout_Data *ld)    
{                                                                    
   Efl_Ui_Layout_Data *sd;                                           
  if (!efl_finalized_get(obj)) return;

and that was the reason why I wrote D9368 which has reverted by raster.
Though, I am not sure whether a kind of the patch makes the similar side effect that raster pointed or not,
if a layout object has instanciated, it should be calculated after construnction time even if there isn't a stimulus on it.
let me know your opinion.
thanks

bu5hm4n requested changes to this revision.Fri, Sep 20, 12:22 AM

Can you make this a unit test ? This will still be unnoticed after a patch if it is not automatically failing.

This revision now requires changes to proceed.Fri, Sep 20, 12:22 AM
akanad updated this revision to Diff 25235.Fri, Sep 20, 1:36 AM

appending a new test for sizing

bu5hm4n added a comment.EditedFri, Sep 20, 1:48 AM

Test looks good, but we still need a fix ... :/

BTW.: best practice, dont use ck_assert(...) rather ck_assert_*_eq(...,...)

akanad updated this revision to Diff 25236.Fri, Sep 20, 1:48 AM
akanad retitled this revision from Add a logic to check a size of Check to test: Add a logic to check a size of Check.

modifying the commit title

akanad updated this revision to Diff 25237.Fri, Sep 20, 1:51 AM

another diff

zmike added a comment.Fri, Sep 20, 4:53 AM

Looking at this now.

zmike requested changes to this revision.Fri, Sep 20, 6:09 AM

This issue is resolved by D10043.

Some changes are needed for the unit test.

src/bin/elementary/test_check.c
129

I don't think having any of these timers is useful in elm_test; it should be enough to have the check visual for inspection. We have unit tests to verify that the correct behavior is observed.

src/tests/elementary/elm_test_check.c
36

This + ecore_main_loop_begin() should be replaced by get_me_to_those_events(check); in order to properly get to the sizing check.

42

This should be:
ck_assert_int_gt(width, 0);
ck_assert_int_gt(height, 0);

This revision now requires changes to proceed.Fri, Sep 20, 6:09 AM
akanad updated this revision to Diff 25300.Fri, Sep 20, 9:28 PM

*removing timer for testing on elementary_test
*improving convension style of the testcase

bu5hm4n accepted this revision.Sun, Sep 22, 11:47 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mon, Sep 23, 1:45 AM
Closed by commit rEFLfe8715e9f608: test: Add a logic to check a size of Check (authored by WhiskyKiloSq, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain Why
This revision was automatically updated to reflect the committed changes.