summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/libefl_mono_native_test.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-14 23:57:31 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-23 14:13:31 +0100
commit286ad910754c659f677caae2b0c566d4cc99f859 (patch)
treed7572760357b4e212c21956a15bb54fa0637f4ba /src/tests/efl_mono/libefl_mono_native_test.c
parentefaa4bc7f9c44a64de1af155fde18e56fab969cb (diff)
efl_mono: add a free function to every owned type
this is another step towards enforcing free functions on every owned type. To equip every owned type with a free function the following is applied. Every owned ptr is assumed to be a heap pointer, with the free function "free". Every string that is owed is converted to a mstring. a pointer to a eo object is also assumed to be a heap pointer, and equiped with the free function "free". Differential Revision: https://phab.enlightenment.org/D7710
Diffstat (limited to '')
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 4c46e1e8dc..986cd1fa53 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -165,7 +165,7 @@ void _dummy_test_object_int_ptr_out(EINA_UNUSED Eo *obj, Dummy_Test_Object_Data
165 *y = &pd->stored_int; 165 *y = &pd->stored_int;
166} 166}
167 167
168const char *_dummy_test_object_in_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const char *str) 168char *_dummy_test_object_in_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const char *str)
169{ 169{
170 const char *ret = malloc(sizeof(char)*(strlen(str) + 1)); 170 const char *ret = malloc(sizeof(char)*(strlen(str) + 1));
171 return strcpy((char*)ret, str); 171 return strcpy((char*)ret, str);
@@ -196,7 +196,7 @@ const char *_dummy_test_object_return_string(EINA_UNUSED Eo *obj, EINA_UNUSED Du
196 return "string"; 196 return "string";
197} 197}
198 198
199const char *_dummy_test_object_return_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) 199char *_dummy_test_object_return_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
200{ 200{
201 static const char* reference = "own_string"; 201 static const char* reference = "own_string";
202 const char *ret = malloc(sizeof(char)*(strlen(reference) + 1)); 202 const char *ret = malloc(sizeof(char)*(strlen(reference) + 1));
@@ -208,7 +208,7 @@ void _dummy_test_object_out_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_O
208 *str = "out_string"; 208 *str = "out_string";
209} 209}
210 210
211void _dummy_test_object_out_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const char**str) 211void _dummy_test_object_out_own_string(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, char**str)
212{ 212{
213 static const char* reference = "out_own_string"; 213 static const char* reference = "out_own_string";
214 *str = malloc(sizeof(char)*(strlen(reference) + 1)); 214 *str = malloc(sizeof(char)*(strlen(reference) + 1));
@@ -230,7 +230,7 @@ const char *_dummy_test_object_call_return_string(Eo *obj, EINA_UNUSED Dummy_Tes
230 return dummy_test_object_return_string(obj); 230 return dummy_test_object_return_string(obj);
231} 231}
232 232
233const char *_dummy_test_object_call_return_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) 233char *_dummy_test_object_call_return_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
234{ 234{
235 return dummy_test_object_return_own_string(obj); 235 return dummy_test_object_return_own_string(obj);
236} 236}
@@ -242,9 +242,9 @@ const char *_dummy_test_object_call_out_string(Eo *obj, EINA_UNUSED Dummy_Test_O
242 return ret; 242 return ret;
243} 243}
244 244
245const char *_dummy_test_object_call_out_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) 245char *_dummy_test_object_call_out_own_string(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
246{ 246{
247 const char *ret = NULL; 247 char *ret = NULL;
248 dummy_test_object_out_own_string(obj, &ret); 248 dummy_test_object_out_own_string(obj, &ret);
249 return ret; 249 return ret;
250} 250}