aboutsummaryrefslogtreecommitdiffstats
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
parentecore: define behavior when no getter/setter callback function is defined for... (diff)
downloadefl-6c755f669642edc3ca7cc87e6cb1c24bc9fda51a.tar.gz
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 607ee4851f..94d05d5331 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,
Eina_Value *p_int = NULL;
Eina_Value *p_color = NULL;
Eina_Value *p_label = NULL;
+ Eina_Value *p_deadend = NULL;
+ Eina_Error err = 0;
int v_int = 0;
p_int = efl_model_property_get(child, "test_p_int");
@@ -182,6 +184,11 @@ _efl_test_model_view_child_get(Eo *obj EINA_UNUSED,
p_color = efl_model_property_get(child, "color");
p_label = efl_model_property_get(child, "label");
+ p_deadend = efl_model_property_get(child, "deadend");
+
+ ck_assert_ptr_eq(eina_value_type_get(p_deadend), EINA_VALUE_TYPE_ERROR);
+ eina_value_error_get(p_deadend, &err);
+ ck_assert_int_eq(err, EFL_MODEL_ERROR_NOT_SUPPORTED);
efl_event_callback_add(child, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_changed, &counting);
@@ -189,8 +196,14 @@ _efl_test_model_view_child_get(Eo *obj EINA_UNUSED,
.success = _dummy, .error = _expected_fail);
efl_future_then(child, efl_model_property_set(child, "color", p_color),
.success = _dummy, .error = _expected_fail);
+ efl_future_then(child, efl_model_property_set(child, "deadend", eina_value_int_new(42)),
+ .success = _dummy, .error = _expected_fail);
all[i] = efl_model_property_set(child, "test_p_int", eina_value_int_new(v_int+100));
+
+ eina_value_free(p_color);
+ eina_value_free(p_label);
+ eina_value_free(p_deadend);
}
all[i] = EINA_FUTURE_SENTINEL;
@@ -285,6 +298,11 @@ EFL_START_TEST(efl_test_model_view)
NULL, _efl_test_model_view_color_set, _efl_test_model_view_color_clean,
EINA_C_ARRAY_ITERATOR_NEW(dependences));
+ efl_model_view_property_logic_add(mv, "deadend",
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL);
+
f = efl_model_children_slice_get(mv, 0, efl_model_children_count_get(mv));
f = efl_future_then(mv, f, .success_type = EINA_VALUE_TYPE_ARRAY,
.success = _efl_test_model_view_child_get);