summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite/eo_test_general.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-08-26 10:47:06 +0100
committerTom Hacohen <tom@stosb.com>2015-08-26 10:47:06 +0100
commitacc158a2bfb2f1f1edc587386d7f0ac5ed456e20 (patch)
tree0172745b12d86536b3a829cecd96a55d1e43ec34 /src/tests/eo/suite/eo_test_general.c
parent37abea3831f62ac612b377bb48ce6c90e076dd25 (diff)
Revert "Revert "Eo base: Change parent_set to be an assignment of ref.""
Had to revert it until I pushed the changes to elm, which I had issues with. Now the patch can safely go back in. This reverts commit 37abea3831f62ac612b377bb48ce6c90e076dd25.
Diffstat (limited to '')
-rw-r--r--src/tests/eo/suite/eo_test_general.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 47064cf373..9121f8fac0 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -464,6 +464,29 @@ START_TEST(eo_refs)
464 ck_assert_int_eq(eo_ref_get(obj2), 1); 464 ck_assert_int_eq(eo_ref_get(obj2), 1);
465 ck_assert_int_eq(eo_ref_get(obj3), 2); 465 ck_assert_int_eq(eo_ref_get(obj3), 2);
466 466
467 /* Setting and removing parents. */
468 obj = eo_add(SIMPLE_CLASS, NULL);
469 obj2 = eo_ref(eo_add(SIMPLE_CLASS, obj));
470 obj3 = eo_ref(eo_add(SIMPLE_CLASS, NULL));
471
472 eo_do(obj2, eo_parent_set(obj3));
473 eo_do(obj3, eo_parent_set(obj));
474 ck_assert_int_eq(eo_ref_get(obj2), 2);
475 ck_assert_int_eq(eo_ref_get(obj3), 2);
476
477 eo_do(obj2, eo_parent_set(NULL));
478 eo_do(obj3, eo_parent_set(NULL));
479 ck_assert_int_eq(eo_ref_get(obj2), 1);
480 ck_assert_int_eq(eo_ref_get(obj3), 1);
481
482 eo_do(obj2, eo_parent_set(obj));
483 eo_do(obj3, eo_parent_set(obj));
484 ck_assert_int_eq(eo_ref_get(obj2), 1);
485 ck_assert_int_eq(eo_ref_get(obj3), 1);
486
487 eo_del(obj);
488 eo_del(obj2);
489 eo_del(obj3);
467 490
468 /* Just check it doesn't seg atm. */ 491 /* Just check it doesn't seg atm. */
469 obj = eo_add(SIMPLE_CLASS, NULL); 492 obj = eo_add(SIMPLE_CLASS, NULL);