summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-11-08 09:30:42 +0000
committerAndy Williams <andy@andywilliams.me>2017-11-08 09:30:42 +0000
commitd5dbcdabd14c1ddf01f22b4865487ecce272c055 (patch)
tree16b46d4b5ddac556387f3c0bbf6c366e23c67628 /src/tests/eo/suite
parent2a5267d416688948cc260e7d8924d9f6c2ec1c53 (diff)
eo: Rename efl_ref_get to efl_ref_count
Diffstat (limited to 'src/tests/eo/suite')
-rw-r--r--src/tests/eo/suite/eo_test_general.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 3c21e71c14..2a26bf8dd1 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -575,27 +575,27 @@ START_TEST(efl_refs)
575 Eo *obj3 = efl_add(SIMPLE_CLASS, NULL); 575 Eo *obj3 = efl_add(SIMPLE_CLASS, NULL);
576 576
577 efl_xref(obj, obj2); 577 efl_xref(obj, obj2);
578 fail_if(efl_ref_get(obj) != 2); 578 fail_if(efl_ref_count(obj) != 2);
579 efl_xref(obj, obj3); 579 efl_xref(obj, obj3);
580 fail_if(efl_ref_get(obj) != 3); 580 fail_if(efl_ref_count(obj) != 3);
581 581
582 efl_xunref(obj, obj2); 582 efl_xunref(obj, obj2);
583 fail_if(efl_ref_get(obj) != 2); 583 fail_if(efl_ref_count(obj) != 2);
584 efl_xunref(obj, obj3); 584 efl_xunref(obj, obj3);
585 fail_if(efl_ref_get(obj) != 1); 585 fail_if(efl_ref_count(obj) != 1);
586 586
587#ifdef EO_DEBUG 587#ifdef EO_DEBUG
588 efl_xunref(obj, obj3); 588 efl_xunref(obj, obj3);
589 fail_if(efl_ref_get(obj) != 1); 589 fail_if(efl_ref_count(obj) != 1);
590 590
591 efl_xref(obj, obj2); 591 efl_xref(obj, obj2);
592 fail_if(efl_ref_get(obj) != 2); 592 fail_if(efl_ref_count(obj) != 2);
593 593
594 efl_xunref(obj, obj3); 594 efl_xunref(obj, obj3);
595 fail_if(efl_ref_get(obj) != 2); 595 fail_if(efl_ref_count(obj) != 2);
596 596
597 efl_xunref(obj, obj2); 597 efl_xunref(obj, obj2);
598 fail_if(efl_ref_get(obj) != 1); 598 fail_if(efl_ref_count(obj) != 1);
599#endif 599#endif
600 600
601 /* Check we don't seg if there's an extra xref. */ 601 /* Check we don't seg if there's an extra xref. */
@@ -627,9 +627,9 @@ START_TEST(efl_refs)
627 obj2 = efl_add(SIMPLE_CLASS, obj); 627 obj2 = efl_add(SIMPLE_CLASS, obj);
628 obj3 = efl_add_ref(SIMPLE_CLASS, obj); 628 obj3 = efl_add_ref(SIMPLE_CLASS, obj);
629 629
630 ck_assert_int_eq(efl_ref_get(obj), 1); 630 ck_assert_int_eq(efl_ref_count(obj), 1);
631 ck_assert_int_eq(efl_ref_get(obj2), 1); 631 ck_assert_int_eq(efl_ref_count(obj2), 1);
632 ck_assert_int_eq(efl_ref_get(obj3), 2); 632 ck_assert_int_eq(efl_ref_count(obj3), 2);
633 633
634 efl_del(obj); 634 efl_del(obj);
635 efl_del(obj2); 635 efl_del(obj2);
@@ -643,18 +643,18 @@ START_TEST(efl_refs)
643 643
644 efl_parent_set(obj2, obj3); 644 efl_parent_set(obj2, obj3);
645 efl_parent_set(obj3, obj); 645 efl_parent_set(obj3, obj);
646 ck_assert_int_eq(efl_ref_get(obj2), 2); 646 ck_assert_int_eq(efl_ref_count(obj2), 2);
647 ck_assert_int_eq(efl_ref_get(obj3), 2); 647 ck_assert_int_eq(efl_ref_count(obj3), 2);
648 648
649 efl_parent_set(obj2, NULL); 649 efl_parent_set(obj2, NULL);
650 efl_parent_set(obj3, NULL); 650 efl_parent_set(obj3, NULL);
651 ck_assert_int_eq(efl_ref_get(obj2), 1); 651 ck_assert_int_eq(efl_ref_count(obj2), 1);
652 ck_assert_int_eq(efl_ref_get(obj3), 1); 652 ck_assert_int_eq(efl_ref_count(obj3), 1);
653 653
654 efl_parent_set(obj2, obj); 654 efl_parent_set(obj2, obj);
655 efl_parent_set(obj3, obj); 655 efl_parent_set(obj3, obj);
656 ck_assert_int_eq(efl_ref_get(obj2), 2); 656 ck_assert_int_eq(efl_ref_count(obj2), 2);
657 ck_assert_int_eq(efl_ref_get(obj3), 2); 657 ck_assert_int_eq(efl_ref_count(obj3), 2);
658 658
659 efl_del(obj); 659 efl_del(obj);
660 efl_del(obj2); 660 efl_del(obj2);
@@ -665,23 +665,23 @@ START_TEST(efl_refs)
665 obj2 = efl_add_ref(SIMPLE_CLASS, obj); 665 obj2 = efl_add_ref(SIMPLE_CLASS, obj);
666 obj3 = efl_add_ref(SIMPLE_CLASS, NULL); 666 obj3 = efl_add_ref(SIMPLE_CLASS, NULL);
667 667
668 ck_assert_int_eq(efl_ref_get(obj2), 2); 668 ck_assert_int_eq(efl_ref_count(obj2), 2);
669 ck_assert_int_eq(efl_ref_get(obj3), 1); 669 ck_assert_int_eq(efl_ref_count(obj3), 1);
670 670
671 efl_parent_set(obj2, obj3); 671 efl_parent_set(obj2, obj3);
672 efl_parent_set(obj3, obj); 672 efl_parent_set(obj3, obj);
673 ck_assert_int_eq(efl_ref_get(obj2), 2); 673 ck_assert_int_eq(efl_ref_count(obj2), 2);
674 ck_assert_int_eq(efl_ref_get(obj3), 2); 674 ck_assert_int_eq(efl_ref_count(obj3), 2);
675 675
676 efl_parent_set(obj2, NULL); 676 efl_parent_set(obj2, NULL);
677 efl_parent_set(obj3, NULL); 677 efl_parent_set(obj3, NULL);
678 ck_assert_int_eq(efl_ref_get(obj2), 1); 678 ck_assert_int_eq(efl_ref_count(obj2), 1);
679 ck_assert_int_eq(efl_ref_get(obj3), 1); 679 ck_assert_int_eq(efl_ref_count(obj3), 1);
680 680
681 efl_parent_set(obj2, obj); 681 efl_parent_set(obj2, obj);
682 efl_parent_set(obj3, obj); 682 efl_parent_set(obj3, obj);
683 ck_assert_int_eq(efl_ref_get(obj2), 2); 683 ck_assert_int_eq(efl_ref_count(obj2), 2);
684 ck_assert_int_eq(efl_ref_get(obj3), 2); 684 ck_assert_int_eq(efl_ref_count(obj3), 2);
685 685
686 efl_del(obj); 686 efl_del(obj);
687 efl_del(obj2); 687 efl_del(obj2);
@@ -829,10 +829,10 @@ START_TEST(eo_generic_data)
829 fail_if(objtmp); 829 fail_if(objtmp);
830 830
831 efl_key_ref_set(obj, "test1", obj2); 831 efl_key_ref_set(obj, "test1", obj2);
832 fail_if(efl_ref_get(obj2) != 2); 832 fail_if(efl_ref_count(obj2) != 2);
833 833
834 efl_key_ref_set(obj, "test2", obj3); 834 efl_key_ref_set(obj, "test2", obj3);
835 fail_if(efl_ref_get(obj3) != 2); 835 fail_if(efl_ref_count(obj3) != 2);
836 836
837 objtmp = efl_key_ref_get(obj, "test1"); 837 objtmp = efl_key_ref_get(obj, "test1");
838 fail_if(obj2 != objtmp); 838 fail_if(obj2 != objtmp);
@@ -844,7 +844,7 @@ START_TEST(eo_generic_data)
844 fail_if(obj3 != objtmp); 844 fail_if(obj3 != objtmp);
845 845
846 efl_key_ref_set(obj, "test2", NULL); 846 efl_key_ref_set(obj, "test2", NULL);
847 fail_if(efl_ref_get(obj3) != 1); 847 fail_if(efl_ref_count(obj3) != 1);
848 848
849 objtmp = efl_key_ref_get(obj, "test2"); 849 objtmp = efl_key_ref_get(obj, "test2");
850 fail_if(objtmp); 850 fail_if(objtmp);
@@ -853,7 +853,7 @@ START_TEST(eo_generic_data)
853 fail_if(obj2 != objtmp); 853 fail_if(obj2 != objtmp);
854 854
855 efl_key_ref_set(obj, "test1", NULL); 855 efl_key_ref_set(obj, "test1", NULL);
856 fail_if(efl_ref_get(obj2) != 1); 856 fail_if(efl_ref_count(obj2) != 1);
857 857
858 objtmp = efl_key_ref_get(obj, "test1"); 858 objtmp = efl_key_ref_get(obj, "test1");
859 fail_if(objtmp); 859 fail_if(objtmp);
@@ -884,10 +884,10 @@ START_TEST(eo_generic_data)
884 fail_if(objtmp); 884 fail_if(objtmp);
885 885
886 efl_key_wref_set(obj, "test1", obj2); 886 efl_key_wref_set(obj, "test1", obj2);
887 fail_if(efl_ref_get(obj2) != 1); 887 fail_if(efl_ref_count(obj2) != 1);
888 888
889 efl_key_wref_set(obj, "test2", obj3); 889 efl_key_wref_set(obj, "test2", obj3);
890 fail_if(efl_ref_get(obj3) != 1); 890 fail_if(efl_ref_count(obj3) != 1);
891 891
892 objtmp = efl_key_wref_get(obj, "test1"); 892 objtmp = efl_key_wref_get(obj, "test1");
893 fail_if(obj2 != objtmp); 893 fail_if(obj2 != objtmp);
@@ -899,7 +899,7 @@ START_TEST(eo_generic_data)
899 fail_if(obj3 != objtmp); 899 fail_if(obj3 != objtmp);
900 900
901 efl_key_wref_set(obj, "test2", NULL); 901 efl_key_wref_set(obj, "test2", NULL);
902 fail_if(efl_ref_get(obj3) != 1); 902 fail_if(efl_ref_count(obj3) != 1);
903 903
904 objtmp = efl_key_wref_get(obj, "test2"); 904 objtmp = efl_key_wref_get(obj, "test2");
905 fail_if(objtmp); 905 fail_if(objtmp);
@@ -908,7 +908,7 @@ START_TEST(eo_generic_data)
908 fail_if(obj2 != objtmp); 908 fail_if(obj2 != objtmp);
909 909
910 efl_key_wref_set(obj, "test1", NULL); 910 efl_key_wref_set(obj, "test1", NULL);
911 fail_if(efl_ref_get(obj2) != 1); 911 fail_if(efl_ref_count(obj2) != 1);
912 912
913 objtmp = efl_key_wref_get(obj, "test1"); 913 objtmp = efl_key_wref_get(obj, "test1");
914 fail_if(objtmp); 914 fail_if(objtmp);
@@ -1003,7 +1003,7 @@ START_TEST(eo_magic_checks)
1003 efl_isa((Eo *) buf, SIMPLE_CLASS); 1003 efl_isa((Eo *) buf, SIMPLE_CLASS);
1004 efl_isa(obj, (Efl_Class *) buf); 1004 efl_isa(obj, (Efl_Class *) buf);
1005 1005
1006 fail_if(0 != efl_ref_get((Eo *) buf)); 1006 fail_if(0 != efl_ref_count((Eo *) buf));
1007 1007
1008 efl_wref_add((Eo *) buf, &wref); 1008 efl_wref_add((Eo *) buf, &wref);
1009 parent = efl_parent_get((Eo *) buf); 1009 parent = efl_parent_get((Eo *) buf);
@@ -1322,15 +1322,15 @@ START_TEST(efl_del_intercept)
1322 Eo *parent = efl_add(SIMPLE_CLASS, NULL); 1322 Eo *parent = efl_add(SIMPLE_CLASS, NULL);
1323 obj = efl_add(klass, NULL); 1323 obj = efl_add(klass, NULL);
1324 fail_if(!obj); 1324 fail_if(!obj);
1325 ck_assert_int_eq(efl_ref_get(obj), 1); 1325 ck_assert_int_eq(efl_ref_count(obj), 1);
1326 efl_parent_set(obj, parent); 1326 efl_parent_set(obj, parent);
1327 ck_assert_int_eq(efl_ref_get(obj), 1); 1327 ck_assert_int_eq(efl_ref_count(obj), 1);
1328 efl_del_intercept_set(obj, _del_intercept_reuse); 1328 efl_del_intercept_set(obj, _del_intercept_reuse);
1329 efl_del_intercept_set(obj, NULL); 1329 efl_del_intercept_set(obj, NULL);
1330 /* This essentially checks it get unsunk */ 1330 /* This essentially checks it get unsunk */
1331 ck_assert_int_eq(efl_ref_get(obj), 1); 1331 ck_assert_int_eq(efl_ref_count(obj), 1);
1332 efl_parent_set(obj, parent); 1332 efl_parent_set(obj, parent);
1333 ck_assert_int_eq(efl_ref_get(obj), 1); 1333 ck_assert_int_eq(efl_ref_count(obj), 1);
1334 efl_del(obj); 1334 efl_del(obj);
1335 1335
1336 efl_object_shutdown(); 1336 efl_object_shutdown();
@@ -1738,22 +1738,22 @@ START_TEST(efl_object_auto_unref_test)
1738 // Test unref after valid call 1738 // Test unref after valid call
1739 _auto_unref_del = 0; 1739 _auto_unref_del = 0;
1740 obj = efl_add(SIMPLE_CLASS, NULL); 1740 obj = efl_add(SIMPLE_CLASS, NULL);
1741 fail_if(efl_ref_get(obj) != 1); 1741 fail_if(efl_ref_count(obj) != 1);
1742 efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del); 1742 efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
1743 efl_auto_unref_set(obj, 1); 1743 efl_auto_unref_set(obj, 1);
1744 fail_if(_auto_unref_del); 1744 fail_if(_auto_unref_del);
1745 fail_if(efl_ref_get(obj) != 1); 1745 fail_if(efl_ref_count(obj) != 1);
1746 efl_name_set(obj, "name"); 1746 efl_name_set(obj, "name");
1747 fail_if(!_auto_unref_del); 1747 fail_if(!_auto_unref_del);
1748 1748
1749 // Test unref after invalid call 1749 // Test unref after invalid call
1750 _auto_unref_del = 0; 1750 _auto_unref_del = 0;
1751 obj = efl_add(SIMPLE_CLASS, NULL); 1751 obj = efl_add(SIMPLE_CLASS, NULL);
1752 fail_if(efl_ref_get(obj) != 1); 1752 fail_if(efl_ref_count(obj) != 1);
1753 efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del); 1753 efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
1754 efl_auto_unref_set(obj, 1); 1754 efl_auto_unref_set(obj, 1);
1755 fail_if(_auto_unref_del); 1755 fail_if(_auto_unref_del);
1756 fail_if(efl_ref_get(obj) != 1); 1756 fail_if(efl_ref_count(obj) != 1);
1757 simple_no_implementation(obj); 1757 simple_no_implementation(obj);
1758 fail_if(!_auto_unref_del); 1758 fail_if(!_auto_unref_del);
1759 1759
@@ -1761,12 +1761,12 @@ START_TEST(efl_object_auto_unref_test)
1761 _auto_unref_del = 0; 1761 _auto_unref_del = 0;
1762 parent = efl_add(SIMPLE_CLASS, NULL); 1762 parent = efl_add(SIMPLE_CLASS, NULL);
1763 obj = efl_add(SIMPLE_CLASS, parent); 1763 obj = efl_add(SIMPLE_CLASS, parent);
1764 fail_if(efl_ref_get(obj) != 1); 1764 fail_if(efl_ref_count(obj) != 1);
1765 efl_allow_parent_unref_set(obj, 1); 1765 efl_allow_parent_unref_set(obj, 1);
1766 efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del); 1766 efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
1767 efl_auto_unref_set(obj, 1); 1767 efl_auto_unref_set(obj, 1);
1768 fail_if(_auto_unref_del); 1768 fail_if(_auto_unref_del);
1769 fail_if(efl_ref_get(obj) != 1); 1769 fail_if(efl_ref_count(obj) != 1);
1770 efl_name_set(obj, "name"); 1770 efl_name_set(obj, "name");
1771 fail_if(!_auto_unref_del); 1771 fail_if(!_auto_unref_del);
1772 efl_del(parent); 1772 efl_del(parent);