diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2020-01-02 15:24:12 -0800 |
---|---|---|
committer | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2020-01-24 21:45:51 -0300 |
commit | 0f49f5e472528bfc992a14ecfc504a2aa2290741 (patch) | |
tree | 7120fe6fb12d83c8d3e19627e855e65a71e43a4a | |
parent | b8ccf5e5e75294ef4c56c0754417af465f3ad319 (diff) |
eolian_cxx: move tests of list<> to be protected by @beta.
Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11047
-rw-r--r-- | src/tests/eolian_cxx/complex.eo | 36 | ||||
-rw-r--r-- | src/tests/eolian_cxx/eolian_cxx_test_binding.cc | 13 | ||||
-rw-r--r-- | src/tests/eolian_cxx/generic.c | 13 | ||||
-rw-r--r-- | src/tests/eolian_cxx/generic.eo | 13 |
4 files changed, 51 insertions, 24 deletions
diff --git a/src/tests/eolian_cxx/complex.eo b/src/tests/eolian_cxx/complex.eo index a87391d83b..4ec79fb0af 100644 --- a/src/tests/eolian_cxx/complex.eo +++ b/src/tests/eolian_cxx/complex.eo | |||
@@ -3,47 +3,47 @@ class Complex extends Efl.Object | |||
3 | data: Complex_Data; | 3 | data: Complex_Data; |
4 | methods { | 4 | methods { |
5 | // container test | 5 | // container test |
6 | inptrcont { | 6 | inptrcont @beta { |
7 | params { | 7 | params { |
8 | l: list<string>; | 8 | l: list<string>; |
9 | } | 9 | } |
10 | } | 10 | } |
11 | inclasscont { | 11 | inclasscont @beta { |
12 | params { | 12 | params { |
13 | l: list<Efl.Object>; | 13 | l: list<Efl.Object>; |
14 | } | 14 | } |
15 | } | 15 | } |
16 | incontcont { | 16 | incontcont @beta { |
17 | params { | 17 | params { |
18 | l: list<list<string>>; | 18 | l: list<list<string>>; |
19 | } | 19 | } |
20 | } | 20 | } |
21 | incontcontown { | 21 | incontcontown @beta { |
22 | params { | 22 | params { |
23 | l: list<list<string>> @move; | 23 | l: list<list<string>> @move; |
24 | } | 24 | } |
25 | } | 25 | } |
26 | incontowncontown { | 26 | incontowncontown @beta { |
27 | params { | 27 | params { |
28 | l: list<list<string> @move> @move; | 28 | l: list<list<string> @move> @move; |
29 | } | 29 | } |
30 | } | 30 | } |
31 | incontowncont { | 31 | incontowncont @beta { |
32 | params { | 32 | params { |
33 | l: list<list<string> @move>; | 33 | l: list<list<string> @move>; |
34 | } | 34 | } |
35 | } | 35 | } |
36 | instringcont { | 36 | instringcont @beta { |
37 | params { | 37 | params { |
38 | l: list<string>; | 38 | l: list<string>; |
39 | } | 39 | } |
40 | } | 40 | } |
41 | instringowncont { | 41 | instringowncont @beta { |
42 | params { | 42 | params { |
43 | l: list<mstring @move>; | 43 | l: list<mstring @move>; |
44 | } | 44 | } |
45 | } | 45 | } |
46 | instringcontown { | 46 | instringcontown @beta { |
47 | params { | 47 | params { |
48 | l: list<string> @move; | 48 | l: list<string> @move; |
49 | } | 49 | } |
@@ -89,42 +89,42 @@ class Complex extends Efl.Object | |||
89 | } | 89 | } |
90 | } | 90 | } |
91 | // out | 91 | // out |
92 | outclasscont { | 92 | outclasscont @beta { |
93 | params { | 93 | params { |
94 | @out l: list<Efl.Object>; | 94 | @out l: list<Efl.Object>; |
95 | } | 95 | } |
96 | } | 96 | } |
97 | outcontcont { | 97 | outcontcont @beta { |
98 | params { | 98 | params { |
99 | @out l: list<list<string>>; | 99 | @out l: list<list<string>>; |
100 | } | 100 | } |
101 | } | 101 | } |
102 | outcontcontown { | 102 | outcontcontown @beta { |
103 | params { | 103 | params { |
104 | @out l: list<list<string>> @move; | 104 | @out l: list<list<string>> @move; |
105 | } | 105 | } |
106 | } | 106 | } |
107 | outcontowncontown { | 107 | outcontowncontown @beta { |
108 | params { | 108 | params { |
109 | @out l: list<list<string> @move> @move; | 109 | @out l: list<list<string> @move> @move; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | outcontowncont { | 112 | outcontowncont @beta { |
113 | params { | 113 | params { |
114 | @out l: list<list<string> @move>; | 114 | @out l: list<list<string> @move>; |
115 | } | 115 | } |
116 | } | 116 | } |
117 | outstringcont { | 117 | outstringcont @beta { |
118 | params { | 118 | params { |
119 | @out l: list<string>; | 119 | @out l: list<string>; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | outstringowncont { | 122 | outstringowncont @beta { |
123 | params { | 123 | params { |
124 | @out l: list<mstring @move>; | 124 | @out l: list<mstring @move>; |
125 | } | 125 | } |
126 | } | 126 | } |
127 | outstringcontown { | 127 | outstringcontown @beta { |
128 | params { | 128 | params { |
129 | @out l: list<string> @move; | 129 | @out l: list<string> @move; |
130 | } | 130 | } |
@@ -169,7 +169,7 @@ class Complex extends Efl.Object | |||
169 | @out l: accessor<int> @move; | 169 | @out l: accessor<int> @move; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | foo { | 172 | foo @beta { |
173 | params { | 173 | params { |
174 | l: list<string>; | 174 | l: list<string>; |
175 | } | 175 | } |
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc index c6e0381551..98020bf919 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include <map> | 22 | #include <map> |
23 | 23 | ||
24 | #define GENERIC_BETA | ||
24 | #include <generic.eo.hh> | 25 | #include <generic.eo.hh> |
25 | #include <generic.eo.impl.hh> | 26 | #include <generic.eo.impl.hh> |
26 | #include <name1_name2_type_generation.eo.hh> | 27 | #include <name1_name2_type_generation.eo.hh> |
@@ -160,8 +161,8 @@ EFL_START_TEST(eolian_cxx_test_type_callback) | |||
160 | efl::eo::eo_init i; | 161 | efl::eo::eo_init i; |
161 | 162 | ||
162 | bool event1 = false, event2 = false, event3 = false, event4 = false | 163 | bool event1 = false, event2 = false, event3 = false, event4 = false |
163 | , event5 = false; | 164 | , event5 = false, event6 = false; |
164 | 165 | ||
165 | nonamespace::Generic g(efl::eo::instantiate); | 166 | nonamespace::Generic g(efl::eo::instantiate); |
166 | efl::eolian::event_add(g.prefix_event1_event, g, [&] (nonamespace::Generic) | 167 | efl::eolian::event_add(g.prefix_event1_event, g, [&] (nonamespace::Generic) |
167 | { | 168 | { |
@@ -183,22 +184,28 @@ EFL_START_TEST(eolian_cxx_test_type_callback) | |||
183 | // FIXME eina::range_array is incompatible with eina::string_view | 184 | // FIXME eina::range_array is incompatible with eina::string_view |
184 | //ck_assert(*e.begin() == efl::eina::string_view{"42"}); | 185 | //ck_assert(*e.begin() == efl::eina::string_view{"42"}); |
185 | }); | 186 | }); |
186 | efl::eolian::event_add(g.prefix_event5_event, g, [&] (nonamespace::Generic, Generic_Event) | 187 | efl::eolian::event_add(g.prefix_event5_event, g, [&] (nonamespace::Generic, Generic_Beta_Event) |
187 | { | 188 | { |
188 | event5 = true; | 189 | event5 = true; |
189 | }); | 190 | }); |
191 | efl::eolian::event_add(g.prefix_event6_event, g, [&] (nonamespace::Generic, Generic_Event) | ||
192 | { | ||
193 | event6 = true; | ||
194 | }); | ||
190 | 195 | ||
191 | g.call_event1(); | 196 | g.call_event1(); |
192 | g.call_event2(); | 197 | g.call_event2(); |
193 | g.call_event3(); | 198 | g.call_event3(); |
194 | g.call_event4(); | 199 | g.call_event4(); |
195 | g.call_event5(); | 200 | g.call_event5(); |
201 | g.call_event6(); | ||
196 | 202 | ||
197 | ck_assert(event1); | 203 | ck_assert(event1); |
198 | ck_assert(event2); | 204 | ck_assert(event2); |
199 | ck_assert(event3); | 205 | ck_assert(event3); |
200 | ck_assert(event4); | 206 | ck_assert(event4); |
201 | ck_assert(event5); | 207 | ck_assert(event5); |
208 | ck_assert(event6); | ||
202 | } | 209 | } |
203 | EFL_END_TEST | 210 | EFL_END_TEST |
204 | 211 | ||
diff --git a/src/tests/eolian_cxx/generic.c b/src/tests/eolian_cxx/generic.c index 0bbf894457..78b22e5519 100644 --- a/src/tests/eolian_cxx/generic.c +++ b/src/tests/eolian_cxx/generic.c | |||
@@ -125,10 +125,21 @@ static void _generic_call_event5(Eo *obj, Generic_Data* pd EINA_UNUSED) | |||
125 | const char *s = "42"; | 125 | const char *s = "42"; |
126 | Eina_List* p = eina_list_append(NULL, s); | 126 | Eina_List* p = eina_list_append(NULL, s); |
127 | 127 | ||
128 | Generic_Event e = {.field1 = 42, .field2 = p}; | 128 | Generic_Beta_Event e = {.field1 = 42, .field2 = p}; |
129 | efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT5, &e); | 129 | efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT5, &e); |
130 | eina_list_free(p); | 130 | eina_list_free(p); |
131 | } | 131 | } |
132 | static void _generic_call_event6(Eo *obj, Generic_Data* pd EINA_UNUSED) | ||
133 | { | ||
134 | const char *s = "42"; | ||
135 | Eina_Array* p = eina_array_new(1); | ||
136 | |||
137 | eina_array_push(p, s); | ||
138 | |||
139 | Generic_Event e = {.field1 = 42, .field2 = p}; | ||
140 | efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT6, &e); | ||
141 | eina_array_free(p); | ||
142 | } | ||
132 | static void _generic_protected_method1(Eo *obj EINA_UNUSED, Generic_Data* pd EINA_UNUSED) | 143 | static void _generic_protected_method1(Eo *obj EINA_UNUSED, Generic_Data* pd EINA_UNUSED) |
133 | { | 144 | { |
134 | } | 145 | } |
diff --git a/src/tests/eolian_cxx/generic.eo b/src/tests/eolian_cxx/generic.eo index cf7aa3b31e..327aafd9af 100644 --- a/src/tests/eolian_cxx/generic.eo +++ b/src/tests/eolian_cxx/generic.eo | |||
@@ -1,10 +1,16 @@ | |||
1 | 1 | ||
2 | struct Generic.Event | 2 | struct @beta Generic.Beta_Event |
3 | { | 3 | { |
4 | field1: int; | 4 | field1: int; |
5 | field2: list<string>; | 5 | field2: list<string>; |
6 | } | 6 | } |
7 | 7 | ||
8 | struct Generic.Event | ||
9 | { | ||
10 | field1: int; | ||
11 | field2: array<string>; | ||
12 | } | ||
13 | |||
8 | class Generic extends Efl.Object implements Generic_Interface | 14 | class Generic extends Efl.Object implements Generic_Interface |
9 | { | 15 | { |
10 | data: Generic_Data; | 16 | data: Generic_Data; |
@@ -87,6 +93,8 @@ class Generic extends Efl.Object implements Generic_Interface | |||
87 | } | 93 | } |
88 | call_event5 { | 94 | call_event5 { |
89 | } | 95 | } |
96 | call_event6 { | ||
97 | } | ||
90 | 98 | ||
91 | protected_method1 @protected { | 99 | protected_method1 @protected { |
92 | } | 100 | } |
@@ -129,7 +137,8 @@ class Generic extends Efl.Object implements Generic_Interface | |||
129 | prefix,event2: Generic; | 137 | prefix,event2: Generic; |
130 | prefix,event3: int; | 138 | prefix,event3: int; |
131 | prefix,event4: const(array<string>); | 139 | prefix,event4: const(array<string>); |
132 | prefix,event5: Generic.Event; | 140 | prefix,event5 @beta: Generic.Beta_Event; |
141 | prefix,event6: Generic.Event; | ||
133 | protected,event1 @protected: void; | 142 | protected,event1 @protected: void; |
134 | beta,event1 @beta: void; | 143 | beta,event1 @beta: void; |
135 | protected,beta,event1 @beta @protected: void; | 144 | protected,beta,event1 @beta @protected: void; |