summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-03-15 11:30:24 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-03-15 11:38:08 -0300
commit4acc7e066758eca4837df83ccf6262fb479cc4ff (patch)
tree95b0d5fcd4aa6363e8d9f8927cd3895cf46812e1 /src/tests
parent5ed079cb617e3a06b4727145693427a77d93b514 (diff)
csharp: Support Efl.Class for interfaces
Summary: The `GetEflClassStatic` method for interface is in their Concrete sidekick. Previously, passing a valid Eo interface as a type caused the binding to complain that `Type is not an Efl.Object`. Test Plan: run test case Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8360
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/efl_mono/Eo.cs7
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c9
2 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 9329fbae12..95f9b7e1d8 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -446,6 +446,13 @@ class TestProvider
446 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper)); 446 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
447 Test.AssertEquals(provider.GetNumber(), 1999); 447 Test.AssertEquals(provider.GetNumber(), 1999);
448 } 448 }
449
450 public static void test_find_provider_iface()
451 {
452 var obj = new Dummy.TestObject();
453 Dummy.TestIface provider = Dummy.TestIfaceConcrete.static_cast(obj.FindProvider(typeof(Dummy.TestIface)));
454 Test.AssertEquals(provider.GetIfaceProp(), 1997);
455 }
449} 456}
450 457
451} 458}
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 11190c9124..b02abdefd4 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -73,6 +73,7 @@ typedef struct Dummy_Test_Object_Data
73 int setter_only; 73 int setter_only;
74 int iface_prop; 74 int iface_prop;
75 Eo *provider; 75 Eo *provider;
76 Eo *iface_provider;
76} Dummy_Test_Object_Data; 77} Dummy_Test_Object_Data;
77 78
78typedef struct Dummy_Numberwrapper_Data 79typedef struct Dummy_Numberwrapper_Data
@@ -151,6 +152,12 @@ _dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
151{ 152{
152 efl_constructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS)); 153 efl_constructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS));
153 pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj); 154 pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj);
155
156 if (efl_parent_get(obj) == NULL) { // Avoid recursion
157 pd->iface_provider = efl_add(DUMMY_TEST_OBJECT_CLASS, obj);
158 dummy_test_iface_prop_set(pd->iface_provider, 1997);
159 } else
160 pd->iface_provider = NULL;
154 dummy_numberwrapper_number_set(pd->provider, 1999); 161 dummy_numberwrapper_number_set(pd->provider, 1999);
155 162
156 return obj; 163 return obj;
@@ -3928,6 +3935,8 @@ Eo * _dummy_test_object_efl_object_provider_find(EINA_UNUSED const Eo *obj, Dumm
3928 EINA_LOG_ERR("klass: %p, NUMBERWRAPPER: %p", klass, DUMMY_NUMBERWRAPPER_CLASS); 3935 EINA_LOG_ERR("klass: %p, NUMBERWRAPPER: %p", klass, DUMMY_NUMBERWRAPPER_CLASS);
3929 if (klass == DUMMY_NUMBERWRAPPER_CLASS) 3936 if (klass == DUMMY_NUMBERWRAPPER_CLASS)
3930 return pd->provider; 3937 return pd->provider;
3938 else if (klass == DUMMY_TEST_IFACE_INTERFACE)
3939 return pd->iface_provider;
3931 return efl_provider_find(efl_super(obj, DUMMY_TEST_OBJECT_CLASS), klass); 3940 return efl_provider_find(efl_super(obj, DUMMY_TEST_OBJECT_CLASS), klass);
3932} 3941}
3933 3942