summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-07-30 11:05:26 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-07-30 11:47:07 -0300
commit29d24aa409371bd0252b34eb54b1adcb256ca2a1 (patch)
tree4c822a2c82f67e85980ced2ce1707729732fb1f2 /src/tests
parent1530d0386cff30b20da85e06b2688ea203b17cc7 (diff)
csharp: Add marshal support for Eina.ValueType
Summary: It uses a custom marshaler and a helper boxing class to convert between the managed enum values and the native Eina_Value_Type pointers. To be used by future MVVM machinery. Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9443
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/efl_mono/ValueEolian.cs11
-rw-r--r--src/tests/efl_mono/dummy_test_object.c5
-rw-r--r--src/tests/efl_mono/dummy_test_object.eo7
3 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/efl_mono/ValueEolian.cs b/src/tests/efl_mono/ValueEolian.cs
index ea178d4ac9..945228a6db 100644
--- a/src/tests/efl_mono/ValueEolian.cs
+++ b/src/tests/efl_mono/ValueEolian.cs
@@ -160,6 +160,17 @@ public static class TestEinaValueEolian {
160 Test.AssertEquals(expected, received); 160 Test.AssertEquals(expected, received);
161 Test.AssertEquals(Eina.ValueType.Int32, received.GetValueType()); 161 Test.AssertEquals(Eina.ValueType.Int32, received.GetValueType());
162 } 162 }
163
164 public static void TestEolianEinaValueTypeMarshalling()
165 {
166 var obj = new Dummy.TestObject();
167
168 var values = Enum.GetValues(typeof(Eina.ValueType));
169 foreach (Eina.ValueType type in values)
170 {
171 Test.AssertEquals(type, obj.MirrorValueType(type));
172 }
173 }
163} 174}
164#pragma warning restore 1591 175#pragma warning restore 1591
165} 176}
diff --git a/src/tests/efl_mono/dummy_test_object.c b/src/tests/efl_mono/dummy_test_object.c
index 6717b12476..8ba7536720 100644
--- a/src/tests/efl_mono/dummy_test_object.c
+++ b/src/tests/efl_mono/dummy_test_object.c
@@ -4685,6 +4685,11 @@ Efl_Object *_dummy_test_object_call_find_provider_for_iface(Eo *obj, EINA_UNUSED
4685 return efl_provider_find(obj, DUMMY_TEST_IFACE_INTERFACE); 4685 return efl_provider_find(obj, DUMMY_TEST_IFACE_INTERFACE);
4686} 4686}
4687 4687
4688const Eina_Value_Type *_dummy_test_object_mirror_value_type(EINA_UNUSED const Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const Eina_Value_Type *type)
4689{
4690 return type;
4691}
4692
4688// Inherit 4693// Inherit
4689int _dummy_inherit_helper_receive_dummy_and_call_int_out(Dummy_Test_Object *x) 4694int _dummy_inherit_helper_receive_dummy_and_call_int_out(Dummy_Test_Object *x)
4690{ 4695{
diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo
index 2273c23a20..4f26beba0a 100644
--- a/src/tests/efl_mono/dummy_test_object.eo
+++ b/src/tests/efl_mono/dummy_test_object.eo
@@ -1642,6 +1642,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
1642 call_find_provider_for_iface { 1642 call_find_provider_for_iface {
1643 return: Efl.Object; 1643 return: Efl.Object;
1644 } 1644 }
1645
1646 mirror_value_type @beta @const {
1647 params {
1648 @in type: const(ptr(Eina.Value_Type));
1649 }
1650 return: const(ptr(Eina.Value_Type));
1651 }
1645 } 1652 }
1646 implements { 1653 implements {
1647 Efl.Object.constructor; 1654 Efl.Object.constructor;