summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Eo.cs
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-12-17 11:34:41 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-12-17 11:34:42 -0300
commit8e951504f584f124ba88471fc46f1e7b6d2d3639 (patch)
tree3839fc7a7e31b744cf6ed9b9b1d5acfda0ab6d55 /src/tests/efl_mono/Eo.cs
parentf90a97470d54edb20116e55739025e71cdfbbd92 (diff)
csharp : add move tag info to EinaAccessor, EinaIterator converter
Summary: Included commits in devs/lauromoura/remove_eina_mono-rebased ``` commit ed6679db1901c710cc6ddb50e7001cfd20caa77a Author: Lauro Moura <lauromoura@expertisesolutions.com.br> Date: Mon Dec 2 13:58:04 2019 -0300 csharp: add move information to EnumerableToAccessor Still need to fix the converted accessor ownership, maybe by creating a custom accessor class that released the pinned memory when is freed. ``` ref T8486 Depends On D10878 Co-authored-by: Lauro Moura <lauromoura@expertisesolutions.com.br> Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486 Differential Revision: https://phab.enlightenment.org/D10879
Diffstat (limited to 'src/tests/efl_mono/Eo.cs')
-rw-r--r--src/tests/efl_mono/Eo.cs38
1 files changed, 30 insertions, 8 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index e946f6cf37..586a18cba3 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -257,24 +257,46 @@ class TestVariables
257 257
258class TestEoAccessors 258class TestEoAccessors
259{ 259{
260 public static void basic_eo_accessors() 260 private static void do_eo_accessors(IEnumerable<int> accessor)
261 { 261 {
262 var obj = new Dummy.TestObject(); 262 var obj = new Dummy.TestObject();
263
264 IEnumerable<int> acc = obj.CloneAccessor(accessor);
265
266 var zipped = acc.Zip(accessor, (first, second) => new Tuple<int, int>(first, second));
267
268 foreach (Tuple<int, int> pair in zipped)
269 {
270 Test.AssertEquals(pair.Item1, pair.Item2);
271 }
272 obj.Dispose();
273 }
274
275 public static void eina_eo_accessors()
276 {
263 Eina.List<int> lst = new Eina.List<int>(); 277 Eina.List<int> lst = new Eina.List<int>();
264 lst.Append(4); 278 lst.Append(4);
265 lst.Append(3); 279 lst.Append(3);
266 lst.Append(2); 280 lst.Append(2);
267 lst.Append(5); 281 lst.Append(5);
268 IEnumerable<int> acc = obj.CloneAccessor(lst.GetAccessor());
269 282
270 var zipped = acc.Zip(lst, (first, second) => new Tuple<int, int>(first, second)); 283 // FIXME: Replace the first accessor with the list once Eina.List implements Eina.IList
284 do_eo_accessors(lst.GetAccessor());
271 285
272 foreach (Tuple<int, int> pair in zipped)
273 {
274 Test.AssertEquals(pair.Item1, pair.Item2);
275 }
276 lst.Dispose(); 286 lst.Dispose();
277 obj.Dispose(); 287 }
288
289 public static void managed_eo_accessors()
290 {
291 var obj = new Dummy.TestObject();
292
293 List<int> lst = new List<int>();
294 lst.Add(-1);
295 lst.Add(1);
296 lst.Add(4);
297 lst.Add(42);
298
299 do_eo_accessors(lst);
278 } 300 }
279} 301}
280 302