summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-12-19 14:50:11 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-01-02 13:39:30 -0800
commit6c755f669642edc3ca7cc87e6cb1c24bc9fda51a (patch)
treee5fbe7b525cb52e9c2faf61077b30452760128bf
parent83e3b25d80f84666eec34298f50c552da6490b64 (diff)
ecore: add tests when not defining setter/getter/free in ModelView callback.
Differential Revision: https://phab.enlightenment.org/D7490
-rw-r--r--src/tests/efl/efl_test_model_view.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/efl/efl_test_model_view.c b/src/tests/efl/efl_test_model_view.c
index 607ee48..94d05d5 100644
--- a/src/tests/efl/efl_test_model_view.c
+++ b/src/tests/efl/efl_test_model_view.c
@@ -175,6 +175,8 @@ _efl_test_model_view_child_get(Eo *obj EINA_UNUSED,
175 Eina_Value *p_int = NULL; 175 Eina_Value *p_int = NULL;
176 Eina_Value *p_color = NULL; 176 Eina_Value *p_color = NULL;
177 Eina_Value *p_label = NULL; 177 Eina_Value *p_label = NULL;
178 Eina_Value *p_deadend = NULL;
179 Eina_Error err = 0;
178 int v_int = 0; 180 int v_int = 0;
179 181
180 p_int = efl_model_property_get(child, "test_p_int"); 182 p_int = efl_model_property_get(child, "test_p_int");
@@ -182,6 +184,11 @@ _efl_test_model_view_child_get(Eo *obj EINA_UNUSED,
182 184
183 p_color = efl_model_property_get(child, "color"); 185 p_color = efl_model_property_get(child, "color");
184 p_label = efl_model_property_get(child, "label"); 186 p_label = efl_model_property_get(child, "label");
187 p_deadend = efl_model_property_get(child, "deadend");
188
189 ck_assert_ptr_eq(eina_value_type_get(p_deadend), EINA_VALUE_TYPE_ERROR);
190 eina_value_error_get(p_deadend, &err);
191 ck_assert_int_eq(err, EFL_MODEL_ERROR_NOT_SUPPORTED);
185 192
186 efl_event_callback_add(child, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_changed, &counting); 193 efl_event_callback_add(child, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_changed, &counting);
187 194
@@ -189,8 +196,14 @@ _efl_test_model_view_child_get(Eo *obj EINA_UNUSED,
189 .success = _dummy, .error = _expected_fail); 196 .success = _dummy, .error = _expected_fail);
190 efl_future_then(child, efl_model_property_set(child, "color", p_color), 197 efl_future_then(child, efl_model_property_set(child, "color", p_color),
191 .success = _dummy, .error = _expected_fail); 198 .success = _dummy, .error = _expected_fail);
199 efl_future_then(child, efl_model_property_set(child, "deadend", eina_value_int_new(42)),
200 .success = _dummy, .error = _expected_fail);
192 201
193 all[i] = efl_model_property_set(child, "test_p_int", eina_value_int_new(v_int+100)); 202 all[i] = efl_model_property_set(child, "test_p_int", eina_value_int_new(v_int+100));
203
204 eina_value_free(p_color);
205 eina_value_free(p_label);
206 eina_value_free(p_deadend);
194 } 207 }
195 208
196 all[i] = EINA_FUTURE_SENTINEL; 209 all[i] = EINA_FUTURE_SENTINEL;
@@ -285,6 +298,11 @@ EFL_START_TEST(efl_test_model_view)
285 NULL, _efl_test_model_view_color_set, _efl_test_model_view_color_clean, 298 NULL, _efl_test_model_view_color_set, _efl_test_model_view_color_clean,
286 EINA_C_ARRAY_ITERATOR_NEW(dependences)); 299 EINA_C_ARRAY_ITERATOR_NEW(dependences));
287 300
301 efl_model_view_property_logic_add(mv, "deadend",
302 NULL, NULL, NULL,
303 NULL, NULL, NULL,
304 NULL);
305
288 f = efl_model_children_slice_get(mv, 0, efl_model_children_count_get(mv)); 306 f = efl_model_children_slice_get(mv, 0, efl_model_children_count_get(mv));
289 f = efl_future_then(mv, f, .success_type = EINA_VALUE_TYPE_ARRAY, 307 f = efl_future_then(mv, f, .success_type = EINA_VALUE_TYPE_ARRAY,
290 .success = _efl_test_model_view_child_get); 308 .success = _efl_test_model_view_child_get);