summaryrefslogtreecommitdiff
path: root/src/tests/eolian/eolian_parsing.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-06 15:22:56 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-06 15:28:10 +0100
commit9752c44a48c7ff228782a6f9c193542045bfa2b6 (patch)
tree6ab9e553282ff7c5734031cedf1459096cece871 /src/tests/eolian/eolian_parsing.c
parent614d1fad6e20f0ea1dc715d561ba24e48422f2c3 (diff)
eolian: add a new references system to help replace pointers
It's now possible to mark struct fields and function params as "references", which causes them to become pointers in C (in bindings, they become whatever is necessary). They're not a part of the type and are much more restricted than pointers, allowing bindings to be easier. This system will be gradually utilized and expanded as required. @feature
Diffstat (limited to '')
-rw-r--r--src/tests/eolian/eolian_parsing.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 008d1308e6..66f4b87197 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -639,6 +639,10 @@ START_TEST(eolian_simple_parsing)
639 v = eolian_expression_eval(expr, EOLIAN_MASK_FLOAT); 639 v = eolian_expression_eval(expr, EOLIAN_MASK_FLOAT);
640 fail_if(v.type != EOLIAN_EXPR_DOUBLE); 640 fail_if(v.type != EOLIAN_EXPR_DOUBLE);
641 fail_if(v.value.d != 1337.6); 641 fail_if(v.value.d != 1337.6);
642 fail_if(!(eina_iterator_next(iter, (void**)&param)));
643 fail_if(eolian_parameter_direction_get(param) != EOLIAN_REF_PARAM);
644 fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
645 fail_if(strcmp(eolian_parameter_name_get(param), "d"));
642 fail_if(eina_iterator_next(iter, &dummy)); 646 fail_if(eina_iterator_next(iter, &dummy));
643 eina_iterator_free(iter); 647 eina_iterator_free(iter);
644 648
@@ -680,10 +684,12 @@ START_TEST(eolian_struct)
680 fail_if(strcmp(file, "struct.eo")); 684 fail_if(strcmp(file, "struct.eo"));
681 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field"))); 685 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
682 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field))); 686 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
687 fail_if(!eolian_typedecl_struct_field_is_ref(field));
683 fail_if(!(type_name = eolian_type_name_get(ftype))); 688 fail_if(!(type_name = eolian_type_name_get(ftype)));
684 fail_if(strcmp(type_name, "int")); 689 fail_if(strcmp(type_name, "int"));
685 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something"))); 690 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
686 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field))); 691 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
692 fail_if(eolian_typedecl_struct_field_is_ref(field));
687 fail_if(!(type_name = eolian_type_c_type_get(ftype))); 693 fail_if(!(type_name = eolian_type_c_type_get(ftype)));
688 fail_if(strcmp(type_name, "const char *")); 694 fail_if(strcmp(type_name, "const char *"));
689 eina_stringshare_del(type_name); 695 eina_stringshare_del(type_name);