aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-22 20:58:36 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-22 21:03:28 +0200
commit6587b19e778cf5415a8d201f1ab9993611254255 (patch)
tree842479d8b15e2081f100846748232ae518bd7374 /src/tests
parentelua: bind new eolian type builtin API (diff)
downloadefl-6587b19e778cf5415a8d201f1ab9993611254255.tar.gz
eolian: add tests for builtin queries
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/eolian/eolian_parsing.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 9e2c0d9bfc..86c079817e 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -412,12 +412,14 @@ START_TEST(eolian_complex_type)
fail_if(!(type = eolian_function_return_type_get(fid, EOLIAN_PROP_SET)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_RETURN)));
fail_if(!eolian_type_is_owned(type));
+ fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_LIST);
fail_if(strcmp(type_name, "Eina_List *"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_type_base_type_get(type)));
fail_if(!!eolian_type_next_type_get(type));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(eolian_type_is_owned(type));
+ fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_ARRAY);
fail_if(strcmp(type_name, "Eina_Array *"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_type_base_type_get(type)));
@@ -455,6 +457,7 @@ START_TEST(eolian_complex_type)
fail_if(!!eolian_type_next_type_get(type));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_DEFAULT)));
fail_if(eolian_type_is_owned(type));
+ fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_STRINGSHARE);
fail_if(strcmp(type_name, "Eina_Stringshare *"));
eina_stringshare_del(type_name);
/* Methods parameter type */
@@ -466,6 +469,7 @@ START_TEST(eolian_complex_type)
fail_if(!(type = eolian_parameter_type_get(param)));
fail_if(!(type_name = eolian_type_c_type_get(type, EOLIAN_C_TYPE_PARAM)));
fail_if(!eolian_type_is_owned(type));
+ fail_if(eolian_type_builtin_type_get(type) != EOLIAN_TYPE_BUILTIN_MSTRING);
fail_if(strcmp(type_name, "char *"));
eina_stringshare_del(type_name);
@@ -554,6 +558,8 @@ START_TEST(eolian_simple_parsing)
/* Set return */
tp = eolian_function_return_type_get(fid, EOLIAN_PROP_SET);
fail_if(!tp);
+ printf("BUILT %d\n", (int)eolian_type_builtin_type_get(tp));
+ fail_if(eolian_type_builtin_type_get(tp) != EOLIAN_TYPE_BUILTIN_BOOL);
fail_if(strcmp(eolian_type_name_get(tp), "bool"));
expr = eolian_function_return_default_value_get(fid, EOLIAN_PROP_SET);
fail_if(!expr);
@@ -614,6 +620,7 @@ START_TEST(eolian_simple_parsing)
fail_if(strcmp(eolian_parameter_name_get(param), "b"));
fail_if(!(eina_iterator_next(iter, (void**)&param)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM);
+ fail_if(eolian_type_builtin_type_get(eolian_parameter_type_get(param)) != EOLIAN_TYPE_BUILTIN_DOUBLE);
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double"));
fail_if(strcmp(eolian_parameter_name_get(param), "c"));
expr = eolian_parameter_default_value_get(param);