summaryrefslogtreecommitdiff
path: root/src/tests/efl/efl_test_model_composite.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-01-03 14:54:18 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-01-30 12:06:11 -0800
commit1dadeac05e14d2ba50b3bb430fe386d7a50a9d56 (patch)
tree4949f513c92dfa8465dbc6dd3daa90fa87389a98 /src/tests/efl/efl_test_model_composite.c
parent95a9cc90d1ce646c541bdb2c08caf9de4ecf0881 (diff)
ecore: add an index property on Efl.Model_Composite and handle children_slice_get.
This will enable inheriting class to not have to implement as much code. This patch fix also all class that use Efl.Model_Composite and its test. Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D7654
Diffstat (limited to '')
-rw-r--r--src/tests/efl/efl_test_model_composite.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tests/efl/efl_test_model_composite.c b/src/tests/efl/efl_test_model_composite.c
index 315c34ac5f..f48127acb4 100644
--- a/src/tests/efl/efl_test_model_composite.c
+++ b/src/tests/efl/efl_test_model_composite.c
@@ -80,17 +80,22 @@ _selection_children_slice_get_then(void *data EINA_UNUSED,
80 { 80 {
81 Eina_Value *p_int = NULL; 81 Eina_Value *p_int = NULL;
82 Eina_Value *p_bool = NULL; 82 Eina_Value *p_bool = NULL;
83 Eina_Value *p_index = NULL;
83 int v_int = 0; 84 int v_int = 0;
85 unsigned int index = 0;
84 Eina_Bool v_bool = EINA_FALSE; 86 Eina_Bool v_bool = EINA_FALSE;
85 87
86 p_bool = efl_model_property_get(child, "selected"); 88 p_bool = efl_model_property_get(child, "selected");
87 p_int = efl_model_property_get(child, "test_p_int"); 89 p_int = efl_model_property_get(child, "test_p_int");
90 p_index = efl_model_property_get(child, "child.index");
88 91
89 eina_value_get(p_bool, &v_bool); 92 eina_value_get(p_bool, &v_bool);
90 eina_value_get(p_int, &v_int); 93 eina_value_get(p_int, &v_int);
94 fail_if(!eina_value_uint_convert(p_index, &index));
91 95
92 fail_if(v_bool != base_selections[i]); 96 fail_if(v_bool != base_selections[i]);
93 fail_if(v_int != base_ints[i]); 97 fail_if(v_int != base_ints[i]);
98 ck_assert_int_eq(i, index);
94 } 99 }
95 100
96 ecore_main_loop_quit(); 101 ecore_main_loop_quit();
@@ -165,7 +170,7 @@ EFL_START_TEST(efl_test_model_composite_selection)
165 model = efl_add_ref(EFL_MODEL_COMPOSITE_SELECTION_CLASS, efl_main_loop_get(), 170 model = efl_add_ref(EFL_MODEL_COMPOSITE_SELECTION_CLASS, efl_main_loop_get(),
166 efl_ui_view_model_set(efl_added, base_model)); 171 efl_ui_view_model_set(efl_added, base_model));
167 ck_assert(!!model); 172 ck_assert(!!model);
168 future = efl_model_property_set(model, "selected", eina_value_int_new(2)); 173 future = efl_model_property_set(model, "child.selected", eina_value_int_new(2));
169 eina_future_then(future, _wait_propagate, NULL, NULL); 174 eina_future_then(future, _wait_propagate, NULL, NULL);
170 ecore_main_loop_begin(); 175 ecore_main_loop_begin();
171 176