summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/libefl_mono_native_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/efl_mono/libefl_mono_native_test.c')
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c57
1 files changed, 42 insertions, 15 deletions
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 0cc3cbd..e4c7d72 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 Eina_List *list_for_accessor; 73 Eina_List *list_for_accessor;
74 int setter_only; 74 int setter_only;
75 int iface_prop; 75 int iface_prop;
76 Eo *provider;
76} Dummy_Test_Object_Data; 77} Dummy_Test_Object_Data;
77 78
78typedef struct Dummy_Numberwrapper_Data 79typedef struct Dummy_Numberwrapper_Data
@@ -86,6 +87,8 @@ typedef struct Dummy_Child_Data
86 const char* a; 87 const char* a;
87 double b; 88 double b;
88 Eina_Bool iface_was_set; 89 Eina_Bool iface_was_set;
90 Eina_Bool obligatory_beta_ctor_was_called;
91 Eina_Bool optional_beta_ctor_was_called;
89} Dummy_Child_Data; 92} Dummy_Child_Data;
90 93
91typedef struct Dummy_Inherit_Helper_Data 94typedef struct Dummy_Inherit_Helper_Data
@@ -150,6 +153,9 @@ _dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
150 pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two")); 153 pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
151 } 154 }
152 155
156 pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj);
157 dummy_numberwrapper_number_set(pd->provider, 1999);
158
153 return obj; 159 return obj;
154} 160}
155 161
@@ -158,6 +164,11 @@ Efl_Object *_dummy_test_object_return_object(Eo *obj, EINA_UNUSED Dummy_Test_Obj
158 return obj; 164 return obj;
159} 165}
160 166
167Efl_Object *_dummy_test_object_return_null_object(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
168{
169 return NULL;
170}
171
161void _dummy_test_object_int_out(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, int x, int *y) 172void _dummy_test_object_int_out(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, int x, int *y)
162{ 173{
163 *y = -x; 174 *y = -x;
@@ -3332,19 +3343,10 @@ void struct_complex_with_values(Dummy_StructComplex *complex)
3332 eina_array_push(complex->farray, _new_int(0x2A)); 3343 eina_array_push(complex->farray, _new_int(0x2A));
3333 eina_array_push(complex->farray, _new_int(0x42)); 3344 eina_array_push(complex->farray, _new_int(0x42));
3334 3345
3335 complex->finarray = eina_inarray_new(sizeof(int), 0);
3336 eina_inarray_push(complex->finarray, _int_ref(0x0));
3337 eina_inarray_push(complex->finarray, _int_ref(0x2A));
3338 eina_inarray_push(complex->finarray, _int_ref(0x42));
3339
3340 complex->flist = eina_list_append(complex->flist, strdup("0x0")); 3346 complex->flist = eina_list_append(complex->flist, strdup("0x0"));
3341 complex->flist = eina_list_append(complex->flist, strdup("0x2A")); 3347 complex->flist = eina_list_append(complex->flist, strdup("0x2A"));
3342 complex->flist = eina_list_append(complex->flist, strdup("0x42")); 3348 complex->flist = eina_list_append(complex->flist, strdup("0x42"));
3343 3349
3344 complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x0));
3345 complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x2A));
3346 complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x42));
3347
3348 complex->fhash = eina_hash_string_superfast_new(NULL); 3350 complex->fhash = eina_hash_string_superfast_new(NULL);
3349 eina_hash_add(complex->fhash, "aa", strdup("aaa")); 3351 eina_hash_add(complex->fhash, "aa", strdup("aaa"));
3350 eina_hash_add(complex->fhash, "bb", strdup("bbb")); 3352 eina_hash_add(complex->fhash, "bb", strdup("bbb"));
@@ -3374,15 +3376,9 @@ Eina_Bool check_and_modify_struct_complex(Dummy_StructComplex *complex)
3374 if (!_array_int_equal(complex->farray, base_seq_int, base_seq_int_size)) 3376 if (!_array_int_equal(complex->farray, base_seq_int, base_seq_int_size))
3375 return EINA_FALSE; 3377 return EINA_FALSE;
3376 3378
3377 if (!_inarray_int_equal(complex->finarray, base_seq_int, base_seq_int_size))
3378 return EINA_FALSE;
3379
3380 if (!_list_str_equal(complex->flist, base_seq_str, base_seq_str_size)) 3379 if (!_list_str_equal(complex->flist, base_seq_str, base_seq_str_size))
3381 return EINA_FALSE; 3380 return EINA_FALSE;
3382 3381
3383 if (!_inlist_int_equal(complex->finlist, base_seq_int, base_seq_int_size))
3384 return EINA_FALSE;
3385
3386 if (!_hash_str_check(complex->fhash, "aa", "aaa") 3382 if (!_hash_str_check(complex->fhash, "aa", "aaa")
3387 || !_hash_str_check(complex->fhash, "bb", "bbb") 3383 || !_hash_str_check(complex->fhash, "bb", "bbb")
3388 || !_hash_str_check(complex->fhash, "cc", "ccc")) 3384 || !_hash_str_check(complex->fhash, "cc", "ccc"))
@@ -3935,6 +3931,14 @@ int _dummy_test_object_dummy_test_iface_iface_prop_get(EINA_UNUSED const Eo *obj
3935 return pd->iface_prop; 3931 return pd->iface_prop;
3936} 3932}
3937 3933
3934Eo * _dummy_test_object_efl_object_provider_find(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const Efl_Class *klass)
3935{
3936 EINA_LOG_ERR("klass: %p, NUMBERWRAPPER: %p", klass, DUMMY_NUMBERWRAPPER_CLASS);
3937 if (klass == DUMMY_NUMBERWRAPPER_CLASS)
3938 return pd->provider;
3939 return efl_provider_find(efl_super(obj, DUMMY_TEST_OBJECT_CLASS), klass);
3940}
3941
3938/// Dummy.Child 3942/// Dummy.Child
3939 3943
3940static Efl_Object * 3944static Efl_Object *
@@ -3944,6 +3948,8 @@ _dummy_child_efl_object_constructor(Eo *obj, Dummy_Child_Data *pd)
3944 3948
3945 pd->iface_prop = 1984; 3949 pd->iface_prop = 1984;
3946 pd->iface_was_set = EINA_FALSE; 3950 pd->iface_was_set = EINA_FALSE;
3951 pd->obligatory_beta_ctor_was_called = EINA_FALSE;
3952 pd->optional_beta_ctor_was_called = EINA_FALSE;
3947 return obj; 3953 return obj;
3948} 3954}
3949 3955
@@ -3972,6 +3978,27 @@ Eina_Bool _dummy_child_iface_was_set_get(EINA_UNUSED const Eo* obj, Dummy_Child_
3972{ 3978{
3973 return pd->iface_was_set; 3979 return pd->iface_was_set;
3974} 3980}
3981
3982void _dummy_child_obligatory_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
3983{
3984 pd->obligatory_beta_ctor_was_called = EINA_TRUE;
3985}
3986
3987void _dummy_child_optional_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
3988{
3989 pd->optional_beta_ctor_was_called = EINA_TRUE;
3990}
3991
3992Eina_Bool _dummy_child_obligatory_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
3993{
3994 return pd->obligatory_beta_ctor_was_called;
3995}
3996
3997Eina_Bool _dummy_child_optional_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
3998{
3999 return pd->optional_beta_ctor_was_called;
4000}
4001
3975EOLIAN static void 4002EOLIAN static void
3976_dummy_child_class_constructor(Efl_Class *klass) 4003_dummy_child_class_constructor(Efl_Class *klass)
3977{ 4004{