summaryrefslogtreecommitdiff
path: root/src/tests/eolian/eolian_parsing.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-08 15:49:09 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-08 15:49:09 +0100
commitb87c4f6de82065b22c2dab32acf27afcbd3824cb (patch)
treed8b4e731c6ef42d94bd15263a495b027aac555f4 /src/tests/eolian/eolian_parsing.c
parent08e189805d30c45a56e77e3c4cc222ead8f4ed70 (diff)
eolian: refine the ref system to suit more cases
Now references are first class (but still restricted to one level). Unlike pointers they only mark the type instead of introducing a whole new type.
Diffstat (limited to '')
-rw-r--r--src/tests/eolian/eolian_parsing.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 86ff77f151..9833db3597 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -606,7 +606,7 @@ START_TEST(eolian_simple_parsing)
606 /* Method */ 606 /* Method */
607 fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD))); 607 fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
608 fail_if(!eolian_function_is_beta(fid)); 608 fail_if(!eolian_function_is_beta(fid));
609 fail_if(eolian_function_return_is_ref(fid, EOLIAN_METHOD)); 609 fail_if(eolian_type_is_ref(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
610 /* Function return */ 610 /* Function return */
611 tp = eolian_function_return_type_get(fid, EOLIAN_METHOD); 611 tp = eolian_function_return_type_get(fid, EOLIAN_METHOD);
612 fail_if(!tp); 612 fail_if(!tp);
@@ -641,8 +641,9 @@ START_TEST(eolian_simple_parsing)
641 fail_if(v.type != EOLIAN_EXPR_DOUBLE); 641 fail_if(v.type != EOLIAN_EXPR_DOUBLE);
642 fail_if(v.value.d != 1337.6); 642 fail_if(v.value.d != 1337.6);
643 fail_if(!(eina_iterator_next(iter, (void**)&param))); 643 fail_if(!(eina_iterator_next(iter, (void**)&param)));
644 fail_if(eolian_parameter_direction_get(param) != EOLIAN_REF_PARAM); 644 fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
645 fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int")); 645 fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
646 fail_if(!eolian_type_is_ref(eolian_parameter_type_get(param)));
646 fail_if(strcmp(eolian_parameter_name_get(param), "d")); 647 fail_if(strcmp(eolian_parameter_name_get(param), "d"));
647 fail_if(eina_iterator_next(iter, &dummy)); 648 fail_if(eina_iterator_next(iter, &dummy));
648 eina_iterator_free(iter); 649 eina_iterator_free(iter);
@@ -652,7 +653,7 @@ START_TEST(eolian_simple_parsing)
652 fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_METHOD)); 653 fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
653 fail_if(!eolian_function_is_c_only(fid)); 654 fail_if(!eolian_function_is_c_only(fid));
654 fail_if(eolian_function_is_beta(fid)); 655 fail_if(eolian_function_is_beta(fid));
655 fail_if(!eolian_function_return_is_ref(fid, EOLIAN_METHOD)); 656 fail_if(!eolian_type_is_ref(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
656 657
657 eolian_shutdown(); 658 eolian_shutdown();
658} 659}
@@ -686,12 +687,12 @@ START_TEST(eolian_struct)
686 fail_if(strcmp(file, "struct.eo")); 687 fail_if(strcmp(file, "struct.eo"));
687 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field"))); 688 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
688 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field))); 689 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
689 fail_if(!eolian_typedecl_struct_field_is_ref(field)); 690 fail_if(!eolian_type_is_ref(ftype));
690 fail_if(!(type_name = eolian_type_name_get(ftype))); 691 fail_if(!(type_name = eolian_type_name_get(ftype)));
691 fail_if(strcmp(type_name, "int")); 692 fail_if(strcmp(type_name, "int"));
692 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something"))); 693 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
693 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field))); 694 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
694 fail_if(eolian_typedecl_struct_field_is_ref(field)); 695 fail_if(eolian_type_is_ref(ftype));
695 fail_if(!(type_name = eolian_type_c_type_get(ftype))); 696 fail_if(!(type_name = eolian_type_c_type_get(ftype)));
696 fail_if(strcmp(type_name, "const char *")); 697 fail_if(strcmp(type_name, "const char *"));
697 eina_stringshare_del(type_name); 698 eina_stringshare_del(type_name);