diff options
author | Daniel Kolesa <d.kolesa@samsung.com> | 2019-09-09 18:26:49 +0200 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@samsung.com> | 2019-09-09 18:26:49 +0200 |
commit | 267c57d0f10d4b1577181c8f7157b7bc2f8053a6 (patch) | |
tree | 7e41546452c4ad6c6aa93664e3e2a858fd01bf9d | |
parent | 165921ec040f427875fc0b32b1f03d4a45efd25e (diff) |
eolian: remove second parameter for eolian_type_c_type_get
This has been replaced by newer APIs.
-rw-r--r-- | src/bin/eolian/docs.c | 2 | ||||
-rw-r--r-- | src/bin/eolian/sources.c | 2 | ||||
-rw-r--r-- | src/bin/eolian/types.c | 4 | ||||
-rw-r--r-- | src/bindings/luajit/eolian.lua | 18 | ||||
-rw-r--r-- | src/lib/eolian/Eolian.h | 10 | ||||
-rw-r--r-- | src/lib/eolian/database_type_api.c | 4 | ||||
-rw-r--r-- | src/lib/eolian/eolian_database.h | 7 | ||||
-rw-r--r-- | src/lib/eolian_cxx/grammar/klass_def.hpp | 8 | ||||
-rw-r--r-- | src/scripts/pyolian/eolian.py | 21 | ||||
-rw-r--r-- | src/scripts/pyolian/eolian_lib.py | 4 | ||||
-rwxr-xr-x | src/scripts/pyolian/test_eolian.py | 12 | ||||
-rw-r--r-- | src/tests/eolian/eolian_parsing.c | 12 |
12 files changed, 31 insertions, 73 deletions
diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c index 498278f0e1..0e0d359109 100644 --- a/src/bin/eolian/docs.c +++ b/src/bin/eolian/docs.c | |||
@@ -380,7 +380,7 @@ eo_gen_docs_event_gen(const Eolian_State *state, const Eolian_Event *ev, | |||
380 | if (rt) | 380 | if (rt) |
381 | { | 381 | { |
382 | p = buf; | 382 | p = buf; |
383 | Eina_Stringshare *rts = eolian_type_c_type_get(rt, EOLIAN_C_TYPE_DEFAULT); | 383 | Eina_Stringshare *rts = eolian_type_c_type_get(rt); |
384 | snprintf(buf, sizeof(buf), "@return %s", rts); | 384 | snprintf(buf, sizeof(buf), "@return %s", rts); |
385 | eina_stringshare_del(rts); | 385 | eina_stringshare_del(rts); |
386 | } | 386 | } |
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index dea9d86011..fd0c32bb07 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c | |||
@@ -235,7 +235,7 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia | |||
235 | eina_strbuf_append_printf(iter_param, "%s_iter", eolian_parameter_name_get(parameter)); | 235 | eina_strbuf_append_printf(iter_param, "%s_iter", eolian_parameter_name_get(parameter)); |
236 | 236 | ||
237 | //generate the field definition | 237 | //generate the field definition |
238 | eina_strbuf_append_printf(*buf, " %s", eolian_type_c_type_get(inner_type, EOLIAN_C_TYPE_DEFAULT)); | 238 | eina_strbuf_append_printf(*buf, " %s", eolian_type_c_type_get(inner_type)); |
239 | eina_strbuf_append_buffer(*buf, iter_param); | 239 | eina_strbuf_append_buffer(*buf, iter_param); |
240 | eina_strbuf_append(*buf, ";\n"); | 240 | eina_strbuf_append(*buf, ";\n"); |
241 | 241 | ||
diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c index 7fe1a85b44..75426f1220 100644 --- a/src/bin/eolian/types.c +++ b/src/bin/eolian/types.c | |||
@@ -203,7 +203,7 @@ _var_generate(const Eolian_State *state, const Eolian_Variable *vr) | |||
203 | } | 203 | } |
204 | else | 204 | else |
205 | { | 205 | { |
206 | Eina_Stringshare *ct = eolian_type_c_type_get(vt, EOLIAN_C_TYPE_DEFAULT); | 206 | Eina_Stringshare *ct = eolian_type_c_type_get(vt); |
207 | eina_strbuf_append_printf(buf, "EWAPI extern %s %s;", ct, fn); | 207 | eina_strbuf_append_printf(buf, "EWAPI extern %s %s;", ct, fn); |
208 | eina_stringshare_del(ct); | 208 | eina_stringshare_del(ct); |
209 | } | 209 | } |
@@ -394,7 +394,7 @@ _source_gen_var(Eina_Strbuf *buf, const Eolian_Variable *vr) | |||
394 | eina_str_toupper(&fn); | 394 | eina_str_toupper(&fn); |
395 | 395 | ||
396 | const Eolian_Type *vt = eolian_variable_base_type_get(vr); | 396 | const Eolian_Type *vt = eolian_variable_base_type_get(vr); |
397 | Eina_Stringshare *ct = eolian_type_c_type_get(vt, EOLIAN_C_TYPE_DEFAULT); | 397 | Eina_Stringshare *ct = eolian_type_c_type_get(vt); |
398 | eina_strbuf_append_printf(buf, "EWAPI %s %s = ", ct, fn); | 398 | eina_strbuf_append_printf(buf, "EWAPI %s %s = ", ct, fn); |
399 | eina_stringshare_del(ct); | 399 | eina_stringshare_del(ct); |
400 | free(fn); | 400 | free(fn); |
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index a848d029c1..faa39a4315 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua | |||
@@ -173,12 +173,6 @@ ffi.cdef [[ | |||
173 | } Eolian_Type_Builtin_Type; | 173 | } Eolian_Type_Builtin_Type; |
174 | 174 | ||
175 | typedef enum { | 175 | typedef enum { |
176 | EOLIAN_C_TYPE_DEFAULT = 0, | ||
177 | EOLIAN_C_TYPE_PARAM, | ||
178 | EOLIAN_C_TYPE_RETURN | ||
179 | } Eolian_C_Type_Type; | ||
180 | |||
181 | typedef enum { | ||
182 | EOLIAN_EXPR_UNKNOWN = 0, | 176 | EOLIAN_EXPR_UNKNOWN = 0, |
183 | EOLIAN_EXPR_INT, | 177 | EOLIAN_EXPR_INT, |
184 | EOLIAN_EXPR_UINT, | 178 | EOLIAN_EXPR_UINT, |
@@ -453,7 +447,7 @@ ffi.cdef [[ | |||
453 | 447 | ||
454 | Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp); | 448 | Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp); |
455 | 449 | ||
456 | const char *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype); | 450 | const char *eolian_type_c_type_get(const Eolian_Type *tp); |
457 | const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp); | 451 | const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp); |
458 | const char *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp); | 452 | const char *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp); |
459 | 453 | ||
@@ -989,12 +983,6 @@ M.typedecl_type = { | |||
989 | FUNCTION_POINTER = 5 | 983 | FUNCTION_POINTER = 5 |
990 | } | 984 | } |
991 | 985 | ||
992 | M.c_type_type = { | ||
993 | DEFAULT = 0, | ||
994 | PARAM = 1, | ||
995 | RETURN = 2 | ||
996 | } | ||
997 | |||
998 | ffi.metatype("Eolian_Struct_Type_Field", { | 986 | ffi.metatype("Eolian_Struct_Type_Field", { |
999 | __index = wrap_object { | 987 | __index = wrap_object { |
1000 | documentation_get = function(self) | 988 | documentation_get = function(self) |
@@ -1175,8 +1163,8 @@ M.Type = ffi.metatype("Eolian_Type", { | |||
1175 | return eolian.eolian_type_is_ptr(self) ~= 0 | 1163 | return eolian.eolian_type_is_ptr(self) ~= 0 |
1176 | end, | 1164 | end, |
1177 | 1165 | ||
1178 | c_type_get = function(self, ctype) | 1166 | c_type_get = function(self) |
1179 | local v = eolian.eolian_type_c_type_get(self, ctype) | 1167 | local v = eolian.eolian_type_c_type_get(self) |
1180 | if v == nil then return nil end | 1168 | if v == nil then return nil end |
1181 | return ffi_stringshare(v) | 1169 | return ffi_stringshare(v) |
1182 | end | 1170 | end |
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 78be1ac97f..c0ec4d6a56 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h | |||
@@ -353,13 +353,6 @@ typedef enum | |||
353 | 353 | ||
354 | typedef enum | 354 | typedef enum |
355 | { | 355 | { |
356 | EOLIAN_C_TYPE_DEFAULT = 0, | ||
357 | EOLIAN_C_TYPE_PARAM, | ||
358 | EOLIAN_C_TYPE_RETURN | ||
359 | } Eolian_C_Type_Type; | ||
360 | |||
361 | typedef enum | ||
362 | { | ||
363 | EOLIAN_EXPR_UNKNOWN = 0, | 356 | EOLIAN_EXPR_UNKNOWN = 0, |
364 | EOLIAN_EXPR_INT, | 357 | EOLIAN_EXPR_INT, |
365 | EOLIAN_EXPR_UINT, | 358 | EOLIAN_EXPR_UINT, |
@@ -3000,7 +2993,6 @@ EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp); | |||
3000 | * @brief Get the full C type name of the given type. | 2993 | * @brief Get the full C type name of the given type. |
3001 | * | 2994 | * |
3002 | * @param[in] tp the type. | 2995 | * @param[in] tp the type. |
3003 | * @param[in] ctype the context within which the C type string will be used. | ||
3004 | * @return The C type name assuming @c tp is not NULL. | 2996 | * @return The C type name assuming @c tp is not NULL. |
3005 | * | 2997 | * |
3006 | * You're responsible for the stringshare. | 2998 | * You're responsible for the stringshare. |
@@ -3009,7 +3001,7 @@ EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp); | |||
3009 | * | 3001 | * |
3010 | * @ingroup Eolian | 3002 | * @ingroup Eolian |
3011 | */ | 3003 | */ |
3012 | EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype); | 3004 | EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp); |
3013 | 3005 | ||
3014 | /* | 3006 | /* |
3015 | * @brief A helper function to get the full name of a type. | 3007 | * @brief A helper function to get the full name of a type. |
diff --git a/src/lib/eolian/database_type_api.c b/src/lib/eolian/database_type_api.c index 12e787d8f8..59a149337f 100644 --- a/src/lib/eolian/database_type_api.c +++ b/src/lib/eolian/database_type_api.c | |||
@@ -267,13 +267,13 @@ eolian_typedecl_is_extern(const Eolian_Typedecl *tp) | |||
267 | } | 267 | } |
268 | 268 | ||
269 | EAPI Eina_Stringshare * | 269 | EAPI Eina_Stringshare * |
270 | eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype) | 270 | eolian_type_c_type_get(const Eolian_Type *tp) |
271 | { | 271 | { |
272 | Eina_Stringshare *ret; | 272 | Eina_Stringshare *ret; |
273 | Eina_Strbuf *buf; | 273 | Eina_Strbuf *buf; |
274 | EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL); | 274 | EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL); |
275 | buf = eina_strbuf_new(); | 275 | buf = eina_strbuf_new(); |
276 | database_type_to_str(tp, buf, NULL, ctype, EINA_FALSE); | 276 | database_type_to_str(tp, buf, NULL, EOLIAN_C_TYPE_DEFAULT, EINA_FALSE); |
277 | ret = eina_stringshare_add(eina_strbuf_string_get(buf)); | 277 | ret = eina_stringshare_add(eina_strbuf_string_get(buf)); |
278 | eina_strbuf_free(buf); | 278 | eina_strbuf_free(buf); |
279 | return ret; | 279 | return ret; |
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index 8a16733780..1821642c55 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h | |||
@@ -263,6 +263,13 @@ struct _Eolian_Function_Parameter | |||
263 | Eina_Bool move :1; | 263 | Eina_Bool move :1; |
264 | }; | 264 | }; |
265 | 265 | ||
266 | typedef enum | ||
267 | { | ||
268 | EOLIAN_C_TYPE_DEFAULT = 0, | ||
269 | EOLIAN_C_TYPE_PARAM, | ||
270 | EOLIAN_C_TYPE_RETURN | ||
271 | } Eolian_C_Type_Type; | ||
272 | |||
266 | struct _Eolian_Type | 273 | struct _Eolian_Type |
267 | { | 274 | { |
268 | Eolian_Object base; | 275 | Eolian_Object base; |
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index 4de294e836..108be02f79 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp | |||
@@ -491,7 +491,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni | |||
491 | { | 491 | { |
492 | complex.subtypes.push_back({stp | 492 | complex.subtypes.push_back({stp |
493 | , unit | 493 | , unit |
494 | , ::eolian_type_c_type_get(stp, EOLIAN_C_TYPE_DEFAULT) | 494 | , ::eolian_type_c_type_get(stp) |
495 | , eolian_type_is_move(stp) | 495 | , eolian_type_is_move(stp) |
496 | , is_by::value}); | 496 | , is_by::value}); |
497 | stp = eolian_type_next_type_get(stp); | 497 | stp = eolian_type_next_type_get(stp); |
@@ -554,7 +554,7 @@ struct alias_def | |||
554 | auto eolian_type = ::eolian_typedecl_base_type_get(alias_obj); | 554 | auto eolian_type = ::eolian_typedecl_base_type_get(alias_obj); |
555 | base_type = type_def(eolian_type | 555 | base_type = type_def(eolian_type |
556 | , unit | 556 | , unit |
557 | , ::eolian_type_c_type_get(eolian_type, EOLIAN_C_TYPE_DEFAULT) | 557 | , ::eolian_type_c_type_get(eolian_type) |
558 | , value_ownership::unmoved | 558 | , value_ownership::unmoved |
559 | , is_by::value); | 559 | , is_by::value); |
560 | is_undefined = false; | 560 | is_undefined = false; |
@@ -1029,7 +1029,7 @@ struct variable_def | |||
1029 | , full_name(::eolian_variable_name_get(variable)) | 1029 | , full_name(::eolian_variable_name_get(variable)) |
1030 | , base_type(::eolian_variable_base_type_get(variable) | 1030 | , base_type(::eolian_variable_base_type_get(variable) |
1031 | , unit | 1031 | , unit |
1032 | , ::eolian_type_c_type_get(eolian_variable_base_type_get(variable), ::EOLIAN_C_TYPE_DEFAULT) | 1032 | , ::eolian_type_c_type_get(eolian_variable_base_type_get(variable)) |
1033 | , value_ownership::unmoved | 1033 | , value_ownership::unmoved |
1034 | , is_by::value) | 1034 | , is_by::value) |
1035 | , documentation(::eolian_variable_documentation_get(variable)) | 1035 | , documentation(::eolian_variable_documentation_get(variable)) |
@@ -1117,7 +1117,7 @@ struct event_def | |||
1117 | : klass(cls, {attributes::qualifier_info::is_none, std::string()}) | 1117 | : klass(cls, {attributes::qualifier_info::is_none, std::string()}) |
1118 | , type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event) | 1118 | , type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event) |
1119 | , unit | 1119 | , unit |
1120 | , ::eolian_type_c_type_get(::eolian_event_type_get(event), EOLIAN_C_TYPE_DEFAULT) | 1120 | , ::eolian_type_c_type_get(::eolian_event_type_get(event)) |
1121 | , value_ownership::unmoved | 1121 | , value_ownership::unmoved |
1122 | , is_by::value} | 1122 | , is_by::value} |
1123 | } : eina::optional<type_def>{}) | 1123 | } : eina::optional<type_def>{}) |
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py index 22e84e556f..e231d2b579 100644 --- a/src/scripts/pyolian/eolian.py +++ b/src/scripts/pyolian/eolian.py | |||
@@ -142,11 +142,6 @@ class Eolian_Type_Builtin_Type(IntEnum): | |||
142 | VOID_PTR = 48 | 142 | VOID_PTR = 48 |
143 | FREE_CB = 49 | 143 | FREE_CB = 49 |
144 | 144 | ||
145 | class Eolian_C_Type_Type(IntEnum): | ||
146 | DEFAULT = 0 | ||
147 | PARAM = 1 | ||
148 | RETURN = 2 | ||
149 | |||
150 | class Eolian_Expression_Type(IntEnum): | 145 | class Eolian_Expression_Type(IntEnum): |
151 | UNKNOWN = 0 | 146 | UNKNOWN = 0 |
152 | INT = 1 | 147 | INT = 1 |
@@ -1053,25 +1048,13 @@ class Type(Object): | |||
1053 | def builtin_type(self): | 1048 | def builtin_type(self): |
1054 | return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self)) | 1049 | return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self)) |
1055 | 1050 | ||
1056 | def c_type_get(self, ctype): | 1051 | def c_type_get(self): |
1057 | s = lib.eolian_type_c_type_get(self, ctype) | 1052 | s = lib.eolian_type_c_type_get(self) |
1058 | ret = _str_to_py(s) | 1053 | ret = _str_to_py(s) |
1059 | lib.eina_stringshare_del(c_void_p(s)) | 1054 | lib.eina_stringshare_del(c_void_p(s)) |
1060 | return ret | 1055 | return ret |
1061 | 1056 | ||
1062 | @cached_property | 1057 | @cached_property |
1063 | def c_type_default(self): | ||
1064 | return self.c_type_get(Eolian_C_Type_Type.DEFAULT) | ||
1065 | |||
1066 | @cached_property | ||
1067 | def c_type_param(self): | ||
1068 | return self.c_type_get(Eolian_C_Type_Type.PARAM) | ||
1069 | |||
1070 | @cached_property | ||
1071 | def c_type_return(self): | ||
1072 | return self.c_type_get(Eolian_C_Type_Type.RETURN) | ||
1073 | |||
1074 | @cached_property | ||
1075 | def typedecl(self): | 1058 | def typedecl(self): |
1076 | c_tdecl = lib.eolian_type_typedecl_get(self) | 1059 | c_tdecl = lib.eolian_type_typedecl_get(self) |
1077 | return Typedecl(c_tdecl) if c_tdecl else None | 1060 | return Typedecl(c_tdecl) if c_tdecl else None |
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py index b532e98197..b9ee5d39a1 100644 --- a/src/scripts/pyolian/eolian_lib.py +++ b/src/scripts/pyolian/eolian_lib.py | |||
@@ -603,8 +603,8 @@ lib.eolian_type_is_const.restype = c_bool | |||
603 | lib.eolian_type_is_ptr.argtypes = (c_void_p,) | 603 | lib.eolian_type_is_ptr.argtypes = (c_void_p,) |
604 | lib.eolian_type_is_ptr.restype = c_bool | 604 | lib.eolian_type_is_ptr.restype = c_bool |
605 | 605 | ||
606 | # EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype); | 606 | # EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp); |
607 | lib.eolian_type_c_type_get.argtypes = (c_void_p, c_int) | 607 | lib.eolian_type_c_type_get.argtypes = (c_void_p) |
608 | lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED | 608 | lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED |
609 | 609 | ||
610 | ### Eolian_Expression ####################################################### | 610 | ### Eolian_Expression ####################################################### |
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py index 5313e4cbba..36c19ea1ae 100755 --- a/src/scripts/pyolian/test_eolian.py +++ b/src/scripts/pyolian/test_eolian.py | |||
@@ -582,10 +582,6 @@ class TestEolianType(unittest.TestCase): | |||
582 | self.assertIsNone(t.class_) | 582 | self.assertIsNone(t.class_) |
583 | self.assertEqual(t, t.aliased_base) # TODO find a better test | 583 | self.assertEqual(t, t.aliased_base) # TODO find a better test |
584 | 584 | ||
585 | self.assertEqual(t.c_type_default, 'double') # TODO find a better test | ||
586 | self.assertEqual(t.c_type_param, 'double') | ||
587 | self.assertEqual(t.c_type_return, 'double') | ||
588 | |||
589 | def test_type_regular(self): | 585 | def test_type_regular(self): |
590 | cls = eolian_db.class_by_name_get('Efl.Gfx.Entity') | 586 | cls = eolian_db.class_by_name_get('Efl.Gfx.Entity') |
591 | func = cls.function_by_name_get('geometry') | 587 | func = cls.function_by_name_get('geometry') |
@@ -601,10 +597,6 @@ class TestEolianType(unittest.TestCase): | |||
601 | self.assertIsNone(t.class_) | 597 | self.assertIsNone(t.class_) |
602 | self.assertEqual(t, t.aliased_base) | 598 | self.assertEqual(t, t.aliased_base) |
603 | 599 | ||
604 | self.assertEqual(t.c_type_default, 'Eina_Rect') # TODO find a better test | ||
605 | self.assertEqual(t.c_type_param, 'Eina_Rect') | ||
606 | self.assertEqual(t.c_type_return, 'Eina_Rect') | ||
607 | |||
608 | td = t.typedecl | 600 | td = t.typedecl |
609 | self.assertIsInstance(td, eolian.Typedecl) | 601 | self.assertIsInstance(td, eolian.Typedecl) |
610 | self.assertEqual(td.name, 'Eina.Rect') | 602 | self.assertEqual(td.name, 'Eina.Rect') |
@@ -623,10 +615,6 @@ class TestEolianType(unittest.TestCase): | |||
623 | self.assertEqual(list(t.namespaces), ['Efl', 'Gfx']) | 615 | self.assertEqual(list(t.namespaces), ['Efl', 'Gfx']) |
624 | self.assertEqual(t, t.aliased_base) | 616 | self.assertEqual(t, t.aliased_base) |
625 | 617 | ||
626 | self.assertEqual(t.c_type_default, 'Efl_Gfx_Entity *') # TODO find a better test | ||
627 | self.assertEqual(t.c_type_param, 'Efl_Gfx_Entity *') | ||
628 | self.assertEqual(t.c_type_return, 'Efl_Gfx_Entity *') | ||
629 | |||
630 | cls = t.class_ | 618 | cls = t.class_ |
631 | self.assertIsInstance(cls, eolian.Class) | 619 | self.assertIsInstance(cls, eolian.Class) |
632 | self.assertEqual(cls.name, 'Efl.Gfx.Entity') | 620 | self.assertEqual(cls.name, 'Efl.Gfx.Entity') |
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 7ef4387e1a..cc9c79bb79 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c | |||
@@ -375,12 +375,12 @@ EFL_START_TEST(eolian_typedef) | |||
375 | fail_if(!(type_name = eolian_typedecl_short_name_get(tdl))); | 375 | fail_if(!(type_name = eolian_typedecl_short_name_get(tdl))); |
376 | fail_if(strcmp(type_name, "List_Objects")); | 376 | fail_if(strcmp(type_name, "List_Objects")); |
377 | fail_if(!(type = eolian_typedecl_base_type_get(tdl))); | 377 | fail_if(!(type = eolian_typedecl_base_type_get(tdl))); |
378 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 378 | fail_if(!(type_name = eolian_type_c_type_get(type))); |
379 | fail_if(strcmp(type_name, "Eina_List *")); | 379 | fail_if(strcmp(type_name, "Eina_List *")); |
380 | eina_stringshare_del(type_name); | 380 | eina_stringshare_del(type_name); |
381 | fail_if(!(type = eolian_type_base_type_get(type))); | 381 | fail_if(!(type = eolian_type_base_type_get(type))); |
382 | fail_if(!!eolian_type_next_type_get(type)); | 382 | fail_if(!!eolian_type_next_type_get(type)); |
383 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 383 | fail_if(!(type_name = eolian_type_c_type_get(type))); |
384 | fail_if(strcmp(type_name, "Typedef *")); | 384 | fail_if(strcmp(type_name, "Typedef *")); |
385 | eina_stringshare_del(type_name); | 385 | eina_stringshare_del(type_name); |
386 | 386 | ||
@@ -432,14 +432,14 @@ EFL_START_TEST(eolian_complex_type) | |||
432 | eina_stringshare_del(type_name); | 432 | eina_stringshare_del(type_name); |
433 | fail_if(!(type = eolian_type_base_type_get(type))); | 433 | fail_if(!(type = eolian_type_base_type_get(type))); |
434 | fail_if(!!eolian_type_next_type_get(type)); | 434 | fail_if(!!eolian_type_next_type_get(type)); |
435 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 435 | fail_if(!(type_name = eolian_type_c_type_get(type))); |
436 | fail_if(eolian_type_is_move(type)); | 436 | fail_if(eolian_type_is_move(type)); |
437 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_ARRAY); | 437 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_ARRAY); |
438 | fail_if(strcmp(type_name, "Eina_Array *")); | 438 | fail_if(strcmp(type_name, "Eina_Array *")); |
439 | eina_stringshare_del(type_name); | 439 | eina_stringshare_del(type_name); |
440 | fail_if(!(type = eolian_type_base_type_get(type))); | 440 | fail_if(!(type = eolian_type_base_type_get(type))); |
441 | fail_if(!!eolian_type_next_type_get(type)); | 441 | fail_if(!!eolian_type_next_type_get(type)); |
442 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 442 | fail_if(!(type_name = eolian_type_c_type_get(type))); |
443 | fail_if(!eolian_type_is_move(type)); | 443 | fail_if(!eolian_type_is_move(type)); |
444 | fail_if(strcmp(type_name, "Eina_Strbuf *")); | 444 | fail_if(strcmp(type_name, "Eina_Strbuf *")); |
445 | eina_stringshare_del(type_name); | 445 | eina_stringshare_del(type_name); |
@@ -456,7 +456,7 @@ EFL_START_TEST(eolian_complex_type) | |||
456 | eina_stringshare_del(type_name); | 456 | eina_stringshare_del(type_name); |
457 | fail_if(!(type = eolian_type_base_type_get(type))); | 457 | fail_if(!(type = eolian_type_base_type_get(type))); |
458 | fail_if(!!eolian_type_next_type_get(type)); | 458 | fail_if(!!eolian_type_next_type_get(type)); |
459 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 459 | fail_if(!(type_name = eolian_type_c_type_get(type))); |
460 | fail_if(eolian_type_is_move(type)); | 460 | fail_if(eolian_type_is_move(type)); |
461 | fail_if(strcmp(type_name, "const char *")); | 461 | fail_if(strcmp(type_name, "const char *")); |
462 | eina_stringshare_del(type_name); | 462 | eina_stringshare_del(type_name); |
@@ -470,7 +470,7 @@ EFL_START_TEST(eolian_complex_type) | |||
470 | eina_stringshare_del(type_name); | 470 | eina_stringshare_del(type_name); |
471 | fail_if(!(type = eolian_type_base_type_get(type))); | 471 | fail_if(!(type = eolian_type_base_type_get(type))); |
472 | fail_if(!!eolian_type_next_type_get(type)); | 472 | fail_if(!!eolian_type_next_type_get(type)); |
473 | fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT))); | 473 | fail_if(!(type_name = eolian_type_c_type_get(type))); |
474 | fail_if(eolian_type_is_move(type)); | 474 | fail_if(eolian_type_is_move(type)); |
475 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_STRINGSHARE); | 475 | fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_STRINGSHARE); |
476 | fail_if(strcmp(type_name, "Eina_Stringshare *")); | 476 | fail_if(strcmp(type_name, "Eina_Stringshare *")); |