summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-08-05 19:06:11 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-08-05 19:15:35 -0300
commitc1b76d3008ecb7c558ad4ad8de02f1e03ffddf68 (patch)
tree631410fd51486827d2fb36954fd03f34ce4e687c /src/tests
parente6a52ef371430c69da7ce3e7b22f1455a64f1637 (diff)
csharp: fix ownership of value types in arrays and lists
Summary: `eolian_mono` now considers the implicit ownership of value types in arrays and lists when generating ownership flags. Also, update manual bindings for arrays and lists to no longer free elements in the `Dispose` method when the container has ownership of the elements but C# itself does not have ownership of the container; the elements will be freed by whoever owns the container. Modifying and removing elements will still free them though. Re-enabled unit tests that required ownership of value type elements. Reviewers: felipealmeida, q66, vitor.sousa Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9457
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/efl_mono/Eina.cs12
-rw-r--r--src/tests/efl_mono/dummy_test_object.eo12
2 files changed, 0 insertions, 24 deletions
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index 07dfd1bed2..0f6d9774bc 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -838,7 +838,6 @@ class TestEinaArray
838 Test.Assert(arr.Handle == IntPtr.Zero); 838 Test.Assert(arr.Handle == IntPtr.Zero);
839 } 839 }
840 840
841 /*
842 public static void test_eina_array_int_in_own() 841 public static void test_eina_array_int_in_own()
843 { 842 {
844 var t = new Dummy.TestObject(); 843 var t = new Dummy.TestObject();
@@ -851,7 +850,6 @@ class TestEinaArray
851 Test.Assert(arr.Handle == IntPtr.Zero); 850 Test.Assert(arr.Handle == IntPtr.Zero);
852 Test.Assert(t.CheckEinaArrayIntInOwn()); 851 Test.Assert(t.CheckEinaArrayIntInOwn());
853 } 852 }
854 */
855 853
856 public static void test_eina_array_int_out() 854 public static void test_eina_array_int_out()
857 { 855 {
@@ -866,7 +864,6 @@ class TestEinaArray
866 Test.Assert(t.CheckEinaArrayIntOut()); 864 Test.Assert(t.CheckEinaArrayIntOut());
867 } 865 }
868 866
869 /*
870 public static void test_eina_array_int_out_own() 867 public static void test_eina_array_int_out_own()
871 { 868 {
872 var t = new Dummy.TestObject(); 869 var t = new Dummy.TestObject();
@@ -878,7 +875,6 @@ class TestEinaArray
878 arr.Dispose(); 875 arr.Dispose();
879 Test.Assert(arr.Handle == IntPtr.Zero); 876 Test.Assert(arr.Handle == IntPtr.Zero);
880 } 877 }
881 */
882 878
883 public static void test_eina_array_int_return() 879 public static void test_eina_array_int_return()
884 { 880 {
@@ -892,7 +888,6 @@ class TestEinaArray
892 Test.Assert(t.CheckEinaArrayIntReturn()); 888 Test.Assert(t.CheckEinaArrayIntReturn());
893 } 889 }
894 890
895 /*
896 public static void test_eina_array_int_return_own() 891 public static void test_eina_array_int_return_own()
897 { 892 {
898 var t = new Dummy.TestObject(); 893 var t = new Dummy.TestObject();
@@ -903,7 +898,6 @@ class TestEinaArray
903 arr.Dispose(); 898 arr.Dispose();
904 Test.Assert(arr.Handle == IntPtr.Zero); 899 Test.Assert(arr.Handle == IntPtr.Zero);
905 } 900 }
906 */
907 901
908 // String // 902 // String //
909 public static void test_eina_array_str_in() 903 public static void test_eina_array_str_in()
@@ -1902,7 +1896,6 @@ class TestEinaList
1902 Test.Assert(lst.Handle == IntPtr.Zero); 1896 Test.Assert(lst.Handle == IntPtr.Zero);
1903 } 1897 }
1904 1898
1905 /*
1906 public static void test_eina_list_int_in_own() 1899 public static void test_eina_list_int_in_own()
1907 { 1900 {
1908 var t = new Dummy.TestObject(); 1901 var t = new Dummy.TestObject();
@@ -1914,7 +1907,6 @@ class TestEinaList
1914 Test.Assert(lst.Handle == IntPtr.Zero); 1907 Test.Assert(lst.Handle == IntPtr.Zero);
1915 Test.Assert(t.CheckEinaListIntInOwn()); 1908 Test.Assert(t.CheckEinaListIntInOwn());
1916 } 1909 }
1917 */
1918 1910
1919 public static void test_eina_list_int_out() 1911 public static void test_eina_list_int_out()
1920 { 1912 {
@@ -1928,7 +1920,6 @@ class TestEinaList
1928 Test.Assert(t.CheckEinaListIntOut()); 1920 Test.Assert(t.CheckEinaListIntOut());
1929 } 1921 }
1930 1922
1931 /*
1932 public static void test_eina_list_int_out_own() 1923 public static void test_eina_list_int_out_own()
1933 { 1924 {
1934 var t = new Dummy.TestObject(); 1925 var t = new Dummy.TestObject();
@@ -1940,7 +1931,6 @@ class TestEinaList
1940 lst.Dispose(); 1931 lst.Dispose();
1941 Test.Assert(lst.Handle == IntPtr.Zero); 1932 Test.Assert(lst.Handle == IntPtr.Zero);
1942 } 1933 }
1943 */
1944 1934
1945 public static void test_eina_list_int_return() 1935 public static void test_eina_list_int_return()
1946 { 1936 {
@@ -1953,7 +1943,6 @@ class TestEinaList
1953 Test.Assert(t.CheckEinaListIntReturn()); 1943 Test.Assert(t.CheckEinaListIntReturn());
1954 } 1944 }
1955 1945
1956 /*
1957 public static void test_eina_list_int_return_own() 1946 public static void test_eina_list_int_return_own()
1958 { 1947 {
1959 var t = new Dummy.TestObject(); 1948 var t = new Dummy.TestObject();
@@ -1964,7 +1953,6 @@ class TestEinaList
1964 lst.Dispose(); 1953 lst.Dispose();
1965 Test.Assert(lst.Handle == IntPtr.Zero); 1954 Test.Assert(lst.Handle == IntPtr.Zero);
1966 } 1955 }
1967 */
1968 1956
1969 // String // 1957 // String //
1970 public static void test_eina_list_str_in() 1958 public static void test_eina_list_str_in()
diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo
index 47ec4c6b27..e25f7b29bb 100644
--- a/src/tests/efl_mono/dummy_test_object.eo
+++ b/src/tests/efl_mono/dummy_test_object.eo
@@ -385,7 +385,6 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
385 return: bool; 385 return: bool;
386 } 386 }
387 387
388 /*
389 eina_array_int_in_own { 388 eina_array_int_in_own {
390 params { 389 params {
391 @in arr: array<int> @owned; // <int @owned> 390 @in arr: array<int> @owned; // <int @owned>
@@ -395,7 +394,6 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
395 check_eina_array_int_in_own { 394 check_eina_array_int_in_own {
396 return: bool; 395 return: bool;
397 } 396 }
398 */
399 397
400 eina_array_int_out { 398 eina_array_int_out {
401 params { 399 params {
@@ -407,14 +405,12 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
407 return: bool; 405 return: bool;
408 } 406 }
409 407
410 /*
411 eina_array_int_out_own { 408 eina_array_int_out_own {
412 params { 409 params {
413 @out arr: array<int> @owned; // <int @owned> 410 @out arr: array<int> @owned; // <int @owned>
414 } 411 }
415 return: bool; 412 return: bool;
416 } 413 }
417 */
418 414
419 eina_array_int_return { 415 eina_array_int_return {
420 return: array<int>; 416 return: array<int>;
@@ -423,11 +419,9 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
423 return: bool; 419 return: bool;
424 } 420 }
425 421
426 /*
427 eina_array_int_return_own { 422 eina_array_int_return_own {
428 return: array<int> @owned; // <int @owned> 423 return: array<int> @owned; // <int @owned>
429 } 424 }
430 */
431 425
432 /* String */ 426 /* String */
433 eina_array_str_in { 427 eina_array_str_in {
@@ -584,7 +578,6 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
584 return: bool; 578 return: bool;
585 } 579 }
586 580
587 /*
588 eina_list_int_in_own { 581 eina_list_int_in_own {
589 params { 582 params {
590 @in lst: list<int> @owned; // <int @owned> 583 @in lst: list<int> @owned; // <int @owned>
@@ -594,7 +587,6 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
594 check_eina_list_int_in_own { 587 check_eina_list_int_in_own {
595 return: bool; 588 return: bool;
596 } 589 }
597 */
598 590
599 eina_list_int_out { 591 eina_list_int_out {
600 params { 592 params {
@@ -606,14 +598,12 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
606 return: bool; 598 return: bool;
607 } 599 }
608 600
609 /*
610 eina_list_int_out_own { 601 eina_list_int_out_own {
611 params { 602 params {
612 @out lst: list<int> @owned; // <int @owned> 603 @out lst: list<int> @owned; // <int @owned>
613 } 604 }
614 return: bool; 605 return: bool;
615 } 606 }
616 */
617 607
618 eina_list_int_return { 608 eina_list_int_return {
619 return: list<int>; 609 return: list<int>;
@@ -622,11 +612,9 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
622 return: bool; 612 return: bool;
623 } 613 }
624 614
625 /*
626 eina_list_int_return_own { 615 eina_list_int_return_own {
627 return: list<int> @owned; // <int @owned> 616 return: list<int> @owned; // <int @owned>
628 } 617 }
629 */
630 618
631 /* String */ 619 /* String */
632 eina_list_str_in { 620 eina_list_str_in {