This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efl.
View the commit online.
commit 53dcef9eea7653283bfcab9ad2a9065e6c4dbd9f
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 15 20:49:16 2026 -0600
tests: model: releasing a row of the source does not delete it
The row that the shift test adds is parented to the base model and held
by the composite model made for it. Releasing it from the composite must
not fall back to deleting a row of the source, which logs a CRI line for
each one. efl_ui_composite_model_source_release counts the CRI lines
through the log callback, so that an unref of a row nobody referenced
(as the first version of the shift test did) is caught.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/tests/elementary/efl_ui_model.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/src/tests/elementary/efl_ui_model.c b/src/tests/elementary/efl_ui_model.c
index 922764bfe5..1ff7b6ea25 100644
--- a/src/tests/elementary/efl_ui_model.c
+++ b/src/tests/elementary/efl_ui_model.c
@@ -1222,6 +1222,38 @@ EFL_START_TEST(efl_ui_exact_model_shift_unmeasured)
}
EFL_END_TEST
+static unsigned int _cri_count;
+
+static void
+_cri_log(const Eina_Log_Domain *d EINA_UNUSED, Eina_Log_Level level,
+ const char *file EINA_UNUSED, const char *fnc EINA_UNUSED, int line EINA_UNUSED,
+ const char *fmt EINA_UNUSED, void *data EINA_UNUSED, va_list args EINA_UNUSED)
+{
+ if (level <= EINA_LOG_LEVEL_CRITICAL)
+ {
+ _cri_count++;
+ }
+}
+
+// A row of the model that goes is no longer a view on the row of its source.
+// That row belongs to the source model, and nothing else holds it: letting
+// go of it must not delete it (which efl_unref() does, with a CRI).
+EFL_START_TEST(efl_ui_composite_model_source_release)
+{
+ Shift_Rows *sr = _shift_new(8);
+
+ _cri_count = 0;
+ eina_log_print_cb_set(_cri_log, NULL);
+ _shift_insert(sr, 3, 0);
+ _shift_remove(sr, 3);
+ _shift_remove(sr, 0);
+ _shift_free(sr);
+ eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
+
+ ck_assert_uint_eq(_cri_count, 0);
+}
+EFL_END_TEST
+
// The total width is the one of the widest row, and goes down with it.
EFL_START_TEST(efl_ui_exact_model_remove_widest)
{
@@ -1786,4 +1818,5 @@ efl_ui_model(TCase *tc)
tcase_add_test(tc, efl_ui_average_model_remove_after_stopped);
tcase_add_test(tc, efl_ui_exact_model_narrow_widest_other_slot);
tcase_add_test(tc, efl_ui_exact_model_narrower_widest);
+ tcase_add_test(tc, efl_ui_composite_model_source_release);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.