summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno da Silva Belo <brunodasilvabelo@gmail.com>2019-12-17 19:29:58 +0000
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-12-22 11:31:35 -0300
commit47407478e8d247fd36aca607ec1bcc1f720bfa96 (patch)
tree9ce826aed4f93553129d0434fcd1aae86c1de7f1
parentc49880076c353202e1d7a19ac2841a01f5756d41 (diff)
c#: Implement IList to Eina.Array.
ref T8488 Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D10785
-rw-r--r--src/bindings/mono/efl_mono/efl_csharp_application.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_array.cs290
-rw-r--r--src/lib/efl_mono/efl_custom_exports_mono.c11
-rw-r--r--src/tests/efl_mono/Array.cs189
-rw-r--r--src/tests/efl_mono/Eina.cs43
-rw-r--r--src/tests/efl_mono/Events.cs2
-rw-r--r--src/tests/efl_mono/dummy_test_object.c16
-rw-r--r--src/tests/efl_mono/meson.build1
8 files changed, 447 insertions, 107 deletions
diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs
index 94d56d3df9..8493abd6ab 100644
--- a/src/bindings/mono/efl_mono/efl_csharp_application.cs
+++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs
@@ -209,7 +209,7 @@ public abstract class Application
209 if (evt.arg.Initialization) 209 if (evt.arg.Initialization)
210 { 210 {
211 var evtArgv = evt.arg.Argv; 211 var evtArgv = evt.arg.Argv;
212 int n = evtArgv.Length; 212 int n = evtArgv.Count;
213 var argv = new string[n]; 213 var argv = new string[n];
214 for (int i = 0; i < n; ++i) 214 for (int i = 0; i < n; ++i)
215 { 215 {
diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs
index 1573a88aa0..f5f807ad55 100644
--- a/src/bindings/mono/eina_mono/eina_array.cs
+++ b/src/bindings/mono/eina_mono/eina_array.cs
@@ -36,8 +36,9 @@ public static class ArrayNativeFunctions
36 eina_array_free(IntPtr array); 36 eina_array_free(IntPtr array);
37 [DllImport(efl.Libs.Eina)] internal static extern void 37 [DllImport(efl.Libs.Eina)] internal static extern void
38 eina_array_flush(IntPtr array); 38 eina_array_flush(IntPtr array);
39 public delegate bool KeepCb(IntPtr data, IntPtr gdata);
39 [DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool 40 [DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool
40 eina_array_remove(IntPtr array, IntPtr keep, IntPtr gdata); 41 eina_array_remove(IntPtr array, KeepCb keep, IntPtr gdata);
41 [DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool 42 [DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool
42 eina_array_push(IntPtr array, IntPtr data); 43 eina_array_push(IntPtr array, IntPtr data);
43 44
@@ -45,6 +46,10 @@ public static class ArrayNativeFunctions
45 eina_array_iterator_new(IntPtr array); 46 eina_array_iterator_new(IntPtr array);
46 [DllImport(efl.Libs.Eina)] internal static extern IntPtr 47 [DllImport(efl.Libs.Eina)] internal static extern IntPtr
47 eina_array_accessor_new(IntPtr array); 48 eina_array_accessor_new(IntPtr array);
49 [DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)]
50 internal static extern bool
51 eina_array_find(IntPtr array, IntPtr data,
52 uint out_idx);
48 53
49 [DllImport(efl.Libs.CustomExports)] internal static extern void 54 [DllImport(efl.Libs.CustomExports)] internal static extern void
50 eina_array_clean_custom_export_mono(IntPtr array); 55 eina_array_clean_custom_export_mono(IntPtr array);
@@ -61,6 +66,8 @@ public static class ArrayNativeFunctions
61 66
62 [DllImport(efl.Libs.CustomExports)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool 67 [DllImport(efl.Libs.CustomExports)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool
63 eina_array_foreach_custom_export_mono(IntPtr array, IntPtr cb, IntPtr fdata); 68 eina_array_foreach_custom_export_mono(IntPtr array, IntPtr cb, IntPtr fdata);
69 [DllImport(efl.Libs.CustomExports)] internal static extern void
70 eina_array_insert_at_custom_export_mono(IntPtr array, uint index, IntPtr data);
64} 71}
65 72
66/// <summary>A container of contiguous allocated elements. 73/// <summary>A container of contiguous allocated elements.
@@ -68,30 +75,42 @@ public static class ArrayNativeFunctions
68/// </summary> 75/// </summary>
69[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", 76[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
70 Justification="This is a generalized container mapping the native one.")] 77 Justification="This is a generalized container mapping the native one.")]
71public class Array<T> : IEnumerable<T>, IDisposable 78public class Array<T> : IList<T>, IEnumerable<T>, IDisposable
72{ 79{
73 public const uint DefaultStep = 32; 80 public const uint DefaultStep = 32;
74 81
75 /// <summary>Pointer to the native buffer.</summary> 82 /// <summary>Pointer to the native buffer.</summary>
76 [EditorBrowsable(EditorBrowsableState.Never)] 83 [EditorBrowsable(EditorBrowsableState.Never)]
77 public IntPtr Handle {get;set;} = IntPtr.Zero; 84 public IntPtr Handle { get; set; } = IntPtr.Zero;
85
78 /// <summary>Whether this wrapper owns the native buffer. 86 /// <summary>Whether this wrapper owns the native buffer.
79 /// <para>Since EFL 1.23.</para> 87 /// <para>Since EFL 1.23.</para>
80 /// </summary> 88 /// </summary>
81 public bool Own {get;set;} 89 internal bool Own { get; set; }
90
82 /// <summary>Who is in charge of releasing the resources wrapped by 91 /// <summary>Who is in charge of releasing the resources wrapped by
83 /// this instance. 92 /// this instance.
84 /// <para>Since EFL 1.23.</para> 93 /// <para>Since EFL 1.23.</para>
85 /// </summary> 94 /// </summary>
86 public bool OwnContent {get;set;} 95 internal bool OwnContent { get; set; }
87 /// <summary> Length of the array. 96
88 /// <para>Since EFL 1.23.</para> 97 /// <summary> Gets the number of elements contained in the <see cref="Array{T}" />.
98 /// <para>Since EFL 1.24.</para>
89 /// </summary> 99 /// </summary>
90 public int Length 100 public int Count
91 { 101 {
92 get { return Count(); } 102 get => (int)eina_array_count_custom_export_mono(Handle);
93 } 103 }
94 104
105 /// <summary>
106 /// Gets a value indicating whether the <see cref="Array" /> is read-only.
107 /// <para>Since EFL 1.24.</para>
108 ///<para>
109 /// It's the negative of <see cref="OwnContent" />.
110 ///</para>
111 /// </summary>
112 public bool IsReadOnly { get => !OwnContent; }
113
95 private void InitNew(uint step) 114 private void InitNew(uint step)
96 { 115 {
97 Handle = eina_array_new(step); 116 Handle = eina_array_new(step);
@@ -104,23 +123,62 @@ public class Array<T> : IEnumerable<T>, IDisposable
104 } 123 }
105 124
106 internal bool InternalPush(IntPtr ele) 125 internal bool InternalPush(IntPtr ele)
126 => eina_array_push_custom_export_mono(Handle, ele);
127
128 internal IntPtr InternalPop()
129 => eina_array_pop_custom_export_mono(Handle);
130
131 internal IntPtr InternalDataGet(int idx)
132 => eina_array_data_get_custom_export_mono(Handle, CheckBounds(idx));
133
134 internal void InternalDataSet(int idx, IntPtr ele)
135 => eina_array_data_set_custom_export_mono(Handle, CheckBounds(idx), ele);
136
137 private uint CheckBounds(int idx)
107 { 138 {
108 return eina_array_push_custom_export_mono(Handle, ele); 139 if (!(0 <= idx && idx < Count))
140 {
141 throw new ArgumentOutOfRangeException(nameof(idx), $"{nameof(idx)} is out of bounds.");
142 }
143
144 return (uint)idx;
109 } 145 }
110 146
111 internal IntPtr InternalPop() 147 private U LoopingThrough<U>(T val, Func<int, U> f1, Func<U> f2)
112 { 148 {
113 return eina_array_pop_custom_export_mono(Handle); 149 for (int i = 0, count = Count; i < count; ++i)
150 {
151 if (NativeToManaged<T>(InternalDataGet(i)).Equals(val))
152 {
153 return f1(i);
154 }
155 }
156
157 return f2();
114 } 158 }
115 159
116 internal IntPtr InternalDataGet(int idx) 160 private void CheckOwnerships()
117 { 161 {
118 return eina_array_data_get_custom_export_mono(Handle, (uint)idx); // TODO: Check bounds ??? 162 if ((Own == false) && (OwnContent == true))
163 {
164 throw new InvalidOperationException(nameof(Own) + "/" + nameof(OwnContent));
165 }
119 } 166 }
120 167
121 internal void InternalDataSet(int idx, IntPtr ele) 168 private void RequireWritable()
122 { 169 {
123 eina_array_data_set_custom_export_mono(Handle, (uint)idx, ele); // TODO: Check bounds ??? 170 if (IsReadOnly)
171 {
172 throw new NotSupportedException("This object's instance is read only.");
173 }
174 }
175
176 private void DeleteData(IntPtr ele)
177 {
178 if (OwnContent)
179 {
180 NativeFree<T>(ele);
181 }
124 } 182 }
125 183
126 /// <summary> 184 /// <summary>
@@ -156,6 +214,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
156 $"{nameof(Handle)} can't be null"); 214 $"{nameof(Handle)} can't be null");
157 Own = own; 215 Own = own;
158 OwnContent = own; 216 OwnContent = own;
217 CheckOwnerships();
159 } 218 }
160 219
161 /// <summary> 220 /// <summary>
@@ -173,6 +232,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
173 $"{nameof(Handle)} can't be null"); 232 $"{nameof(Handle)} can't be null");
174 Own = own; 233 Own = own;
175 OwnContent = ownContent; 234 OwnContent = ownContent;
235 CheckOwnerships();
176 } 236 }
177 237
178 /// <summary> 238 /// <summary>
@@ -197,15 +257,17 @@ public class Array<T> : IEnumerable<T>, IDisposable
197 return; 257 return;
198 } 258 }
199 259
200 if (Own && OwnContent) 260 for (int len = (int)eina_array_count_custom_export_mono(h),
261 i = 0; i < len; ++i)
201 { 262 {
202 int len = (int)eina_array_count_custom_export_mono(h); 263 if (!OwnContent)
203 for (int i = 0; i < len; ++i)
204 { 264 {
205 NativeFree<T>(eina_array_data_get_custom_export_mono(h, (uint)i)); 265 break;
206 } 266 }
207 }
208 267
268 DeleteData(eina_array_data_get_custom_export_mono(h, (uint)i));
269 }
270
209 if (Own) 271 if (Own)
210 { 272 {
211 if (disposing) 273 if (disposing)
@@ -236,27 +298,16 @@ public class Array<T> : IEnumerable<T>, IDisposable
236 Dispose(); 298 Dispose();
237 } 299 }
238 300
239 /// <summary>
240 /// Releases the native array.
241 /// <para>Since EFL 1.23.</para>
242 /// </summary>
243 /// <returns>The native array.</returns>
244 public IntPtr Release()
245 {
246 IntPtr h = Handle;
247 Handle = IntPtr.Zero;
248 return h;
249 }
250
251 private void FreeElementsIfOwned() 301 private void FreeElementsIfOwned()
252 { 302 {
253 if (OwnContent) 303 if (IsReadOnly)
254 { 304 {
255 int len = Length; 305 throw new NotSupportedException("This object's instance is read only.");
256 for (int i = 0; i < len; ++i) 306 }
257 { 307
258 NativeFree<T>(InternalDataGet(i)); 308 for (int i = 0, count = Count; i < count; ++i)
259 } 309 {
310 DeleteData(InternalDataGet(i));
260 } 311 }
261 } 312 }
262 313
@@ -279,26 +330,18 @@ public class Array<T> : IEnumerable<T>, IDisposable
279 eina_array_flush(Handle); 330 eina_array_flush(Handle);
280 } 331 }
281 332
282 /// <summary> 333 internal void SetOwnership(bool ownAll)
283 /// Returns the number of elements in an array.
284 /// <para>Since EFL 1.23.</para>
285 /// </summary>
286 /// <returns>The number of elements.</returns>
287 public int Count()
288 {
289 return (int)eina_array_count_custom_export_mono(Handle);
290 }
291
292 public void SetOwnership(bool ownAll)
293 { 334 {
294 Own = ownAll; 335 Own = ownAll;
295 OwnContent = ownAll; 336 OwnContent = ownAll;
337 CheckOwnerships();
296 } 338 }
297 339
298 public void SetOwnership(bool own, bool ownContent) 340 internal void SetOwnership(bool own, bool ownContent)
299 { 341 {
300 Own = own; 342 Own = own;
301 OwnContent = ownContent; 343 OwnContent = ownContent;
344 CheckOwnerships();
302 } 345 }
303 346
304 /// <summary> 347 /// <summary>
@@ -308,6 +351,8 @@ public class Array<T> : IEnumerable<T>, IDisposable
308 /// <param name="val">The value of the element to be inserted.</param> 351 /// <param name="val">The value of the element to be inserted.</param>
309 public bool Push(T val) 352 public bool Push(T val)
310 { 353 {
354 RequireWritable();
355
311 IntPtr ele = ManagedToNativeAlloc(val); 356 IntPtr ele = ManagedToNativeAlloc(val);
312 var r = InternalPush(ele); 357 var r = InternalPush(ele);
313 if (!r) 358 if (!r)
@@ -334,11 +379,13 @@ public class Array<T> : IEnumerable<T>, IDisposable
334 /// <returns>The element at the end position.</returns> 379 /// <returns>The element at the end position.</returns>
335 public T Pop() 380 public T Pop()
336 { 381 {
382 RequireWritable();
383
337 IntPtr ele = InternalPop(); 384 IntPtr ele = InternalPop();
338 var r = NativeToManaged<T>(ele); 385 var r = NativeToManaged<T>(ele);
339 if (OwnContent && ele != IntPtr.Zero) 386 if (ele != IntPtr.Zero)
340 { 387 {
341 NativeFree<T>(ele); 388 DeleteData(ele);
342 } 389 }
343 390
344 return r; 391 return r;
@@ -351,10 +398,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
351 /// <param name="idx">The position of the desired element.</param> 398 /// <param name="idx">The position of the desired element.</param>
352 /// <returns>The element at the specified position</returns> 399 /// <returns>The element at the specified position</returns>
353 public T DataGet(int idx) 400 public T DataGet(int idx)
354 { 401 => NativeToManaged<T>(InternalDataGet(idx));
355 IntPtr ele = InternalDataGet(idx);
356 return NativeToManaged<T>(ele);
357 }
358 402
359 /// <summary> 403 /// <summary>
360 /// Returns the element of the array at the specified position. 404 /// Returns the element of the array at the specified position.
@@ -363,9 +407,8 @@ public class Array<T> : IEnumerable<T>, IDisposable
363 /// <param name="idx">The position of the desired element.</param> 407 /// <param name="idx">The position of the desired element.</param>
364 /// <returns>The element at the specified position</returns> 408 /// <returns>The element at the specified position</returns>
365 public T At(int idx) 409 public T At(int idx)
366 { 410 => DataGet(idx);
367 return DataGet(idx); 411
368 }
369 412
370 /// <summary> 413 /// <summary>
371 /// Replaces the element at the specified position. 414 /// Replaces the element at the specified position.
@@ -373,16 +416,17 @@ public class Array<T> : IEnumerable<T>, IDisposable
373 /// </summary> 416 /// </summary>
374 /// <param name="idx">The position of the desired element.</param> 417 /// <param name="idx">The position of the desired element.</param>
375 /// <param name="val">The value of the element to be inserted.</param> 418 /// <param name="val">The value of the element to be inserted.</param>
376 public void DataSet(int idx, T val) 419 internal void DataSet(int idx, T val)
377 { 420 {
378 IntPtr ele = InternalDataGet(idx); // TODO: check bondaries ?? 421 RequireWritable();
379 if (OwnContent && ele != IntPtr.Zero) 422
423 IntPtr ele = InternalDataGet(idx);
424 if (ele != IntPtr.Zero)
380 { 425 {
381 NativeFree<T>(ele); 426 DeleteData(ele);
382 } 427 }
383 428
384 ele = ManagedToNativeAlloc(val); 429 InternalDataSet(idx, ManagedToNativeAlloc(val));
385 InternalDataSet(idx, ele);
386 } 430 }
387 431
388 /// <summary> 432 /// <summary>
@@ -408,7 +452,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
408 /// <returns>A array</returns> 452 /// <returns>A array</returns>
409 public T[] ToArray() 453 public T[] ToArray()
410 { 454 {
411 int len = Length; 455 int len = Count;
412 var managed = new T[len]; 456 var managed = new T[len];
413 for (int i = 0; i < len; ++i) 457 for (int i = 0; i < len; ++i)
414 { 458 {
@@ -440,17 +484,14 @@ public class Array<T> : IEnumerable<T>, IDisposable
440 /// <para>Since EFL 1.23.</para> 484 /// <para>Since EFL 1.23.</para>
441 /// </summary> 485 /// </summary>
442 public Eina.Iterator<T> GetIterator() 486 public Eina.Iterator<T> GetIterator()
443 { 487 => new Eina.Iterator<T>(eina_array_iterator_new(Handle), true);
444 return new Eina.Iterator<T>(eina_array_iterator_new(Handle), true);
445 }
446 488
447 /// <summary> Gets an Enumerator for this Array. 489 /// <summary> Gets an Enumerator for this Array.
448 /// <para>Since EFL 1.23.</para> 490 /// <para>Since EFL 1.23.</para>
449 /// </summary> 491 /// </summary>
450 public IEnumerator<T> GetEnumerator() 492 public IEnumerator<T> GetEnumerator()
451 { 493 {
452 int len = Length; 494 for (int i = 0, count = Count; i < count; ++i)
453 for (int i = 0; i < len; ++i)
454 { 495 {
455 yield return DataGet(i); 496 yield return DataGet(i);
456 } 497 }
@@ -460,16 +501,113 @@ public class Array<T> : IEnumerable<T>, IDisposable
460 /// <para>Since EFL 1.23.</para> 501 /// <para>Since EFL 1.23.</para>
461 /// </summary> 502 /// </summary>
462 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 503 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
463 { 504 => this.GetEnumerator();
464 return this.GetEnumerator();
465 }
466 505
467 /// <summary> Gets an Accessor for this Array. 506 /// <summary> Gets an Accessor for this Array.
468 /// <para>Since EFL 1.23.</para> 507 /// <para>Since EFL 1.23.</para>
469 /// </summary> 508 /// </summary>
470 public Eina.Accessor<T> GetAccessor() 509 public Eina.Accessor<T> GetAccessor()
510 => new Eina.Accessor<T>(eina_array_accessor_new(Handle), Ownership.Managed);
511
512 /// <summary>
513 /// Removes the first occurrence of a specific object.
514 /// <para>Since EFL 1.24.</para>
515 /// </summary>
516 /// <param name="val">The object to remove.</param>
517 public bool Remove(T val)
518 => LoopingThrough(val,
519 (i) =>
520 {
521 RemoveAt(i);
522 return true;
523 }, () => false);
524
525 /// <summary>
526 /// Adds an item.
527 /// <para>Since EFL 1.24.</para>
528 /// </summary>
529 /// <param name="val">The object to add.</param>
530 public void Add(T val) => Push(val);
531
532 /// <summary>
533 /// Removes all items.
534 /// <para>Since EFL 1.24.</para>
535 /// </summary>
536 public void Clear() => Clean();
537
538 /// <summary>
539 /// Determines whether the <see cref="Array{T}" /> contains a specific value.
540 /// <para>Since EFL 1.24.</para>
541 /// </summary>
542 /// <param name="val">The object to locate.</param>
543 public bool Contains(T val)
544 => LoopingThrough(val, (i) => true, () => false);
545
546 /// <summary>
547 /// Copies the elements of the <see cref="Array{T}" /> to an
548 /// <see cref="Array" />, starting at a particular <see cref="Array" /> index.
549 /// <para>Since EFL 1.24.</para>
550 /// </summary>
551 /// <param name="array">The one-dimensional <see cref="Array" /> that is the
552 /// destination of the elements copied from <see cref="Array{T}" />.
553 /// The <see cref="Array" /> must have zero-based indexing.</param>
554 /// <param name="arrayIndex">The zero-based index in array at which copying
555 /// begins.</param>
556 public void CopyTo(T[] array, int arrayIndex)
557 => ToArray().CopyTo(array, arrayIndex);
558
559 /// <summary>
560 /// Determines the index of a specific item.
561 /// <para>Since EFL 1.24.</para>
562 /// </summary>
563 /// <param name="val">The object to locate.</param>
564 public int IndexOf(T val)
565 => LoopingThrough(val, (i) => i, () => -1);
566
567 /// <summary>
568 /// Inserts an item to the <see cref="Array{T}" /> at the specified index.
569 /// <para>Since EFL 1.24.</para>
570 /// </summary>
571 /// <param name="index">The zero-based index at which item should be inserted.</param>
572 /// <param name="val">The object to insert.</param>
573 public void Insert(int index, T val)
574 {
575 RequireWritable();
576
577 if (index < 0)
578 {
579 throw new ArgumentOutOfRangeException(nameof(index), $"{nameof(index)} cannot be negative.");
580 }
581
582 if (Count < index)
583 {
584 throw new ArgumentOutOfRangeException(nameof(index), $"{nameof(index)} is greater than {nameof(Count)} + 1.");
585 }
586
587 if (index == Count)
588 {
589 Push(val);
590 return;
591 }
592
593 eina_array_insert_at_custom_export_mono(Handle, (uint)index,
594 ManagedToNativeAlloc(val));
595 }
596
597 /// <summary>
598 /// Removes the <see cref="Array{T}" /> item at the specified index.
599 /// <para>Since EFL 1.24.</para>
600 /// </summary>
601 /// <param name="index">The zero-based index of the item to remove.</param>
602 public void RemoveAt(int index)
471 { 603 {
472 return new Eina.Accessor<T>(eina_array_accessor_new(Handle), Ownership.Managed); 604 RequireWritable();
605
606 var ele = InternalDataGet(index);
607 DeleteData(ele);
608 eina_array_remove(Handle, (data,gdata)
609 => ele != data,
610 IntPtr.Zero);
473 } 611 }
474} 612}
475 613
diff --git a/src/lib/efl_mono/efl_custom_exports_mono.c b/src/lib/efl_mono/efl_custom_exports_mono.c
index ede573f875..93cfc541ea 100644
--- a/src/lib/efl_mono/efl_custom_exports_mono.c
+++ b/src/lib/efl_mono/efl_custom_exports_mono.c
@@ -294,6 +294,17 @@ EAPI Eina_Bool eina_array_foreach_custom_export_mono(Eina_Array *array, Eina_Eac
294 return eina_array_foreach(array, cb, fdata); 294 return eina_array_foreach(array, cb, fdata);
295} 295}
296 296
297EAPI void eina_array_insert_at_custom_export_mono(Eina_Array* array, unsigned int index, void* const data)
298{
299 eina_array_push(array, data);
300 for (unsigned int i = eina_array_count(array) - 1; i > index; --i)
301 {
302 void* tmp = eina_array_data_get(array, i);
303 eina_array_data_set(array, i, eina_array_data_get(array, i - 1));
304 eina_array_data_set(array, i - 1, tmp);
305 }
306}
307
297// List // 308// List //
298 309
299EAPI Eina_List *eina_list_last_custom_export_mono(const Eina_List *list) 310EAPI Eina_List *eina_list_last_custom_export_mono(const Eina_List *list)
diff --git a/src/tests/efl_mono/Array.cs b/src/tests/efl_mono/Array.cs
new file mode 100644
index 0000000000..83f9e35f18
--- /dev/null
+++ b/src/tests/efl_mono/Array.cs
@@ -0,0 +1,189 @@
1using System;
2using System.Collections.Generic;
3using System.Linq;
4
5namespace TestSuite
6{
7
8class TestArray
9{
10 public static void TestAdd()
11 {
12 IList<int> array = new Eina.Array<int>();
13 Test.AssertEquals(array.Count, 0);
14 array.Add(1);
15 Test.AssertEquals(array.Count, 1);
16 array.Add(2);
17 Test.AssertEquals(array.Count, 2);
18 }
19
20 public static void TestRemoveAt()
21 {
22 IList<int> array = new Eina.Array<int>();
23 Test.AssertEquals(array.Count, 0);
24 array.Add(1);
25 Test.AssertEquals(array.Count, 1);
26 Test.AssertEquals(array[0], 1);
27 array.RemoveAt(0);
28 Test.AssertEquals(array.Count, 0);
29 array.Add(1);
30 array.Add(0);
31 array.Add(1);
32 Test.AssertEquals(array.Count, 3);
33 Test.AssertEquals(array[2], 1);
34 array.RemoveAt(2);
35 Test.AssertEquals(array.Count, 2);
36 Test.AssertEquals(array[0], 1);
37 }
38
39 public static void TestRemove()
40 {
41 IList<int> array = new Eina.Array<int>();
42 Test.Assert(!array.Remove(0));
43 Test.AssertEquals(array.Count, 0);
44 array.Add(1);
45 Test.AssertEquals(array.Count, 1);
46 Test.Assert(array.Remove(1));
47 Test.AssertEquals(array.Count, 0);
48 array.Add(1);
49 array.Add(1);
50 Test.AssertEquals(array.Count, 2);
51 Test.Assert(array.Remove(1));
52 Test.AssertEquals(array.Count, 1);
53 array.Add(0);
54 array.Add(1);
55 Test.AssertEquals(array[1], 0);
56 Test.AssertEquals(array.Count, 3);
57 Test.Assert(!array.Remove(2));
58 Test.Assert(array.Remove(1));
59 Test.AssertEquals(array[1], 1);
60 Test.AssertEquals(array.Count, 2);
61 }
62
63 public static void TestContains()
64 {
65 IList<int> array = new Eina.Array<int>();
66 Test.AssertEquals(array.Count, 0);
67 Test.Assert(!array.Contains(0));
68 array.Add(0);
69 Test.Assert(array.Contains(0));
70 Test.Assert(array.Remove(0));
71 Test.Assert(!array.Contains(0));
72 array.Add(1);
73 array.Add(0);
74 Test.Assert(array.Contains(0));
75 }
76
77 public static void TestClear()
78 {
79 IList<int> array = new Eina.Array<int>();
80 Test.AssertEquals(array.Count, 0);
81 array.Clear();
82 Test.AssertEquals(array.Count, 0);
83 array.Add(0);
84 Test.AssertEquals(array.Count, 1);
85 array.Clear();
86 Test.AssertEquals(array.Count, 0);
87 array.Add(0);
88 array.Add(0);
89 Test.AssertEquals(array.Count, 2);
90 array.Clear();
91 Test.AssertEquals(array.Count, 0);
92 array.Add(0);
93 array.Add(0);
94 Test.AssertEquals(array.Count, 2);
95 Test.Assert(array.Remove(0));
96 Test.AssertEquals(array.Count, 1);
97 array.Clear();
98 Test.AssertEquals(array.Count, 0);
99 }
100
101 public static void TestInsert()
102 {
103 IList<int> array = new Eina.Array<int>();
104 array.Add(99);
105 Test.AssertEquals(array.Count, 1);
106 array.Insert(0, 6);
107 Test.AssertEquals(array.Count, 2);
108 Test.AssertEquals(array[0], 6);
109 array.Insert(1, 5);
110 Test.AssertEquals(array.Count, 3);
111 Test.AssertEquals(array[1], 5);
112 array.Insert(1, 10);
113 Test.AssertEquals(array.Count, 4);
114 Test.AssertEquals(array[1], 10);
115 array.RemoveAt(1);
116 Test.AssertEquals(array.Count, 3);
117 Test.AssertEquals(array[1], 5);
118 array.Insert(1, 42);
119 Test.AssertEquals(array.Count, 4);
120 Test.AssertEquals(array[1], 42);
121 }
122
123 public static void TestIndexOf()
124 {
125 IList<int> array = new Eina.Array<int>();
126 Test.AssertEquals(array.Count, 0);
127 array.Add(1);
128 Test.AssertEquals(array.Count, 1);
129 Test.AssertEquals(0, array.IndexOf(1));
130 array.Insert(0, 0);
131 Test.AssertEquals(array.Count, 2);
132 Test.AssertEquals(0, array.IndexOf(0));
133 Test.AssertEquals(1, array.IndexOf(1));
134 array.Insert(0, 1);
135 Test.AssertEquals(array.Count, 3);
136 Test.AssertEquals(0, array.IndexOf(1));
137 Test.AssertEquals(1, array.IndexOf(0));
138 array.Insert(0, 1);
139 Test.AssertEquals(array.Count, 4);
140 Test.AssertEquals(0, array.IndexOf(1));
141 Test.AssertEquals(2, array.IndexOf(0));
142 }
143
144 public static void TestCopyTo()
145 {
146 IList<int> array = new Eina.Array<int>();
147 Test.AssertEquals(array.Count, 0);
148 int[] random = {4, 40, 10, 42, 99};
149 array.Add(43);
150 array.Insert(0, 1);
151 array.Insert(1, 50);
152 Test.AssertEquals(array.Count, 3);
153 Array.ForEach(random, (n) => array.Add(n));
154 Test.AssertEquals(array.Count, 8);
155 int[] expected = {1, 50, 43, 4, 40, 10, 42, 99};
156 var result = new int[expected.Length];
157 array.CopyTo(result, 0);
158 for (int i = 0; i < expected.Length; ++i)
159 {
160 Test.AssertEquals(expected[i], result[i]);
161 }
162 }
163
164 public static void TestIdxOutBounds()
165 {
166 var array = new Eina.Array<int>();
167 array.Add(4);
168 Test.AssertRaises<ArgumentOutOfRangeException>(()=>array.At(1));
169 Test.AssertRaises<ArgumentOutOfRangeException>(()=>array.At(-1));
170 Test.AssertNotRaises<ArgumentOutOfRangeException>
171 (()=>array.At(array.IndexOf(4)));
172 }
173
174 public static void TestIsReadOnly()
175 {
176 var array = new Eina.Array<int>();
177 int[] tmp = {1, 3, 2, 6 ,5};
178 array.Append(tmp);
179 Test.AssertEquals(array.Count, 5);
180 array.SetOwnership(false);
181 Test.AssertRaises<NotSupportedException>(() => array.Add(4));
182 Test.AssertRaises<NotSupportedException>(() => array.Push(6));
183 Test.AssertRaises<NotSupportedException>(() => array.Append(tmp));
184 Test.AssertEquals(array.Count, 5);
185 Test.AssertRaises<NotSupportedException>(() => array.DataSet(2, 4));
186 Test.Assert(array.ToArray().SequenceEqual(tmp));
187 }
188}
189}
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index 638a65ce58..91e93986ff 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -787,16 +787,16 @@ class TestEinaArray
787 { 787 {
788 var a = new Eina.Array<int>(); 788 var a = new Eina.Array<int>();
789 Test.Assert(a.Handle != IntPtr.Zero); 789 Test.Assert(a.Handle != IntPtr.Zero);
790 Test.Assert(a.Length == 0); 790 Test.Assert(a.Count == 0);
791 Test.Assert(a.Push(88)); 791 Test.Assert(a.Push(88));
792 Test.Assert(a[0] == 88); 792 Test.Assert(a[0] == 88);
793 Test.Assert(a.Length == 1); 793 Test.Assert(a.Count == 1);
794 Test.Assert(a.Push(44)); 794 Test.Assert(a.Push(44));
795 Test.Assert(a[1] == 44); 795 Test.Assert(a[1] == 44);
796 Test.Assert(a.Length == 2); 796 Test.Assert(a.Count == 2);
797 Test.Assert(a.Push(22)); 797 Test.Assert(a.Push(22));
798 Test.Assert(a[2] == 22); 798 Test.Assert(a[2] == 22);
799 Test.Assert(a.Length == 3); 799 Test.Assert(a.Count == 3);
800 a.Dispose(); 800 a.Dispose();
801 } 801 }
802 802
@@ -804,16 +804,16 @@ class TestEinaArray
804 { 804 {
805 var a = new Eina.Array<string>(); 805 var a = new Eina.Array<string>();
806 Test.Assert(a.Handle != IntPtr.Zero); 806 Test.Assert(a.Handle != IntPtr.Zero);
807 Test.Assert(a.Length == 0); 807 Test.Assert(a.Count == 0);
808 Test.Assert(a.Push("a")); 808 Test.Assert(a.Push("a"));
809 Test.Assert(a[0] == "a"); 809 Test.Assert(a[0] == "a");
810 Test.Assert(a.Length == 1); 810 Test.Assert(a.Count == 1);
811 Test.Assert(a.Push("b")); 811 Test.Assert(a.Push("b"));
812 Test.Assert(a[1] == "b"); 812 Test.Assert(a[1] == "b");
813 Test.Assert(a.Length == 2); 813 Test.Assert(a.Count == 2);
814 Test.Assert(a.Push("c")); 814 Test.Assert(a.Push("c"));
815 Test.Assert(a[2] == "c"); 815 Test.Assert(a[2] == "c");
816 Test.Assert(a.Length == 3); 816 Test.Assert(a.Count == 3);
817 a.Dispose(); 817 a.Dispose();
818 } 818 }
819 819
@@ -821,16 +821,16 @@ class TestEinaArray
821 { 821 {
822 var a = new Eina.Array<Eina.Stringshare>(); 822 var a = new Eina.Array<Eina.Stringshare>();
823 Test.Assert(a.Handle != IntPtr.Zero); 823 Test.Assert(a.Handle != IntPtr.Zero);
824 Test.Assert(a.Length == 0); 824 Test.Assert(a.Count == 0);
825 Test.Assert(a.Push("a")); 825 Test.Assert(a.Push("a"));
826 Test.Assert(a[0] == "a"); 826 Test.Assert(a[0] == "a");
827 Test.Assert(a.Length == 1); 827 Test.Assert(a.Count == 1);
828 Test.Assert(a.Push("b")); 828 Test.Assert(a.Push("b"));
829 Test.Assert(a[1] == "b"); 829 Test.Assert(a[1] == "b");
830 Test.Assert(a.Length == 2); 830 Test.Assert(a.Count == 2);
831 Test.Assert(a.Push("c")); 831 Test.Assert(a.Push("c"));
832 Test.Assert(a[2] == "c"); 832 Test.Assert(a[2] == "c");
833 Test.Assert(a.Length == 3); 833 Test.Assert(a.Count == 3);
834 a.Dispose(); 834 a.Dispose();
835 } 835 }
836 836
@@ -951,7 +951,7 @@ class TestEinaArray
951 Test.Assert(t.EinaArrayIntOut(out arr)); 951 Test.Assert(t.EinaArrayIntOut(out arr));
952 Test.Assert(!arr.Own); 952 Test.Assert(!arr.Own);
953 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int)); 953 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
954 Test.Assert(arr.Append(append_seq_int)); 954 Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_int));
955 arr.Dispose(); 955 arr.Dispose();
956 Test.Assert(arr.Handle == IntPtr.Zero); 956 Test.Assert(arr.Handle == IntPtr.Zero);
957 Test.Assert(t.CheckEinaArrayIntOut()); 957 Test.Assert(t.CheckEinaArrayIntOut());
@@ -976,8 +976,9 @@ class TestEinaArray
976 var t = new Dummy.TestObject(); 976 var t = new Dummy.TestObject();
977 var arr = t.EinaArrayIntReturn(); 977 var arr = t.EinaArrayIntReturn();
978 Test.Assert(!arr.Own); 978 Test.Assert(!arr.Own);
979 Test.Assert(!arr.OwnContent);
979 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int)); 980 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
980 Test.Assert(arr.Append(append_seq_int)); 981 Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_int));
981 arr.Dispose(); 982 arr.Dispose();
982 Test.Assert(arr.Handle == IntPtr.Zero); 983 Test.Assert(arr.Handle == IntPtr.Zero);
983 Test.Assert(t.CheckEinaArrayIntReturn()); 984 Test.Assert(t.CheckEinaArrayIntReturn());
@@ -1031,7 +1032,7 @@ class TestEinaArray
1031 Test.Assert(t.EinaArrayStrOut(out arr)); 1032 Test.Assert(t.EinaArrayStrOut(out arr));
1032 Test.Assert(!arr.Own); 1033 Test.Assert(!arr.Own);
1033 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str)); 1034 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
1034 Test.Assert(arr.Append(append_seq_str)); 1035 Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_str));
1035 arr.Dispose(); 1036 arr.Dispose();
1036 Test.Assert(arr.Handle == IntPtr.Zero); 1037 Test.Assert(arr.Handle == IntPtr.Zero);
1037 Test.Assert(t.CheckEinaArrayStrOut()); 1038 Test.Assert(t.CheckEinaArrayStrOut());
@@ -1057,7 +1058,7 @@ class TestEinaArray
1057 var arr = t.EinaArrayStrReturn(); 1058 var arr = t.EinaArrayStrReturn();
1058 Test.Assert(!arr.Own); 1059 Test.Assert(!arr.Own);
1059 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str)); 1060 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
1060 Test.Assert(arr.Append(append_seq_str)); 1061 Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_str));
1061 arr.Dispose(); 1062 arr.Dispose();
1062 Test.Assert(arr.Handle == IntPtr.Zero); 1063 Test.Assert(arr.Handle == IntPtr.Zero);
1063 Test.Assert(t.CheckEinaArrayStrReturn()); 1064 Test.Assert(t.CheckEinaArrayStrReturn());
@@ -1111,7 +1112,7 @@ class TestEinaArray
1111 Test.Assert(t.EinaArrayStrshareOut(out arr)); 1112 Test.Assert(t.EinaArrayStrshareOut(out arr));
1112 Test.Assert(!arr.Own); 1113 Test.Assert(!arr.Own);
1113 Test.Assert(arr.ToArray().SequenceEqual(base_seq_strshare)); 1114 Test.Assert(arr.ToArray().SequenceEqual(base_seq_strshare));
1114 Test.Assert(arr.Append(append_seq_strshare)); 1115 Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_strshare));
1115 arr.Dispose(); 1116 arr.Dispose();
1116 Test.Assert(arr.Handle == IntPtr.Zero); 1117 Test.Assert(arr.Handle == IntPtr.Zero);
1117 Test.Assert(t.CheckEinaArrayStrshareOut()); 1118 Test.Assert(t.CheckEinaArrayStrshareOut());
@@ -1137,7 +1138,7 @@ class TestEinaArray
1137 var arr = t.EinaArrayStrshareReturn(); 1138 var arr = t.EinaArrayStrshareReturn();
1138 Test.Assert(!arr.Own); 1139 Test.Assert(!arr.Own);
1139 Test.Assert(arr.ToArray().SequenceEqual(base_seq_strshare)); 1140 Test.Assert(arr.ToArray().SequenceEqual(base_seq_strshare));
1140 Test.Assert(arr.Append(append_seq_strshare)); 1141 Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_strshare));
1141 arr.Dispose(); 1142 arr.Dispose();
1142 Test.Assert(arr.Handle == IntPtr.Zero); 1143 Test.Assert(arr.Handle == IntPtr.Zero);
1143 Test.Assert(t.CheckEinaArrayStrshareReturn()); 1144 Test.Assert(t.CheckEinaArrayStrshareReturn());
@@ -1192,7 +1193,7 @@ class TestEinaArray
1192 Test.Assert(t.EinaArrayObjOut(out arr)); 1193 Test.Assert(t.EinaArrayObjOut(out arr));
1193 Test.Assert(!arr.Own); 1194 Test.Assert(!arr.Own);
1194 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj()); 1195 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
1195 Test.Assert(arr.Append(AppendSeqObj())); 1196 Test.AssertRaises<NotSupportedException>(() => arr.Append(AppendSeqObj()));
1196 arr.Dispose(); 1197 arr.Dispose();
1197 Test.Assert(arr.Handle == IntPtr.Zero); 1198 Test.Assert(arr.Handle == IntPtr.Zero);
1198 Test.Assert(t.CheckEinaArrayObjOut()); 1199 Test.Assert(t.CheckEinaArrayObjOut());
@@ -1218,7 +1219,7 @@ class TestEinaArray
1218 var arr = t.EinaArrayObjReturn(); 1219 var arr = t.EinaArrayObjReturn();
1219 Test.Assert(!arr.Own); 1220 Test.Assert(!arr.Own);
1220 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj()); 1221 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
1221 Test.Assert(arr.Append(AppendSeqObj())); 1222 Test.AssertRaises<NotSupportedException>(() => arr.Append(AppendSeqObj()));
1222 arr.Dispose(); 1223 arr.Dispose();
1223 Test.Assert(arr.Handle == IntPtr.Zero); 1224 Test.Assert(arr.Handle == IntPtr.Zero);
1224 Test.Assert(t.CheckEinaArrayObjReturn()); 1225 Test.Assert(t.CheckEinaArrayObjReturn());
@@ -1246,7 +1247,7 @@ class TestEinaArray
1246 var b = t.EinaArrayObjReturnIn(a); 1247 var b = t.EinaArrayObjReturnIn(a);
1247 NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray()); 1248 NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
1248 NumberwrapperSequenceAssertEqual(a.ToArray(), BaseSeqObj()); 1249 NumberwrapperSequenceAssertEqual(a.ToArray(), BaseSeqObj());
1249 int len = a.Length; 1250 int len = a.Count;
1250 for (int i=0; i < len; ++i) 1251 for (int i=0; i < len; ++i)
1251 { 1252 {
1252 Test.Assert(a[i].NativeHandle == b[i].NativeHandle); 1253 Test.Assert(a[i].NativeHandle == b[i].NativeHandle);
diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs
index 88a7e8b1e1..824d9a132c 100644
--- a/src/tests/efl_mono/Events.cs
+++ b/src/tests/efl_mono/Events.cs
@@ -239,7 +239,7 @@ class TestEoEvents
239 239
240 obj.EmitEventWithArray(sent); 240 obj.EmitEventWithArray(sent);
241 241
242 Test.AssertEquals(sent.Length, received.Length); 242 Test.AssertEquals(sent.Count, received.Count);
243 var pairs = sent.Zip(received, (string sentItem, string receivedItem) => new { Sent = sentItem, Received = receivedItem } ); 243 var pairs = sent.Zip(received, (string sentItem, string receivedItem) => new { Sent = sentItem, Received = receivedItem } );
244 foreach (var pair in pairs) 244 foreach (var pair in pairs)
245 { 245 {
diff --git a/src/tests/efl_mono/dummy_test_object.c b/src/tests/efl_mono/dummy_test_object.c
index d9ab519d0a..b87aff1cd4 100644
--- a/src/tests/efl_mono/dummy_test_object.c
+++ b/src/tests/efl_mono/dummy_test_object.c
@@ -579,7 +579,7 @@ Eina_Bool _dummy_test_object_check_eina_array_int_out(EINA_UNUSED Eo *obj, EINA_
579{ 579{
580 if (!_array_int_out_to_check) return EINA_FALSE; 580 if (!_array_int_out_to_check) return EINA_FALSE;
581 581
582 Eina_Bool r = _array_int_equal(_array_int_out_to_check, modified_seq_int, modified_seq_int_size); 582 Eina_Bool r = _array_int_equal(_array_int_out_to_check, base_seq_int, base_seq_int_size);
583 583
584 unsigned int i; 584 unsigned int i;
585 int *ele; 585 int *ele;
@@ -617,7 +617,7 @@ Eina_Bool _dummy_test_object_check_eina_array_int_return(EINA_UNUSED Eo *obj, EI
617{ 617{
618 if (!_array_int_return_to_check) return EINA_FALSE; 618 if (!_array_int_return_to_check) return EINA_FALSE;
619 619
620 Eina_Bool r = _array_int_equal(_array_int_return_to_check, modified_seq_int, modified_seq_int_size); 620 Eina_Bool r = _array_int_equal(_array_int_return_to_check, base_seq_int, base_seq_int_size);
621 621
622 unsigned int i; 622 unsigned int i;
623 int *ele; 623 int *ele;
@@ -707,7 +707,7 @@ Eina_Bool _dummy_test_object_check_eina_array_str_out(EINA_UNUSED Eo *obj, EINA_
707{ 707{
708 if (!_array_str_out_to_check) return EINA_FALSE; 708 if (!_array_str_out_to_check) return EINA_FALSE;
709 709
710 Eina_Bool r = _array_str_equal(_array_str_out_to_check, modified_seq_str, modified_seq_str_size); 710 Eina_Bool r = _array_str_equal(_array_str_out_to_check, base_seq_str, base_seq_str_size);
711 711
712 unsigned int i; 712 unsigned int i;
713 char *ele; 713 char *ele;
@@ -745,7 +745,7 @@ Eina_Bool _dummy_test_object_check_eina_array_str_return(EINA_UNUSED Eo *obj, EI
745{ 745{
746 if (!_array_str_return_to_check) return EINA_FALSE; 746 if (!_array_str_return_to_check) return EINA_FALSE;
747 747
748 Eina_Bool r = _array_str_equal(_array_str_return_to_check, modified_seq_str, modified_seq_str_size); 748 Eina_Bool r = _array_str_equal(_array_str_return_to_check, base_seq_str,base_seq_str_size);
749 749
750 unsigned int i; 750 unsigned int i;
751 char *ele; 751 char *ele;
@@ -840,7 +840,7 @@ Eina_Bool _dummy_test_object_check_eina_array_strshare_out(EINA_UNUSED Eo *obj,
840{ 840{
841 if (!_array_strshare_out_to_check) return EINA_FALSE; 841 if (!_array_strshare_out_to_check) return EINA_FALSE;
842 842
843 Eina_Bool r = _array_strshare_equal(_array_strshare_out_to_check, modified_seq_str, modified_seq_str_size); 843 Eina_Bool r = _array_strshare_equal(_array_strshare_out_to_check, base_seq_str, base_seq_str_size);
844 844
845 unsigned int i; 845 unsigned int i;
846 Eina_Stringshare *ele; 846 Eina_Stringshare *ele;
@@ -878,7 +878,7 @@ Eina_Bool _dummy_test_object_check_eina_array_strshare_return(EINA_UNUSED Eo *ob
878{ 878{
879 if (!_array_strshare_return_to_check) return EINA_FALSE; 879 if (!_array_strshare_return_to_check) return EINA_FALSE;
880 880
881 Eina_Bool r = _array_strshare_equal(_array_strshare_return_to_check, modified_seq_str, modified_seq_str_size); 881 Eina_Bool r = _array_strshare_equal(_array_strshare_return_to_check, base_seq_str, base_seq_str_size);
882 882
883 unsigned int i; 883 unsigned int i;
884 Eina_Stringshare *ele; 884 Eina_Stringshare *ele;
@@ -974,7 +974,7 @@ Eina_Bool _dummy_test_object_check_eina_array_obj_out(EINA_UNUSED Eo *obj, EINA_
974{ 974{
975 if (!_array_obj_out_to_check) return EINA_FALSE; 975 if (!_array_obj_out_to_check) return EINA_FALSE;
976 976
977 Eina_Bool r = _array_obj_equal(_array_obj_out_to_check, modified_seq_obj, modified_seq_obj_size); 977 Eina_Bool r = _array_obj_equal(_array_obj_out_to_check, base_seq_obj, base_seq_obj_size);
978 if (!r) return r; 978 if (!r) return r;
979 979
980 unsigned int i; 980 unsigned int i;
@@ -1013,7 +1013,7 @@ Eina_Bool _dummy_test_object_check_eina_array_obj_return(EINA_UNUSED Eo *obj, EI
1013{ 1013{
1014 if (!_array_obj_return_to_check) return EINA_FALSE; 1014 if (!_array_obj_return_to_check) return EINA_FALSE;
1015 1015
1016 Eina_Bool r = _array_obj_equal(_array_obj_return_to_check, modified_seq_obj, modified_seq_obj_size); 1016 Eina_Bool r = _array_obj_equal(_array_obj_return_to_check, base_seq_obj, base_seq_obj_size);
1017 if (!r) return r; 1017 if (!r) return r;
1018 1018
1019 unsigned int i; 1019 unsigned int i;
diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build
index 54ddb64274..2bba162a5c 100644
--- a/src/tests/efl_mono/meson.build
+++ b/src/tests/efl_mono/meson.build
@@ -83,6 +83,7 @@ efl_mono_src = [
83 'Inheritance.cs', 83 'Inheritance.cs',
84 'Hash.cs', 84 'Hash.cs',
85 'List.cs', 85 'List.cs',
86 'Array.cs',
86] 87]
87 88
88if get_option('dotnet') 89if get_option('dotnet')