summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-09-05 15:14:39 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-09-05 15:19:28 +0200
commit04b0321bea1637539eff15c7759ab43991fe4d09 (patch)
tree095eecf1f68ea98092946b7a305538f88f7a11d3 /src/tests
parentee0023055f76096788afae3dbdaaeb9c05b99334 (diff)
eolian: update C generator to respect by_ref as well as tests
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/eolian/data/class_simple.eo4
-rw-r--r--src/tests/eolian/data/consts.eo2
-rw-r--r--src/tests/eolian/data/object_impl.eo2
-rw-r--r--src/tests/eolian/data/override.eo2
-rw-r--r--src/tests/eolian/data/struct.eo4
-rw-r--r--src/tests/eolian/eolian_parsing.c9
6 files changed, 11 insertions, 12 deletions
diff --git a/src/tests/eolian/data/class_simple.eo b/src/tests/eolian/data/class_simple.eo
index 8717145806..ad0589b3a7 100644
--- a/src/tests/eolian/data/class_simple.eo
+++ b/src/tests/eolian/data/class_simple.eo
@@ -31,9 +31,9 @@ class Class_Simple {
31 @in a: int; [[a]] 31 @in a: int; [[a]]
32 @inout b: char; 32 @inout b: char;
33 @out c: double (1337.6); 33 @out c: double (1337.6);
34 @in d: ptr(int); 34 @in d: int @by_ref;
35 } 35 }
36 return: ptr(char) (null); [[comment for method return]] 36 return: mstring (null); [[comment for method return]]
37 } 37 }
38 } 38 }
39} 39}
diff --git a/src/tests/eolian/data/consts.eo b/src/tests/eolian/data/consts.eo
index 2b2f9bf08e..9505e95387 100644
--- a/src/tests/eolian/data/consts.eo
+++ b/src/tests/eolian/data/consts.eo
@@ -7,7 +7,7 @@ class Consts {
7 @inout b: char; 7 @inout b: char;
8 @out c: double; 8 @out c: double;
9 } 9 }
10 return: ptr(char) (null); [[comment for method return]] 10 return: int;
11 } 11 }
12 } 12 }
13} 13}
diff --git a/src/tests/eolian/data/object_impl.eo b/src/tests/eolian/data/object_impl.eo
index db4c46d2b3..7fe8ce2e24 100644
--- a/src/tests/eolian/data/object_impl.eo
+++ b/src/tests/eolian/data/object_impl.eo
@@ -41,7 +41,7 @@ abstract Object_Impl extends Base {
41 @inout b: char; 41 @inout b: char;
42 @out c: double; 42 @out c: double;
43 } 43 }
44 return: ptr(char) (null); [[comment for method return]] 44 return: mstring (null); [[comment for method return]]
45 } 45 }
46 foo2 @const { 46 foo2 @const {
47 [[comment foo]] 47 [[comment foo]]
diff --git a/src/tests/eolian/data/override.eo b/src/tests/eolian/data/override.eo
index 221e12fc84..4cee6008d3 100644
--- a/src/tests/eolian/data/override.eo
+++ b/src/tests/eolian/data/override.eo
@@ -38,7 +38,7 @@ abstract Override extends Base {
38 params { 38 params {
39 @in idx: int; 39 @in idx: int;
40 @out a: int (250); 40 @out a: int (250);
41 @out str: ptr(char) (null); 41 @out str: mstring (null);
42 } 42 }
43 } 43 }
44 } 44 }
diff --git a/src/tests/eolian/data/struct.eo b/src/tests/eolian/data/struct.eo
index 80a4935ce3..57f250bdbe 100644
--- a/src/tests/eolian/data/struct.eo
+++ b/src/tests/eolian/data/struct.eo
@@ -1,5 +1,5 @@
1struct Named { 1struct Named {
2 field: ptr(int); 2 field: int @by_ref;
3 something: string; 3 something: string;
4} 4}
5 5
@@ -24,7 +24,7 @@ class Struct {
24 return: mstring @move; 24 return: mstring @move;
25 } 25 }
26 bar { 26 bar {
27 return: ptr(Named); 27 return: Named @by_ref;
28 } 28 }
29 } 29 }
30} 30}
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 60d35150dc..7ef4387e1a 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -615,7 +615,6 @@ EFL_START_TEST(eolian_simple_parsing)
615 /* Method */ 615 /* Method */
616 fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD))); 616 fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
617 fail_if(!eolian_function_is_beta(fid)); 617 fail_if(!eolian_function_is_beta(fid));
618 fail_if(!eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
619 /* Function return */ 618 /* Function return */
620 tp = eolian_function_return_type_get(fid, EOLIAN_METHOD); 619 tp = eolian_function_return_type_get(fid, EOLIAN_METHOD);
621 fail_if(!tp); 620 fail_if(!tp);
@@ -652,7 +651,7 @@ EFL_START_TEST(eolian_simple_parsing)
652 fail_if(!(eina_iterator_next(iter, (void**)&param))); 651 fail_if(!(eina_iterator_next(iter, (void**)&param)));
653 fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM); 652 fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
654 fail_if(strcmp(eolian_type_short_name_get(eolian_parameter_type_get(param)), "int")); 653 fail_if(strcmp(eolian_type_short_name_get(eolian_parameter_type_get(param)), "int"));
655 fail_if(!eolian_type_is_ptr(eolian_parameter_type_get(param))); 654 fail_if(!eolian_parameter_is_by_ref(param));
656 fail_if(strcmp(eolian_parameter_name_get(param), "d")); 655 fail_if(strcmp(eolian_parameter_name_get(param), "d"));
657 fail_if(eina_iterator_next(iter, &dummy)); 656 fail_if(eina_iterator_next(iter, &dummy));
658 eina_iterator_free(iter); 657 eina_iterator_free(iter);
@@ -695,12 +694,12 @@ EFL_START_TEST(eolian_struct)
695 fail_if(strcmp(file, "struct.eo")); 694 fail_if(strcmp(file, "struct.eo"));
696 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field"))); 695 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
697 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field))); 696 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
698 fail_if(!eolian_type_is_ptr(ftype)); 697 fail_if(!eolian_typedecl_struct_field_is_by_ref(field));
699 fail_if(!(type_name = eolian_type_short_name_get(ftype))); 698 fail_if(!(type_name = eolian_type_short_name_get(ftype)));
700 fail_if(strcmp(type_name, "int")); 699 fail_if(strcmp(type_name, "int"));
701 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something"))); 700 fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
702 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field))); 701 fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
703 fail_if(eolian_type_is_ptr(ftype)); 702 fail_if(eolian_typedecl_struct_field_is_by_ref(field));
704 fail_if(!(type_name = eolian_typedecl_struct_field_c_type_get(field))); 703 fail_if(!(type_name = eolian_typedecl_struct_field_c_type_get(field)));
705 fail_if(strcmp(type_name, "const char *")); 704 fail_if(strcmp(type_name, "const char *"));
706 eina_stringshare_del(type_name); 705 eina_stringshare_del(type_name);
@@ -728,7 +727,7 @@ EFL_START_TEST(eolian_struct)
728 fail_if(!(func = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD))); 727 fail_if(!(func = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD)));
729 fail_if(!(type = eolian_function_return_type_get(func, EOLIAN_METHOD))); 728 fail_if(!(type = eolian_function_return_type_get(func, EOLIAN_METHOD)));
730 fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_REGULAR); 729 fail_if(eolian_type_type_get(type) != EOLIAN_TYPE_REGULAR);
731 fail_if(!eolian_type_is_ptr(type)); 730 fail_if(!eolian_function_return_is_by_ref(func, EOLIAN_METHOD));
732 fail_if(!(tdl = eolian_type_typedecl_get(type))); 731 fail_if(!(tdl = eolian_type_typedecl_get(type)));
733 fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT); 732 fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
734 733