summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2017-06-08 14:30:09 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-07-13 18:25:42 -0300
commitedce90351fb581d186eb2a92f6aa41201eec4b77 (patch)
tree1fb9e2d46da5586a88ddacd973cdffda2330238c
parent7497481edc8b26e133382f4c6f8a70fadf816fa5 (diff)
eo_mono: Improve inheritance example
-rw-r--r--src/tests/efl_mono/examples/EoInherit01.cs29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/tests/efl_mono/examples/EoInherit01.cs b/src/tests/efl_mono/examples/EoInherit01.cs
index 70b5665a0d..c03f5b071c 100644
--- a/src/tests/efl_mono/examples/EoInherit01.cs
+++ b/src/tests/efl_mono/examples/EoInherit01.cs
@@ -23,17 +23,19 @@ class TestExampleEoInherit01
23{ 23{
24 public static void EoInherit01() 24 public static void EoInherit01()
25 { 25 {
26 var obj = new PlusTenNumberWrapper(); 26 var inheritObj = new PlusTenNumberWrapper();
27
28 WriteLine("## Using inherit object ##\n");
27 29
28 int given = 111; 30 int given = 111;
29 31
30 // Call the C# override from the C method 32 // Call the C# override from the C method
31 test.NumberwrapperConcrete.test_numberwrapper_number_set(obj.raw_handle, given); 33 test.NumberwrapperConcrete.test_numberwrapper_number_set(inheritObj.raw_handle, given);
32 34
33 WriteLine($"Override successfully called? {obj.derivedCalled}!\n"); 35 WriteLine($"Override successfully called? {inheritObj.derivedCalled}!\n");
34 36
35 // Call C function from C# obj 37 // Call C function from C# object
36 int stored = obj.number_get(); 38 int stored = inheritObj.number_get();
37 39
38 // Print actual value 40 // Print actual value
39 WriteLine($"Given value: {given}"); 41 WriteLine($"Given value: {given}");
@@ -41,9 +43,22 @@ class TestExampleEoInherit01
41 43
42 // Call C# override directly 44 // Call C# override directly
43 given = 333; 45 given = 333;
44 obj.number_set(given); 46 inheritObj.number_set(given);
47
48 stored = inheritObj.number_get();
49
50 // Print actual value
51 WriteLine($"Given value: {given}");
52 WriteLine($"Stored value: {stored}\n");
53
54
55 WriteLine("## Using original object ##\n");
45 56
46 stored = obj.number_get(); 57 // Check original EFL object
58 var origObj = new test.NumberwrapperConcrete();
59 given = 111;
60 origObj.number_set(given);
61 stored = origObj.number_get();
47 62
48 // Print actual value 63 // Print actual value
49 WriteLine($"Given value: {given}"); 64 WriteLine($"Given value: {given}");