bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=993c843291b34dbc549ddfdad2c2ed5327a364ba

commit 993c843291b34dbc549ddfdad2c2ed5327a364ba
Author: Marcel Hollerbach <[email protected]>
Date:   Thu Jan 24 09:52:37 2019 +0100

    efl_ui_layout: use the correct object
    
    the obejct used in D7740 have been false.
    Here comes the fix + a few tests.
    
    Reviewed-by: YeongJong Lee <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D7746
---
 src/lib/elementary/efl_ui_layout.c     |  6 ++---
 src/tests/elementary/elm_test_layout.c | 40 ++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index 6101aed411..798d0e8646 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -1777,21 +1777,21 @@ EOLIAN Eina_Size2D
 _efl_ui_layout_efl_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, 
Efl_Ui_Layout_Data *sd EINA_UNUSED, Eina_Size2D restricted)
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, restricted);
-   return efl_layout_calc_size_min(wd->obj, restricted);
+   return efl_layout_calc_size_min(wd->resize_obj, restricted);
 }
 
 EOLIAN Eina_Rect
 _efl_ui_layout_efl_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, 
Efl_Ui_Layout_Data *sd EINA_UNUSED)
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, (Eina_Rect){.rect = {0, 0, 0, 0}});
-   return efl_layout_calc_parts_extends(wd->obj);
+   return efl_layout_calc_parts_extends(wd->resize_obj);
 }
 
 EOLIAN void
 _efl_ui_layout_efl_layout_calc_calc_force(Eo *obj EINA_UNUSED, 
Efl_Ui_Layout_Data *sd EINA_UNUSED)
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-   efl_layout_calc_force(wd->obj);
+   efl_layout_calc_force(wd->resize_obj);
 }
 
 static Eina_Bool
diff --git a/src/tests/elementary/elm_test_layout.c 
b/src/tests/elementary/elm_test_layout.c
index bead485a03..998ec55ef2 100644
--- a/src/tests/elementary/elm_test_layout.c
+++ b/src/tests/elementary/elm_test_layout.c
@@ -2,6 +2,7 @@
 # include "elementary_config.h"
 #endif
 
+#define EFL_LAYOUT_CALC_PROTECTED
 #define EFL_ACCESS_OBJECT_BETA
 #include <Elementary.h>
 #include "elm_suite.h"
@@ -117,10 +118,49 @@ EFL_START_TEST(elm_layout_test_model_connect)
 }
 EFL_END_TEST
 
+EFL_START_TEST(efl_ui_layout_layout_api_size_min)
+{
+   Evas_Object *win;
+   Eina_Size2D res;
+
+   win = win_add(NULL, "layout", ELM_WIN_BASIC);
+   /* this is just a test to not get segfaults in those calls */
+   Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win);
+   res = efl_layout_calc_size_min(layout, EINA_SIZE2D(2, 2));
+   ck_assert_int_eq(res.w, 2);
+   ck_assert_int_eq(res.h, 2);
+}
+EFL_END_TEST
+
+EFL_START_TEST(efl_ui_layout_layout_api_update_hints)
+{
+   Evas_Object *win;
+
+   win = win_add(NULL, "layout", ELM_WIN_BASIC);
+   /* this is just a test to not get segfaults in those calls */
+   Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win);
+   efl_layout_calc_auto_update_hints_set(layout, EINA_TRUE);
+   ck_assert_int_eq(efl_layout_calc_auto_update_hints_get(layout), EINA_TRUE);
+}
+EFL_END_TEST
+
+EFL_START_TEST(efl_ui_layout_layout_force)
+{
+   Evas_Object *win;
+
+   win = win_add(NULL, "layout", ELM_WIN_BASIC);
+   /* this is just a test to not get segfaults in those calls */
+   Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win);
+   efl_layout_calc_force(layout);
+}
+EFL_END_TEST
 void elm_test_layout(TCase *tc)
 {
    tcase_add_test(tc, elm_layout_test_legacy_type_check);
    tcase_add_test(tc, elm_atspi_role_get);
    tcase_add_test(tc, elm_layout_test_swallows);
    tcase_add_test(tc, elm_layout_test_model_connect);
+   tcase_add_test(tc, efl_ui_layout_layout_api_size_min);
+   tcase_add_test(tc, efl_ui_layout_layout_api_update_hints);
+   tcase_add_test(tc, efl_ui_layout_layout_force);
 }

-- 


Reply via email to