summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Eo.cs
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-02-01 14:03:02 -0500
committerChristopher Michael <cp.michael@samsung.com>2019-02-01 14:03:02 -0500
commit0223bb29dfc4c1621ace044395196064c82b98de (patch)
treefc42c91c0461472391960afd14f232f941911f02 /src/tests/efl_mono/Eo.cs
parente4144504048ff2c9a3c1787b82c73a54e8d209a7 (diff)
eolian-mono: Provide constructor parameters based on the constructors
section of the Eo files. Reviewers: woohyun, segfaultxavi, bu5hm4n, felipealmeida Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7789
Diffstat (limited to 'src/tests/efl_mono/Eo.cs')
-rw-r--r--src/tests/efl_mono/Eo.cs63
1 files changed, 26 insertions, 37 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 5567f1ef33..37d4735b90 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -114,43 +114,6 @@ class TestEoNames
114 } 114 }
115} 115}
116 116
117class TestEoConstructingMethods
118{
119 public static void constructing_method()
120 {
121 bool called = false;
122 string name = "Test object";
123 var obj = new Dummy.TestObject(null, (Dummy.TestObject a) => {
124 called = true;
125 Console.WriteLine("callback: obj NativeHandle: {0:x}", a.NativeHandle);
126 a.SetName(name);
127 });
128
129 Test.Assert(called);
130 Test.AssertEquals(name, obj.GetName());
131 }
132
133 private class Derived : Dummy.TestObject
134 {
135 public Derived(Dummy.TestObject parent = null,
136 Dummy.TestObject.ConstructingMethod cb = null) : base(parent, cb) {
137 }
138 }
139
140 public static void constructing_method_inherit()
141 {
142 bool called = false;
143 string name = "Another test object";
144 Derived obj = new Derived(null, (Dummy.TestObject a) => {
145 called = true;
146 a.SetComment(name);
147 });
148
149 Test.Assert(called);
150 Test.AssertEquals(name, obj.GetComment());
151 }
152}
153
154class TestEoParent 117class TestEoParent
155{ 118{
156 public static void basic_parent() 119 public static void basic_parent()
@@ -365,6 +328,9 @@ class TestEoGrandChildrenFinalize
365 328
366 public sealed class GrandChild : Dummy.Child 329 public sealed class GrandChild : Dummy.Child
367 { 330 {
331
332 public GrandChild() : base(null, "", 0.0) { }
333
368 public int receivedValue = 0; 334 public int receivedValue = 0;
369 public override Efl.Object FinalizeAdd() 335 public override Efl.Object FinalizeAdd()
370 { 336 {
@@ -380,4 +346,27 @@ class TestEoGrandChildrenFinalize
380 } 346 }
381} 347}
382 348
349class TestConstructors
350{
351 public static void test_simple_constructor()
352 {
353 int iface_prop = 42;
354 string a = "LFE";
355 double b = 3.14;
356 var obj = new Dummy.Child(null, a, b, iface_prop);
357 Test.AssertEquals(iface_prop, obj.IfaceProp);
358
359 obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b);
360 Test.AssertEquals(iface_prop, obj.IfaceProp);
361 }
362
363 public static void test_optional_constructor()
364 {
365 string a = "LFE";
366 double b = 3.14;
367 var obj = new Dummy.Child(null, a, b);
368 Test.Assert(!obj.GetIfaceWasSet());
369 }
370}
371
383} 372}