summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/ValueEolian.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/efl_mono/ValueEolian.cs')
-rw-r--r--src/tests/efl_mono/ValueEolian.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/efl_mono/ValueEolian.cs b/src/tests/efl_mono/ValueEolian.cs
index 97baf95..77ec4ac 100644
--- a/src/tests/efl_mono/ValueEolian.cs
+++ b/src/tests/efl_mono/ValueEolian.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 */
1#define CODE_ANALYSIS 16#define CODE_ANALYSIS
2 17
3// Disable warning about missing docs when generating docs 18// Disable warning about missing docs when generating docs
@@ -23,6 +38,7 @@ public static class TestEinaValueEolian {
23 Test.AssertEquals(v, v_received); 38 Test.AssertEquals(v, v_received);
24 v_received.Dispose(); 39 v_received.Dispose();
25 } 40 }
41 obj.Dispose();
26 } 42 }
27 43
28 public static void TestEolianEinaValueInOwn() 44 public static void TestEolianEinaValueInOwn()
@@ -43,6 +59,7 @@ public static class TestEinaValueEolian {
43 59
44 obj.ClearValue(); 60 obj.ClearValue();
45 } 61 }
62 obj.Dispose();
46 } 63 }
47 64
48 public static void TestEolianEinaValueOut() 65 public static void TestEolianEinaValueOut()
@@ -58,7 +75,9 @@ public static class TestEinaValueEolian {
58 75
59 Test.AssertEquals(v, v_out); 76 Test.AssertEquals(v, v_out);
60 Test.AssertEquals(Eina.Ownership.Unmanaged, v_out.Ownership); 77 Test.AssertEquals(Eina.Ownership.Unmanaged, v_out.Ownership);
78 v_out.Dispose();
61 } 79 }
80 obj.Dispose();
62 } 81 }
63 82
64 public static void TestEolianEinaValueOutOwn() 83 public static void TestEolianEinaValueOutOwn()
@@ -74,7 +93,9 @@ public static class TestEinaValueEolian {
74 93
75 Test.AssertEquals(v, v_out); 94 Test.AssertEquals(v, v_out);
76 Test.AssertEquals(Eina.Ownership.Managed, v_out.Ownership); 95 Test.AssertEquals(Eina.Ownership.Managed, v_out.Ownership);
96 v_out.Dispose();
77 } 97 }
98 obj.Dispose();
78 } 99 }
79 100
80 public static void TestEolianEinaValueOutByValue() 101 public static void TestEolianEinaValueOutByValue()
@@ -90,7 +111,9 @@ public static class TestEinaValueEolian {
90 111
91 Test.AssertEquals(v, v_out); 112 Test.AssertEquals(v, v_out);
92 Test.AssertEquals(Eina.Ownership.Managed, v_out.Ownership); 113 Test.AssertEquals(Eina.Ownership.Managed, v_out.Ownership);
114 v_out.Dispose();
93 } 115 }
116 obj.Dispose();
94 } 117 }
95 118
96 private class ValueHandler : Dummy.TestObject 119 private class ValueHandler : Dummy.TestObject
@@ -115,6 +138,7 @@ public static class TestEinaValueEolian {
115 obj.CallSetValue(val); 138 obj.CallSetValue(val);
116 Test.AssertEquals(val, obj.value); 139 Test.AssertEquals(val, obj.value);
117 } 140 }
141 obj.Dispose();
118 } 142 }
119 143
120 public static void TestEolianEinaValueImplicitOperators() 144 public static void TestEolianEinaValueImplicitOperators()
@@ -126,6 +150,7 @@ public static class TestEinaValueEolian {
126 var expected = new Eina.Value(1999); 150 var expected = new Eina.Value(1999);
127 var received = new Eina.Value(Eina.ValueType.String); 151 var received = new Eina.Value(Eina.ValueType.String);
128 152
153 received.Dispose();
129 obj.OutValue(out received); 154 obj.OutValue(out received);
130 Test.AssertEquals(expected, received); 155 Test.AssertEquals(expected, received);
131 Test.AssertEquals(Eina.ValueType.Int32, received.GetValueType()); 156 Test.AssertEquals(Eina.ValueType.Int32, received.GetValueType());
@@ -133,6 +158,7 @@ public static class TestEinaValueEolian {
133 int i = received; 158 int i = received;
134 Test.AssertEquals(i, 1999); 159 Test.AssertEquals(i, 1999);
135 160
161 expected.Dispose();
136 expected = new Eina.Value("Hallo"); 162 expected = new Eina.Value("Hallo");
137 obj.SetValue("Hallo"); 163 obj.SetValue("Hallo");
138 164
@@ -144,9 +170,11 @@ public static class TestEinaValueEolian {
144 Test.AssertEquals(s, "Hallo"); 170 Test.AssertEquals(s, "Hallo");
145 171
146 // Casting 172 // Casting
173 expected.Dispose();
147 expected = new Eina.Value((double)15); 174 expected = new Eina.Value((double)15);
148 obj.SetValue((double)15); 175 obj.SetValue((double)15);
149 176
177 received.Dispose();
150 obj.OutValue(out received); 178 obj.OutValue(out received);
151 Test.AssertEquals(expected, received); 179 Test.AssertEquals(expected, received);
152 Test.AssertEquals(Eina.ValueType.Double, received.GetValueType()); 180 Test.AssertEquals(Eina.ValueType.Double, received.GetValueType());
@@ -154,11 +182,16 @@ public static class TestEinaValueEolian {
154 // Check for 0 182 // Check for 0
155 // This is a special value, since C# can silently convert it to an enum 183 // This is a special value, since C# can silently convert it to an enum
156 // leading to collisions with Eina.ValueType 184 // leading to collisions with Eina.ValueType
185 expected.Dispose();
157 expected = new Eina.Value(0); 186 expected = new Eina.Value(0);
158 obj.SetValue(0); 187 obj.SetValue(0);
188 received.Dispose();
159 obj.OutValue(out received); 189 obj.OutValue(out received);
160 Test.AssertEquals(expected, received); 190 Test.AssertEquals(expected, received);
161 Test.AssertEquals(Eina.ValueType.Int32, received.GetValueType()); 191 Test.AssertEquals(Eina.ValueType.Int32, received.GetValueType());
192 expected.Dispose();
193 received.Dispose();
194 obj.Dispose();
162 } 195 }
163 196
164// ValueType in eolian context is beta, so not allowed. 197// ValueType in eolian context is beta, so not allowed.
@@ -173,6 +206,7 @@ public static class TestEinaValueEolian {
173 { 206 {
174 Test.AssertEquals(type, obj.MirrorValueType(type)); 207 Test.AssertEquals(type, obj.MirrorValueType(type));
175 } 208 }
209 obj.Dispose();
176 } 210 }
177#endif 211#endif
178} 212}