summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/EinaTestData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/efl_mono/EinaTestData.cs')
-rw-r--r--src/tests/efl_mono/EinaTestData.cs64
1 files changed, 39 insertions, 25 deletions
diff --git a/src/tests/efl_mono/EinaTestData.cs b/src/tests/efl_mono/EinaTestData.cs
index b64040d..5b8c84d 100644
--- a/src/tests/efl_mono/EinaTestData.cs
+++ b/src/tests/efl_mono/EinaTestData.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using System; 16using System;
2using System.Linq; 17using System.Linq;
3using System.Runtime.InteropServices; 18using System.Runtime.InteropServices;
@@ -8,25 +23,26 @@ namespace EinaTestData
8 23
9class BaseSequence 24class BaseSequence
10{ 25{
11 public static byte[] Values() 26 public static byte[] Values() => new byte[3]{0x0, 0x2A, 0x42};
12 {
13 return new byte[3]{0x0,0x2A,0x42};
14 }
15} 27}
16 28
17public static class BaseData 29public static class BaseData
18{ 30{
19 public static readonly int[] base_seq_int = {0x0,0x2A,0x42}; 31 public static readonly int[] base_seq_int = {0x0, 0x2A, 0x42};
20 public static readonly int[] append_seq_int = {42,43,33}; 32 public static readonly int[] append_seq_int = {42, 43, 33};
21 public static readonly int[] modified_seq_int = {0x0,0x2A,0x42,42,43,33}; 33 public static readonly int[] modified_seq_int = {0x0, 0x2A, 0x42, 42, 43, 33};
22 34
23 public static readonly string[] base_seq_str = {"0x0","0x2A","0x42"}; 35 public static readonly string[] base_seq_str = {"0x0", "0x2A", "0x42"};
24 public static readonly string[] append_seq_str = {"42","43","33"}; 36 public static readonly string[] append_seq_str = {"42", "43", "33"};
25 public static readonly string[] modified_seq_str = {"0x0","0x2A","0x42","42","43","33"}; 37 public static readonly string[] modified_seq_str = {"0x0", "0x2A", "0x42",
26 38 "42", "43", "33"};
27 public static readonly Eina.Stringshare[] base_seq_strshare = {"0x0","0x2A","0x42"}; 39
28 public static readonly Eina.Stringshare[] append_seq_strshare = {"42","43","33"}; 40 public static readonly Eina.Stringshare[] base_seq_strshare = {"0x0", "0x2A",
29 public static readonly Eina.Stringshare[] modified_seq_strshare = {"0x0","0x2A","0x42","42","43","33"}; 41 "0x42"};
42 public static readonly Eina.Stringshare[] append_seq_strshare = {"42", "43",
43 "33"};
44 public static readonly Eina.Stringshare[] modified_seq_strshare = {
45 "0x0", "0x2A", "0x42", "42", "43", "33"};
30 46
31 public static Dummy.Numberwrapper NW(int n) 47 public static Dummy.Numberwrapper NW(int n)
32 { 48 {
@@ -43,7 +59,7 @@ public static class BaseData
43 a.SetNumber(0x0); 59 a.SetNumber(0x0);
44 b.SetNumber(0x2A); 60 b.SetNumber(0x2A);
45 c.SetNumber(0x42); 61 c.SetNumber(0x42);
46 return new Dummy.Numberwrapper[]{a,b,c}; 62 return new Dummy.Numberwrapper[]{a, b, c};
47 } 63 }
48 64
49 public static Dummy.Numberwrapper[] AppendSeqObj() 65 public static Dummy.Numberwrapper[] AppendSeqObj()
@@ -54,7 +70,7 @@ public static class BaseData
54 a.SetNumber(42); 70 a.SetNumber(42);
55 b.SetNumber(43); 71 b.SetNumber(43);
56 c.SetNumber(33); 72 c.SetNumber(33);
57 return new Dummy.Numberwrapper[]{a,b,c}; 73 return new Dummy.Numberwrapper[]{a, b, c};
58 } 74 }
59 75
60 public static Dummy.Numberwrapper[] ModifiedSeqObj() 76 public static Dummy.Numberwrapper[] ModifiedSeqObj()
@@ -71,16 +87,14 @@ public static class BaseData
71 d.SetNumber(42); 87 d.SetNumber(42);
72 e.SetNumber(43); 88 e.SetNumber(43);
73 f.SetNumber(33); 89 f.SetNumber(33);
74 return new Dummy.Numberwrapper[]{a,b,c,d,e,f}; 90 return new Dummy.Numberwrapper[]{a, b, c, d, e, f};
75 } 91 }
76 92
77 public static void NumberwrapperSequenceAssertEqual( 93 public static void NumberwrapperSequenceAssertEqual(
78 Dummy.Numberwrapper[] a 94 Dummy.Numberwrapper[] a, Dummy.Numberwrapper[] b,
79 , Dummy.Numberwrapper[] b 95 [ CallerLineNumber ] int line = 0,
80 , [CallerLineNumber] int line = 0 96 [ CallerFilePath ] string file = null,
81 , [CallerFilePath] string file = null 97 [ CallerMemberName ] string member = null) {
82 , [CallerMemberName] string member = null)
83 {
84 Test.Assert(a.Length == b.Length, "Different lenght", line, file, member); 98 Test.Assert(a.Length == b.Length, "Different lenght", line, file, member);
85 for (int i = 0; i < a.Length; ++i) 99 for (int i = 0; i < a.Length; ++i)
86 { 100 {
@@ -186,7 +200,7 @@ class NativeInheritImpl : Dummy.TestObject
186 } 200 }
187 public bool binbuf_in_own_still_usable() 201 public bool binbuf_in_own_still_usable()
188 { 202 {
189 bool r = binbuf_in_own_binbuf.GetBytes().SequenceEqual(new byte[]{43,42,0x0,0x2A,0x42,33}); 203 bool r = binbuf_in_own_binbuf.GetBytes().SequenceEqual(new byte[]{43, 42, 0x0, 0x2A, 0x42, 33});
190 r = r && binbuf_in_own_binbuf.Own; 204 r = r && binbuf_in_own_binbuf.Own;
191 205
192 binbuf_in_own_binbuf.Dispose(); 206 binbuf_in_own_binbuf.Dispose();