diff options
author | Lauro Moura <lauromoura@expertisesolutions.com.br> | 2019-12-02 14:12:34 -0300 |
---|---|---|
committer | Lauro Moura <lauromoura@expertisesolutions.com.br> | 2019-12-03 18:07:05 -0300 |
commit | b3e181670e076fcb1d9d1536e99e1f97fa5689aa (patch) | |
tree | 4ad246ee2cbd7c549b0302d6982f6c46886c2dd0 | |
parent | ed6679db1901c710cc6ddb50e7001cfd20caa77a (diff) | |
download | efl-b3e181670e076fcb1d9d1536e99e1f97fa5689aa.tar.gz |
csharp: Add accessor test receiving a C# collection
-rw-r--r-- | src/tests/efl_mono/Eo.cs | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs index 74a7eb6e7f..3b54bbf52b 100644 --- a/src/tests/efl_mono/Eo.cs +++ b/src/tests/efl_mono/Eo.cs @@ -257,27 +257,47 @@ class TestVariables class TestEoAccessors { - public static void basic_eo_accessors() + private static void do_eo_accessors(IEnumerable<int> accessor) { var obj = new Dummy.TestObject(); - Eina.List<int> lst = new Eina.List<int>(); - lst.Append(4); - lst.Append(3); - lst.Append(2); - lst.Append(5); - IEnumerable<int> origin = lst.GetAccessor(); - IEnumerable<int> acc = obj.CloneAccessor(origin); + IEnumerable<int> acc = obj.CloneAccessor(accessor); - var zipped = acc.Zip(lst, (first, second) => new Tuple<int, int>(first, second)); + var zipped = acc.Zip(accessor, (first, second) => new Tuple<int, int>(first, second)); foreach (Tuple<int, int> pair in zipped) { Test.AssertEquals(pair.Item1, pair.Item2); } - lst.Dispose(); obj.Dispose(); } + + public static void eina_eo_accessors() + { + Eina.List<int> lst = new Eina.List<int>(); + lst.Append(4); + lst.Append(3); + lst.Append(2); + lst.Append(5); + + // FIXME: Replace the first accessor with the list once Eina.List implements Eina.IList + do_eo_accessors(lst.GetAccessor()); + + lst.Dispose(); + } + + public static void managed_eo_accessors() + { + var obj = new Dummy.TestObject(); + + List<int> lst = new List<int>(); + lst.Add(-1); + lst.Add(1); + lst.Add(4); + lst.Add(42); + + do_eo_accessors(lst); + } } class TestEoFinalize |