From 7d4c5f5d7c6de3359ed7887dbeaa150bf1423920 Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Fri, 25 May 2018 10:00:40 -0700 Subject: [PATCH] eo_cxx: Fix do_eo_add after lifecycle branch. Summary: Also changed the previously failing tests to use ck_assert_int_eqinstead of fail_if for better reporting. Test Plan: make check Reviewers: cedric, felipealmeida Reviewed By: cedric Subscribers: #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6194 Reviewed-by: Cedric BAIL --- src/bindings/cxx/eo_cxx/eo_cxx_interop.hh | 2 +- src/tests/eolian_cxx/eolian_cxx_test_binding.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh index fc00db830e..019a417d14 100644 --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh @@ -837,7 +837,7 @@ void do_eo_add(Eo*& object, P const& parent, Efl_Class const* klass , F&& f , typename std::enable_if< eo::is_eolian_object

::value>::type* = 0) { - bool is_ref = (parent._eo_ptr() != nullptr); + bool const is_ref = true; object = ::_efl_add_internal_start(__FILE__, __LINE__, klass, parent._eo_ptr(), is_ref, EINA_FALSE); ::efl::eolian::call_lambda(std::forward(f), proxy); object = ::_efl_add_end(object, is_ref, EINA_FALSE); diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc index 6cc6c6198e..0804cd7599 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc @@ -24,8 +24,8 @@ START_TEST(eolian_cxx_test_binding_constructor_only_required) } ); - fail_if(1 != g.req_ctor_a_value_get()); - fail_if(2 != g.req_ctor_b_value_get()); + ck_assert_int_eq(1, g.req_ctor_a_value_get()); + ck_assert_int_eq(2, g.req_ctor_b_value_get()); } END_TEST @@ -55,10 +55,10 @@ START_TEST(eolian_cxx_test_binding_constructor_all_optionals) } ); - fail_if(2 != g.req_ctor_a_value_get()); - fail_if(3 != g.opt_ctor_a_value_get()); - fail_if(4 != g.req_ctor_b_value_get()); - fail_if(5 != g.opt_ctor_b_value_get()); + ck_assert_int_eq(2, g.req_ctor_a_value_get()); + ck_assert_int_eq(3, g.opt_ctor_a_value_get()); + ck_assert_int_eq(4, g.req_ctor_b_value_get()); + ck_assert_int_eq(5, g.opt_ctor_b_value_get()); } END_TEST