summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Eo.cs
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-12-14 20:39:09 -0200
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-12-14 20:47:46 -0200
commit9603cc07eb6e04bec8aef6b4facf9865d9b9a479 (patch)
treee230baf664529d2d312b36f59795e027f3def6e7 /src/tests/efl_mono/Eo.cs
parentdd5c23035312f5da3358cb30ec9359e40314e0ad (diff)
efl-mono: Fix call of virtual methods after new API
Summary: After the new API, the virtual wrapper classes (*NativeInherit) just declared the wrappers for the current class. But as they didn't have any inheritance information, reimplementing methods from a parent Eo class wouldn't work. (e.g. Efl.Ui.Button reimplementing Efl.Object FinalizeAdd). This commit changes these NativeInherit classes to mimic the inheritance chain of their regular/abstract counterparts, reusing the virtual wrapper implementations. In order to access the correct Eo class created, the methods on it were changed from static to instance methods. The instance will be held as a class member of the regular/abstract API class to keep the delegates alive and allow getting C Function pointers from them. The class_initializer method was also split in two. The method collecting the wrapper delegates was extracted in order to call the parent ones. Also avoid exception in cached strings queries as TryGetValue requires non-null keys. Test Plan: Run test suite. Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7460
Diffstat (limited to 'src/tests/efl_mono/Eo.cs')
-rw-r--r--src/tests/efl_mono/Eo.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 7d5df72457..5567f1ef33 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -345,4 +345,39 @@ class TestCsharpProperties
345 } 345 }
346} 346}
347 347
348class TestEoGrandChildrenFinalize
349{
350 public sealed class Child : Dummy.TestObject
351 {
352 public int receivedValue = 0;
353 public override Efl.Object FinalizeAdd()
354 {
355 receivedValue = 42;
356 return this;
357 }
358 }
359
360 public static void test_grand_children_finalize()
361 {
362 Child obj = new Child();
363 Test.AssertEquals(42, obj.receivedValue);
364 }
365
366 public sealed class GrandChild : Dummy.Child
367 {
368 public int receivedValue = 0;
369 public override Efl.Object FinalizeAdd()
370 {
371 receivedValue = -42;
372 return this;
373 }
374 }
375
376 public static void test_grand_grand_children_finalize()
377 {
378 GrandChild obj = new GrandChild();
379 Test.AssertEquals(-42, obj.receivedValue);
380 }
381}
382
348} 383}