forked from enlightenment/efl
eo: Fix override test case to match new policy
The new policy is a lot more restrictive. Honestly, I don't like it.
This commit is contained in:
parent
6a559a6fff
commit
ec9107dc1f
|
@ -88,17 +88,28 @@ START_TEST(eo_override_tests)
|
||||||
EO_OVERRIDE_OPS_DEFINE(
|
EO_OVERRIDE_OPS_DEFINE(
|
||||||
overrides2,
|
overrides2,
|
||||||
EO_OP_FUNC_OVERRIDE(simple_a_set, _simple_obj_override_a_double_set));
|
EO_OP_FUNC_OVERRIDE(simple_a_set, _simple_obj_override_a_double_set));
|
||||||
|
fail_if(!eo_override(obj, NULL));
|
||||||
fail_if(!eo_override(obj, &overrides2));
|
fail_if(!eo_override(obj, &overrides2));
|
||||||
|
|
||||||
simple_a_set(obj, OVERRIDE_A_SIMPLE);
|
simple_a_set(obj, OVERRIDE_A_SIMPLE);
|
||||||
ck_assert_int_eq(simple_a_get(obj), OVERRIDE_A + (OVERRIDE_A_SIMPLE * 2));
|
ck_assert_int_eq(simple_a_get(obj), OVERRIDE_A_SIMPLE * 2);
|
||||||
|
|
||||||
|
/* Try overriding again - not allowed by policy */
|
||||||
|
fail_if(eo_override(obj, &overrides));
|
||||||
|
ck_assert_int_eq(simple_a_get(obj), OVERRIDE_A_SIMPLE * 2);
|
||||||
|
|
||||||
/* Try introducing a new function */
|
/* Try introducing a new function */
|
||||||
EO_OVERRIDE_OPS_DEFINE(
|
EO_OVERRIDE_OPS_DEFINE(
|
||||||
overrides3,
|
overrides3,
|
||||||
EO_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set));
|
EO_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set));
|
||||||
|
fail_if(!eo_override(obj, NULL));
|
||||||
fail_if(eo_override(obj, &overrides3));
|
fail_if(eo_override(obj, &overrides3));
|
||||||
|
|
||||||
|
/* Test override reset */
|
||||||
|
fail_if(!eo_override(obj, NULL));
|
||||||
|
simple_a_set(obj, 42 * OVERRIDE_A_SIMPLE);
|
||||||
|
ck_assert_int_eq(simple_a_get(obj), 42 * OVERRIDE_A_SIMPLE);
|
||||||
|
|
||||||
eo_unref(obj);
|
eo_unref(obj);
|
||||||
|
|
||||||
eo_shutdown();
|
eo_shutdown();
|
||||||
|
|
Loading…
Reference in New Issue