diff options
Diffstat (limited to 'src/tests')
58 files changed, 632 insertions, 642 deletions
diff --git a/src/tests/ecore/ecore_test_animator.c b/src/tests/ecore/ecore_test_animator.c index 98c7192..e2f17bc 100644 --- a/src/tests/ecore/ecore_test_animator.c +++ b/src/tests/ecore/ecore_test_animator.c | |||
@@ -30,7 +30,7 @@ START_TEST(ecore_test_animators) | |||
30 | fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); | 30 | fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); |
31 | 31 | ||
32 | ecore_animator_frametime_set(interval1); | 32 | ecore_animator_frametime_set(interval1); |
33 | animator = eo_add(ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(1, _anim_cb, &interval1)); | 33 | animator = eo_add(ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(eoid, 1, _anim_cb, &interval1)); |
34 | 34 | ||
35 | fail_if(!animator); | 35 | fail_if(!animator); |
36 | 36 | ||
@@ -38,7 +38,7 @@ START_TEST(ecore_test_animators) | |||
38 | 38 | ||
39 | ecore_animator_frametime_set(interval2); | 39 | ecore_animator_frametime_set(interval2); |
40 | prev = 0; | 40 | prev = 0; |
41 | animator = eo_add(ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(1, _anim_cb, &interval2)); | 41 | animator = eo_add(ECORE_ANIMATOR_CLASS, NULL, ecore_animator_timeline_constructor(eoid, 1, _anim_cb, &interval2)); |
42 | fail_if(!animator); | 42 | fail_if(!animator); |
43 | 43 | ||
44 | ecore_main_loop_begin(); | 44 | ecore_main_loop_begin(); |
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c index fe2f325..0240903 100644 --- a/src/tests/ecore/ecore_test_ecore_audio.c +++ b/src/tests/ecore/ecore_test_ecore_audio.c | |||
@@ -34,7 +34,7 @@ static Eina_Bool _finished_cb(void *data EINA_UNUSED, const Eo_Event *event EINA | |||
34 | 34 | ||
35 | static Eina_Bool _looped_cb(void *data EINA_UNUSED, const Eo_Event *event) | 35 | static Eina_Bool _looped_cb(void *data EINA_UNUSED, const Eo_Event *event) |
36 | { | 36 | { |
37 | eo_do(event->obj, ecore_audio_obj_in_looped_set(EINA_FALSE)); | 37 | ecore_audio_obj_in_looped_set(event->obj, EINA_FALSE); |
38 | 38 | ||
39 | return EINA_TRUE; | 39 | return EINA_TRUE; |
40 | } | 40 | } |
@@ -47,10 +47,10 @@ _seek_vol(void *data) | |||
47 | Eo *in = data; | 47 | Eo *in = data; |
48 | Eo *out = NULL; | 48 | Eo *out = NULL; |
49 | 49 | ||
50 | eo_do(in, out = ecore_audio_obj_in_output_get()); | 50 | out = ecore_audio_obj_in_output_get(in); |
51 | 51 | ||
52 | eo_do(out, ecore_audio_obj_volume_set(0.4)); | 52 | ecore_audio_obj_volume_set(out, 0.4); |
53 | eo_do(in, len = ecore_audio_obj_in_seek(-0.3, SEEK_END)); | 53 | len = ecore_audio_obj_in_seek(in, -0.3, SEEK_END); |
54 | fail_if(len < 0); | 54 | fail_if(len < 0); |
55 | 55 | ||
56 | return EINA_FALSE; | 56 | return EINA_FALSE; |
@@ -65,8 +65,8 @@ START_TEST(ecore_test_ecore_audio_obj_pulse) | |||
65 | in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); | 65 | in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); |
66 | fail_if(!in); | 66 | fail_if(!in); |
67 | 67 | ||
68 | eo_do(in, ecore_audio_obj_name_set("modem.wav")); | 68 | ecore_audio_obj_name_set(in, "modem.wav"); |
69 | eo_do(in, ret = ecore_audio_obj_source_set(TESTS_SRC_DIR"/modem.wav")); | 69 | ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/modem.wav"); |
70 | fail_if(!ret); | 70 | fail_if(!ret); |
71 | 71 | ||
72 | out = eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL); | 72 | out = eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL); |
@@ -74,10 +74,10 @@ START_TEST(ecore_test_ecore_audio_obj_pulse) | |||
74 | 74 | ||
75 | ecore_timer_add(0.3, _seek_vol, in); | 75 | ecore_timer_add(0.3, _seek_vol, in); |
76 | 76 | ||
77 | eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL)); | 77 | eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL); |
78 | eo_do(out, eo_event_callback_add(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _failed_cb, &pulse_context_failed)); | 78 | eo_event_callback_add(out, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, _failed_cb, &pulse_context_failed); |
79 | 79 | ||
80 | eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); | 80 | ret = ecore_audio_obj_out_input_attach(out, in); |
81 | fail_if(!ret); | 81 | fail_if(!ret); |
82 | 82 | ||
83 | ecore_main_loop_begin(); | 83 | ecore_main_loop_begin(); |
@@ -114,17 +114,17 @@ START_TEST(ecore_test_ecore_audio_cleanup) | |||
114 | 114 | ||
115 | in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); | 115 | in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); |
116 | fail_if(!in); | 116 | fail_if(!in); |
117 | eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq)); | 117 | eo_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq); |
118 | eo_do(in, ecore_audio_obj_in_length_set(2)); | 118 | ecore_audio_obj_in_length_set(in, 2); |
119 | 119 | ||
120 | out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); | 120 | out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); |
121 | fail_if(!out); | 121 | fail_if(!out); |
122 | eo_do(out, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG)); | 122 | ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_OGG); |
123 | fail_if(!ret); | 123 | fail_if(!ret); |
124 | eo_do(out, ret = ecore_audio_obj_source_set(TESTS_BUILD_DIR"/tmp.ogg")); | 124 | ret = ecore_audio_obj_source_set(out, TESTS_BUILD_DIR"/tmp.ogg"); |
125 | fail_if(!ret); | 125 | fail_if(!ret); |
126 | 126 | ||
127 | eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); | 127 | ret = ecore_audio_obj_out_input_attach(out, in); |
128 | fail_if(!ret); | 128 | fail_if(!ret); |
129 | 129 | ||
130 | ecore_idler_add(_idle_del, in); | 130 | ecore_idler_add(_idle_del, in); |
@@ -146,75 +146,75 @@ START_TEST(ecore_test_ecore_audio_obj_tone) | |||
146 | in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); | 146 | in = eo_add(ECORE_AUDIO_IN_TONE_CLASS, NULL); |
147 | fail_if(!in); | 147 | fail_if(!in); |
148 | 148 | ||
149 | eo_do(in, ecore_audio_obj_name_set("tone")); | 149 | ecore_audio_obj_name_set(in, "tone"); |
150 | 150 | ||
151 | eo_do(in, channel = ecore_audio_obj_in_channels_get()); | 151 | channel = ecore_audio_obj_in_channels_get(in); |
152 | fail_if(channel != 1); | 152 | fail_if(channel != 1); |
153 | eo_do(in, rate = ecore_audio_obj_in_samplerate_get()); | 153 | rate = ecore_audio_obj_in_samplerate_get(in); |
154 | fail_if(rate != 44100); | 154 | fail_if(rate != 44100); |
155 | eo_do(in, len = ecore_audio_obj_in_length_get()); | 155 | len = ecore_audio_obj_in_length_get(in); |
156 | fail_if(len != 1); | 156 | fail_if(len != 1); |
157 | 157 | ||
158 | eo_do(in, ecore_audio_obj_in_length_set(2.5)); | 158 | ecore_audio_obj_in_length_set(in, 2.5); |
159 | eo_do(in, len = ecore_audio_obj_in_length_get()); | 159 | len = ecore_audio_obj_in_length_get(in); |
160 | fail_if(len != 2.5); | 160 | fail_if(len != 2.5); |
161 | 161 | ||
162 | eo_do(in, ecore_audio_obj_in_looped_set(EINA_TRUE)); | 162 | ecore_audio_obj_in_looped_set(in, EINA_TRUE); |
163 | 163 | ||
164 | eo_do(in, len = ecore_audio_obj_in_remaining_get()); | 164 | len = ecore_audio_obj_in_remaining_get(in); |
165 | fail_if(len != 2.5); | 165 | fail_if(len != 2.5); |
166 | 166 | ||
167 | eo_do(in, freq = (intptr_t) eo_key_data_get(ECORE_AUDIO_ATTR_TONE_FREQ)); | 167 | freq = (intptr_t) eo_key_data_get(in, ECORE_AUDIO_ATTR_TONE_FREQ); |
168 | fail_if(freq != 1000); | 168 | fail_if(freq != 1000); |
169 | 169 | ||
170 | freq = 2000; | 170 | freq = 2000; |
171 | eo_do(in, eo_key_data_set(ECORE_AUDIO_ATTR_TONE_FREQ, &freq)); | 171 | eo_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq); |
172 | 172 | ||
173 | eo_do(in, freq = (intptr_t) eo_key_data_get(ECORE_AUDIO_ATTR_TONE_FREQ)); | 173 | freq = (intptr_t) eo_key_data_get(in, ECORE_AUDIO_ATTR_TONE_FREQ); |
174 | fail_if(freq != 2000); | 174 | fail_if(freq != 2000); |
175 | 175 | ||
176 | eo_do(in, eo_key_data_set("foo", "bar")); | 176 | eo_key_data_set(in, "foo", "bar"); |
177 | eo_do(in, tmp = eo_key_data_get("foo")); | 177 | tmp = eo_key_data_get(in, "foo"); |
178 | ck_assert_str_eq(tmp, "bar"); | 178 | ck_assert_str_eq(tmp, "bar"); |
179 | 179 | ||
180 | eo_do(in, len = ecore_audio_obj_in_seek(5.0, SEEK_SET)); | 180 | len = ecore_audio_obj_in_seek(in, 5.0, SEEK_SET); |
181 | fail_if(len != -1); | 181 | fail_if(len != -1); |
182 | 182 | ||
183 | eo_do(in, len = ecore_audio_obj_in_seek(1.0, 42)); | 183 | len = ecore_audio_obj_in_seek(in, 1.0, 42); |
184 | fail_if(len != -1); | 184 | fail_if(len != -1); |
185 | 185 | ||
186 | eo_do(in, len = ecore_audio_obj_in_seek(1.0, SEEK_SET)); | 186 | len = ecore_audio_obj_in_seek(in, 1.0, SEEK_SET); |
187 | fail_if(len != 1.0); | 187 | fail_if(len != 1.0); |
188 | 188 | ||
189 | eo_do(in, len = ecore_audio_obj_in_remaining_get()); | 189 | len = ecore_audio_obj_in_remaining_get(in); |
190 | fail_if(len != 1.5); | 190 | fail_if(len != 1.5); |
191 | 191 | ||
192 | eo_do(in, len = ecore_audio_obj_in_seek(1.0, SEEK_CUR)); | 192 | len = ecore_audio_obj_in_seek(in, 1.0, SEEK_CUR); |
193 | fail_if(len != 2.0); | 193 | fail_if(len != 2.0); |
194 | 194 | ||
195 | eo_do(in, len = ecore_audio_obj_in_remaining_get()); | 195 | len = ecore_audio_obj_in_remaining_get(in); |
196 | fail_if(len != 0.5); | 196 | fail_if(len != 0.5); |
197 | 197 | ||
198 | eo_do(in, len = ecore_audio_obj_in_seek(-1.0, SEEK_END)); | 198 | len = ecore_audio_obj_in_seek(in, -1.0, SEEK_END); |
199 | fail_if(len != 1.5); | 199 | fail_if(len != 1.5); |
200 | 200 | ||
201 | eo_do(in, len = ecore_audio_obj_in_remaining_get()); | 201 | len = ecore_audio_obj_in_remaining_get(in); |
202 | fail_if(len != 1.0); | 202 | fail_if(len != 1.0); |
203 | 203 | ||
204 | out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); | 204 | out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); |
205 | fail_if(!out); | 205 | fail_if(!out); |
206 | 206 | ||
207 | eo_do(out, ecore_audio_obj_name_set("tmp.wav")); | 207 | ecore_audio_obj_name_set(out, "tmp.wav"); |
208 | eo_do(out, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_WAV)); | 208 | ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_WAV); |
209 | fail_if(!ret); | 209 | fail_if(!ret); |
210 | eo_do(out, ret = ecore_audio_obj_source_set(TESTS_BUILD_DIR"/tmp.wav")); | 210 | ret = ecore_audio_obj_source_set(out, TESTS_BUILD_DIR"/tmp.wav"); |
211 | fail_if(!ret); | 211 | fail_if(!ret); |
212 | 212 | ||
213 | eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); | 213 | ret = ecore_audio_obj_out_input_attach(out, in); |
214 | fail_if(!ret); | 214 | fail_if(!ret); |
215 | 215 | ||
216 | eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_LOOPED, _looped_cb, NULL)); | 216 | eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_LOOPED, _looped_cb, NULL); |
217 | eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL)); | 217 | eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL); |
218 | 218 | ||
219 | ecore_main_loop_begin(); | 219 | ecore_main_loop_begin(); |
220 | 220 | ||
@@ -238,73 +238,73 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile) | |||
238 | in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); | 238 | in = eo_add(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); |
239 | fail_if(!in); | 239 | fail_if(!in); |
240 | 240 | ||
241 | eo_do(in, fmt = ecore_audio_obj_format_get()); | 241 | fmt = ecore_audio_obj_format_get(in); |
242 | fail_if(fmt != ECORE_AUDIO_FORMAT_AUTO); | 242 | fail_if(fmt != ECORE_AUDIO_FORMAT_AUTO); |
243 | 243 | ||
244 | eo_do(in, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_FLAC)); | 244 | ret = ecore_audio_obj_format_set(in, ECORE_AUDIO_FORMAT_FLAC); |
245 | fail_if(!ret); | 245 | fail_if(!ret); |
246 | 246 | ||
247 | eo_do(in, fmt = ecore_audio_obj_format_get()); | 247 | fmt = ecore_audio_obj_format_get(in); |
248 | fail_if(fmt != ECORE_AUDIO_FORMAT_FLAC); | 248 | fail_if(fmt != ECORE_AUDIO_FORMAT_FLAC); |
249 | 249 | ||
250 | eo_do(in, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_AUTO)); | 250 | ret = ecore_audio_obj_format_set(in, ECORE_AUDIO_FORMAT_AUTO); |
251 | fail_if(!ret); | 251 | fail_if(!ret); |
252 | 252 | ||
253 | eo_do(in, ecore_audio_obj_name_set("sms.ogg")); | 253 | ecore_audio_obj_name_set(in, "sms.ogg"); |
254 | eo_do(in, ret = ecore_audio_obj_source_set(TESTS_SRC_DIR"/sms.ogg")); | 254 | ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/sms.ogg"); |
255 | fail_if(!ret); | 255 | fail_if(!ret); |
256 | 256 | ||
257 | eo_do(in, src = ecore_audio_obj_source_get()); | 257 | src = ecore_audio_obj_source_get(in); |
258 | ck_assert_str_eq(src, TESTS_SRC_DIR"/sms.ogg"); | 258 | ck_assert_str_eq(src, TESTS_SRC_DIR"/sms.ogg"); |
259 | 259 | ||
260 | eo_do(in, fmt = ecore_audio_obj_format_get()); | 260 | fmt = ecore_audio_obj_format_get(in); |
261 | fail_if(fmt != ECORE_AUDIO_FORMAT_OGG); | 261 | fail_if(fmt != ECORE_AUDIO_FORMAT_OGG); |
262 | 262 | ||
263 | eo_do(in, channel = ecore_audio_obj_in_channels_get()); | 263 | channel = ecore_audio_obj_in_channels_get(in); |
264 | fail_if(channel != 2); | 264 | fail_if(channel != 2); |
265 | eo_do(in, rate = ecore_audio_obj_in_samplerate_get()); | 265 | rate = ecore_audio_obj_in_samplerate_get(in); |
266 | fail_if(rate != 44100); | 266 | fail_if(rate != 44100); |
267 | eo_do(in, len = ecore_audio_obj_in_length_get()); | 267 | len = ecore_audio_obj_in_length_get(in); |
268 | fail_if(len == 0); | 268 | fail_if(len == 0); |
269 | eo_do(in, rem = ecore_audio_obj_in_remaining_get()); | 269 | rem = ecore_audio_obj_in_remaining_get(in); |
270 | fail_if(len != rem); | 270 | fail_if(len != rem); |
271 | 271 | ||
272 | eo_do(in, fmt = ecore_audio_obj_format_get()); | 272 | fmt = ecore_audio_obj_format_get(in); |
273 | fail_if(fmt != ECORE_AUDIO_FORMAT_OGG); | 273 | fail_if(fmt != ECORE_AUDIO_FORMAT_OGG); |
274 | 274 | ||
275 | eo_do(in, len = ecore_audio_obj_in_seek(0.5, SEEK_SET)); | 275 | len = ecore_audio_obj_in_seek(in, 0.5, SEEK_SET); |
276 | fail_if(len != 0.5); | 276 | fail_if(len != 0.5); |
277 | 277 | ||
278 | eo_do(in, len = ecore_audio_obj_in_seek(0.5, SEEK_CUR)); | 278 | len = ecore_audio_obj_in_seek(in, 0.5, SEEK_CUR); |
279 | fail_if(len != 1.0); | 279 | fail_if(len != 1.0); |
280 | 280 | ||
281 | eo_do(in, len = ecore_audio_obj_in_seek(-1.0, SEEK_END)); | 281 | len = ecore_audio_obj_in_seek(in, -1.0, SEEK_END); |
282 | fail_if(fabs(rem - 1 - len) > 0.1); | 282 | fail_if(fabs(rem - 1 - len) > 0.1); |
283 | 283 | ||
284 | out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); | 284 | out = eo_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); |
285 | fail_if(!out); | 285 | fail_if(!out); |
286 | 286 | ||
287 | eo_do(out, ecore_audio_obj_name_set("tmp.wav")); | 287 | ecore_audio_obj_name_set(out, "tmp.wav"); |
288 | eo_do(out, ret = ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_WAV)); | 288 | ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_WAV); |
289 | fail_if(!ret); | 289 | fail_if(!ret); |
290 | 290 | ||
291 | eo_do(out, fmt = ecore_audio_obj_format_get()); | 291 | fmt = ecore_audio_obj_format_get(out); |
292 | fail_if(fmt != ECORE_AUDIO_FORMAT_WAV); | 292 | fail_if(fmt != ECORE_AUDIO_FORMAT_WAV); |
293 | 293 | ||
294 | 294 | ||
295 | // eo_do(out, ret = ecore_audio_obj_source_set("/tmp/file/does/not/exist/hopefully.wav")); | 295 | // ret = ecore_audio_obj_source_set(out, "/tmp/file/does/not/exist/hopefully.wav"); |
296 | // fail_if(ret); | 296 | // fail_if(ret); |
297 | 297 | ||
298 | eo_do(out, ret = ecore_audio_obj_source_set(TESTS_BUILD_DIR"/tmp.wav")); | 298 | ret = ecore_audio_obj_source_set(out, TESTS_BUILD_DIR"/tmp.wav"); |
299 | fail_if(!ret); | 299 | fail_if(!ret); |
300 | 300 | ||
301 | eo_do(out, src = ecore_audio_obj_source_get()); | 301 | src = ecore_audio_obj_source_get(out); |
302 | ck_assert_str_eq(src, TESTS_BUILD_DIR"/tmp.wav"); | 302 | ck_assert_str_eq(src, TESTS_BUILD_DIR"/tmp.wav"); |
303 | 303 | ||
304 | eo_do(out, ret = ecore_audio_obj_out_input_attach(in)); | 304 | ret = ecore_audio_obj_out_input_attach(out, in); |
305 | fail_if(!ret); | 305 | fail_if(!ret); |
306 | 306 | ||
307 | eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL)); | 307 | eo_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _finished_cb, NULL); |
308 | 308 | ||
309 | ecore_main_loop_begin(); | 309 | ecore_main_loop_begin(); |
310 | 310 | ||
@@ -330,47 +330,47 @@ START_TEST(ecore_test_ecore_audio_obj_in_out) | |||
330 | fail_if(!in2); | 330 | fail_if(!in2); |
331 | fail_if(!out); | 331 | fail_if(!out); |
332 | 332 | ||
333 | eo_do(in, out2 = ecore_audio_obj_in_output_get()); | 333 | out2 = ecore_audio_obj_in_output_get(in); |
334 | 334 | ||
335 | fail_if(out2); | 335 | fail_if(out2); |
336 | 336 | ||
337 | eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); | 337 | in3 = ecore_audio_obj_out_inputs_get(out); |
338 | 338 | ||
339 | fail_if(eina_list_count(in3) != 0); | 339 | fail_if(eina_list_count(in3) != 0); |
340 | 340 | ||
341 | eo_do(out, attached = ecore_audio_obj_out_input_attach(in)); | 341 | attached = ecore_audio_obj_out_input_attach(out, in); |
342 | fail_if(!attached); | 342 | fail_if(!attached); |
343 | 343 | ||
344 | eo_do(out, attached = ecore_audio_obj_out_input_attach(in)); | 344 | attached = ecore_audio_obj_out_input_attach(out, in); |
345 | fail_if(attached); | 345 | fail_if(attached); |
346 | 346 | ||
347 | eo_do(in, out2 = ecore_audio_obj_in_output_get()); | 347 | out2 = ecore_audio_obj_in_output_get(in); |
348 | 348 | ||
349 | fail_if(out2 != out); | 349 | fail_if(out2 != out); |
350 | 350 | ||
351 | eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); | 351 | in3 = ecore_audio_obj_out_inputs_get(out); |
352 | 352 | ||
353 | fail_if(eina_list_count(in3) != 1); | 353 | fail_if(eina_list_count(in3) != 1); |
354 | fail_if(eina_list_data_get(in3) != in); | 354 | fail_if(eina_list_data_get(in3) != in); |
355 | 355 | ||
356 | eo_do(out, attached = ecore_audio_obj_out_input_attach(in2)); | 356 | attached = ecore_audio_obj_out_input_attach(out, in2); |
357 | fail_if(!attached); | 357 | fail_if(!attached); |
358 | 358 | ||
359 | eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); | 359 | in3 = ecore_audio_obj_out_inputs_get(out); |
360 | 360 | ||
361 | fail_if(eina_list_count(in3) != 2); | 361 | fail_if(eina_list_count(in3) != 2); |
362 | fail_if(eina_list_data_get(in3) != in); | 362 | fail_if(eina_list_data_get(in3) != in); |
363 | 363 | ||
364 | eo_del(in2); | 364 | eo_del(in2); |
365 | 365 | ||
366 | eo_do(out, in3 = ecore_audio_obj_out_inputs_get()); | 366 | in3 = ecore_audio_obj_out_inputs_get(out); |
367 | 367 | ||
368 | fail_if(eina_list_count(in3) != 1); | 368 | fail_if(eina_list_count(in3) != 1); |
369 | fail_if(eina_list_data_get(in3) != in); | 369 | fail_if(eina_list_data_get(in3) != in); |
370 | 370 | ||
371 | eo_del(out); | 371 | eo_del(out); |
372 | 372 | ||
373 | eo_do(in, out2 = ecore_audio_obj_in_output_get()); | 373 | out2 = ecore_audio_obj_in_output_get(in); |
374 | 374 | ||
375 | fail_if(out2); | 375 | fail_if(out2); |
376 | 376 | ||
@@ -426,10 +426,10 @@ START_TEST(ecore_test_ecore_audio_obj_vio) | |||
426 | out = eo_add(ECORE_AUDIO_OUT_CLASS, NULL); | 426 | out = eo_add(ECORE_AUDIO_OUT_CLASS, NULL); |
427 | fail_if(!out); | 427 | fail_if(!out); |
428 | 428 | ||
429 | eo_do(in, ecore_audio_obj_vio_set(&in_vio, NULL, NULL)); | 429 | ecore_audio_obj_vio_set(in, &in_vio, NULL, NULL); |
430 | eo_do(out, ecore_audio_obj_vio_set(&out_vio, NULL, NULL)); | 430 | ecore_audio_obj_vio_set(out, &out_vio, NULL, NULL); |
431 | 431 | ||
432 | eo_do(out, ecore_audio_obj_out_input_attach(in)); | 432 | ecore_audio_obj_out_input_attach(out, in); |
433 | 433 | ||
434 | ecore_main_loop_begin(); | 434 | ecore_main_loop_begin(); |
435 | 435 | ||
@@ -462,71 +462,71 @@ START_TEST(ecore_test_ecore_audio_obj_in) | |||
462 | 462 | ||
463 | fail_if(!in); | 463 | fail_if(!in); |
464 | 464 | ||
465 | eo_do(in, ecore_audio_obj_vio_set(&vio, &freed, _myfree)); | 465 | ecore_audio_obj_vio_set(in, &vio, &freed, _myfree); |
466 | fail_if(freed); | 466 | fail_if(freed); |
467 | 467 | ||
468 | eo_do(in, ecore_audio_obj_vio_set(NULL, NULL, NULL)); | 468 | ecore_audio_obj_vio_set(in, NULL, NULL, NULL); |
469 | fail_if(!freed); | 469 | fail_if(!freed); |
470 | 470 | ||
471 | eo_do(in, speed = ecore_audio_obj_in_speed_get()); | 471 | speed = ecore_audio_obj_in_speed_get(in); |
472 | fail_if(speed != 1.0); | 472 | fail_if(speed != 1.0); |
473 | 473 | ||
474 | eo_do(in, ecore_audio_obj_in_speed_set(2.5)); | 474 | ecore_audio_obj_in_speed_set(in, 2.5); |
475 | 475 | ||
476 | eo_do(in, speed = ecore_audio_obj_in_speed_get()); | 476 | speed = ecore_audio_obj_in_speed_get(in); |
477 | fail_if(speed != 2.5); | 477 | fail_if(speed != 2.5); |
478 | 478 | ||
479 | eo_do(in, ecore_audio_obj_in_speed_set(0)); | 479 | ecore_audio_obj_in_speed_set(in, 0); |
480 | 480 | ||
481 | eo_do(in, speed = ecore_audio_obj_in_speed_get()); | 481 | speed = ecore_audio_obj_in_speed_get(in); |
482 | fail_if(speed != 0.2); | 482 | fail_if(speed != 0.2); |
483 | 483 | ||
484 | eo_do(in, ecore_audio_obj_in_speed_set(10)); | 484 | ecore_audio_obj_in_speed_set(in, 10); |
485 | 485 | ||
486 | eo_do(in, speed = ecore_audio_obj_in_speed_get()); | 486 | speed = ecore_audio_obj_in_speed_get(in); |
487 | fail_if(speed != 5.0); | 487 | fail_if(speed != 5.0); |
488 | 488 | ||
489 | eo_do(in, samplerate = ecore_audio_obj_in_samplerate_get()); | 489 | samplerate = ecore_audio_obj_in_samplerate_get(in); |
490 | fail_if(samplerate != 0); | 490 | fail_if(samplerate != 0); |
491 | 491 | ||
492 | eo_do(in, ecore_audio_obj_in_samplerate_set(1234)); | 492 | ecore_audio_obj_in_samplerate_set(in, 1234); |
493 | 493 | ||
494 | eo_do(in, samplerate = ecore_audio_obj_in_samplerate_get()); | 494 | samplerate = ecore_audio_obj_in_samplerate_get(in); |
495 | fail_if(samplerate != 1234); | 495 | fail_if(samplerate != 1234); |
496 | 496 | ||
497 | eo_do(in, channels = ecore_audio_obj_in_channels_get()); | 497 | channels = ecore_audio_obj_in_channels_get(in); |
498 | fail_if(channels != 0); | 498 | fail_if(channels != 0); |
499 | 499 | ||
500 | eo_do(in, ecore_audio_obj_in_channels_set(2)); | 500 | ecore_audio_obj_in_channels_set(in, 2); |
501 | 501 | ||
502 | eo_do(in, channels = ecore_audio_obj_in_channels_get()); | 502 | channels = ecore_audio_obj_in_channels_get(in); |
503 | fail_if(channels != 2); | 503 | fail_if(channels != 2); |
504 | 504 | ||
505 | eo_do(in, looped = ecore_audio_obj_in_looped_get()); | 505 | looped = ecore_audio_obj_in_looped_get(in); |
506 | fail_if(looped); | 506 | fail_if(looped); |
507 | 507 | ||
508 | eo_do(in, ecore_audio_obj_in_looped_set(EINA_TRUE)); | 508 | ecore_audio_obj_in_looped_set(in, EINA_TRUE); |
509 | 509 | ||
510 | eo_do(in, looped = ecore_audio_obj_in_looped_get()); | 510 | looped = ecore_audio_obj_in_looped_get(in); |
511 | fail_if(!looped); | 511 | fail_if(!looped); |
512 | 512 | ||
513 | eo_do(in, length = ecore_audio_obj_in_length_get()); | 513 | length = ecore_audio_obj_in_length_get(in); |
514 | fail_if(length != 0); | 514 | fail_if(length != 0); |
515 | 515 | ||
516 | eo_do(in, length = ecore_audio_obj_in_remaining_get()); | 516 | length = ecore_audio_obj_in_remaining_get(in); |
517 | fail_if(length != -1); | 517 | fail_if(length != -1); |
518 | 518 | ||
519 | memset(buf, 0xaa, 10); | 519 | memset(buf, 0xaa, 10); |
520 | eo_do(in, read = ecore_audio_obj_in_read(buf, 10)); | 520 | read = ecore_audio_obj_in_read(in, buf, 10); |
521 | fail_if(read != 0); | 521 | fail_if(read != 0); |
522 | 522 | ||
523 | for (i=0; i<10; i++) { | 523 | for (i=0; i<10; i++) { |
524 | fail_if(buf[i] != 0xaa); | 524 | fail_if(buf[i] != 0xaa); |
525 | } | 525 | } |
526 | 526 | ||
527 | eo_do(in, ecore_audio_obj_paused_set(EINA_TRUE)); | 527 | ecore_audio_obj_paused_set(in, EINA_TRUE); |
528 | 528 | ||
529 | eo_do(in, read = ecore_audio_obj_in_read(buf, 10)); | 529 | read = ecore_audio_obj_in_read(in, buf, 10); |
530 | fail_if(read != 10); | 530 | fail_if(read != 10); |
531 | 531 | ||
532 | for (i=0; i<10; i++) { | 532 | for (i=0; i<10; i++) { |
@@ -556,29 +556,29 @@ START_TEST(ecore_test_ecore_audio_obj) | |||
556 | 556 | ||
557 | fail_if(!obj); | 557 | fail_if(!obj); |
558 | 558 | ||
559 | eo_do(obj, name = ecore_audio_obj_name_get()); | 559 | name = ecore_audio_obj_name_get(obj); |
560 | 560 | ||
561 | fail_if(name); | 561 | fail_if(name); |
562 | 562 | ||
563 | eo_do(obj, ecore_audio_obj_name_set("In1")); | 563 | ecore_audio_obj_name_set(obj, "In1"); |
564 | eo_do(obj, name = ecore_audio_obj_name_get()); | 564 | name = ecore_audio_obj_name_get(obj); |
565 | 565 | ||
566 | ck_assert_str_eq(name, "In1"); | 566 | ck_assert_str_eq(name, "In1"); |
567 | 567 | ||
568 | eo_do(obj, ecore_audio_obj_name_get()); | 568 | ecore_audio_obj_name_get(obj); |
569 | 569 | ||
570 | eo_do(obj, paused = ecore_audio_obj_paused_get()); | 570 | paused = ecore_audio_obj_paused_get(obj); |
571 | fail_if(paused); | 571 | fail_if(paused); |
572 | 572 | ||
573 | eo_do(obj, ecore_audio_obj_paused_set(EINA_TRUE)); | 573 | ecore_audio_obj_paused_set(obj, EINA_TRUE); |
574 | eo_do(obj, paused = ecore_audio_obj_paused_get()); | 574 | paused = ecore_audio_obj_paused_get(obj); |
575 | fail_if(!paused); | 575 | fail_if(!paused); |
576 | 576 | ||
577 | eo_do(obj, volume = ecore_audio_obj_volume_get()); | 577 | volume = ecore_audio_obj_volume_get(obj); |
578 | fail_if(volume != 1.0); | 578 | fail_if(volume != 1.0); |
579 | 579 | ||
580 | eo_do(obj, ecore_audio_obj_volume_set(0.5)); | 580 | ecore_audio_obj_volume_set(obj, 0.5); |
581 | eo_do(obj, volume = ecore_audio_obj_volume_get()); | 581 | volume = ecore_audio_obj_volume_get(obj); |
582 | fail_if(volume != 0.5); | 582 | fail_if(volume != 0.5); |
583 | 583 | ||
584 | eo_del(obj); | 584 | eo_del(obj); |
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index b406bad..e28329f 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c | |||
@@ -192,15 +192,15 @@ START_TEST(edje_test_masking) | |||
192 | 192 | ||
193 | /* check value of no_render flag as seen from evas land */ | 193 | /* check value of no_render flag as seen from evas land */ |
194 | sub = edje_object_part_object_get(obj, "mask"); | 194 | sub = edje_object_part_object_get(obj, "mask"); |
195 | fail_if(!eo_do_ret(sub, b, evas_obj_no_render_get())); | 195 | fail_if(!evas_obj_no_render_get(sub)); |
196 | 196 | ||
197 | /* check that text has a clip (based on description.clip_to) */ | 197 | /* check that text has a clip (based on description.clip_to) */ |
198 | sub = edje_object_part_object_get(obj, "text"); | 198 | sub = edje_object_part_object_get(obj, "text"); |
199 | fail_if(!eo_do_ret(sub, clip2, evas_obj_clip_get())); | 199 | fail_if(!evas_obj_clip_get(sub)); |
200 | 200 | ||
201 | /* test description.clip_to override */ | 201 | /* test description.clip_to override */ |
202 | sub = edje_object_part_object_get(obj, "noclip"); | 202 | sub = edje_object_part_object_get(obj, "noclip"); |
203 | clip2 = eo_do_ret(sub, clip2, evas_obj_clip_get()); | 203 | clip2 = evas_obj_clip_get(sub); |
204 | fail_if(clip != clip2); | 204 | fail_if(clip != clip2); |
205 | 205 | ||
206 | EDJE_TEST_FREE_EVAS(); | 206 | EDJE_TEST_FREE_EVAS(); |
@@ -224,23 +224,23 @@ START_TEST(edje_test_filters) | |||
224 | 224 | ||
225 | /* check value of no_render flag as seen from evas land */ | 225 | /* check value of no_render flag as seen from evas land */ |
226 | sub = edje_object_part_object_get(obj, "mask"); | 226 | sub = edje_object_part_object_get(obj, "mask"); |
227 | fail_if(!eo_do_ret(sub, b, evas_obj_no_render_get())); | 227 | fail_if(!evas_obj_no_render_get(sub)); |
228 | 228 | ||
229 | /* check no_render inheritance */ | 229 | /* check no_render inheritance */ |
230 | sub = edje_object_part_object_get(obj, "mask2"); | 230 | sub = edje_object_part_object_get(obj, "mask2"); |
231 | fail_if(eo_do_ret(sub, b, evas_obj_no_render_get())); | 231 | fail_if(evas_obj_no_render_get(sub)); |
232 | sub = edje_object_part_object_get(obj, "mask3"); | 232 | sub = edje_object_part_object_get(obj, "mask3"); |
233 | fail_if(!eo_do_ret(sub, b, evas_obj_no_render_get())); | 233 | fail_if(!evas_obj_no_render_get(sub)); |
234 | 234 | ||
235 | /* text part: check filter status */ | 235 | /* text part: check filter status */ |
236 | text = edje_object_part_object_get(obj, "text"); | 236 | text = edje_object_part_object_get(obj, "text"); |
237 | fail_if(!text); | 237 | fail_if(!text); |
238 | 238 | ||
239 | eo_do(text, efl_gfx_filter_program_get(&prg, &name)); | 239 | efl_gfx_filter_program_get(text, &prg, &name); |
240 | fail_if(!prg); | 240 | fail_if(!prg); |
241 | fail_if(!name || strcmp(name, "filterfile")); | 241 | fail_if(!name || strcmp(name, "filterfile")); |
242 | 242 | ||
243 | eo_do(text, src = efl_gfx_filter_source_get("mask")); | 243 | src = efl_gfx_filter_source_get(text, "mask"); |
244 | fail_if(!src); | 244 | fail_if(!src); |
245 | 245 | ||
246 | // TODO: Verify properly that the filter runs well | 246 | // TODO: Verify properly that the filter runs well |
@@ -265,7 +265,7 @@ START_TEST(edje_test_snapshot) | |||
265 | 265 | ||
266 | /* check value of no_render flag as seen from evas land */ | 266 | /* check value of no_render flag as seen from evas land */ |
267 | sub = edje_object_part_object_get(obj, "snap"); | 267 | sub = edje_object_part_object_get(obj, "snap"); |
268 | fail_if(!eo_do_ret(sub, b, evas_obj_image_snapshot_get())); | 268 | fail_if(!evas_obj_image_snapshot_get(sub)); |
269 | 269 | ||
270 | // TODO: Verify that evas snapshot actually works (and has a filter) | 270 | // TODO: Verify that evas snapshot actually works (and has a filter) |
271 | 271 | ||
diff --git a/src/tests/eina_cxx/simple.c b/src/tests/eina_cxx/simple.c index 8a742e1..a40eb27 100644 --- a/src/tests/eina_cxx/simple.c +++ b/src/tests/eina_cxx/simple.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | static Eo *_simple_eo_base_constructor(Eo *obj, void *pd EINA_UNUSED) | 15 | static Eo *_simple_eo_base_constructor(Eo *obj, void *pd EINA_UNUSED) |
16 | { | 16 | { |
17 | return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 17 | return eo_constructor(eo_super(obj, MY_CLASS)); |
18 | } | 18 | } |
19 | 19 | ||
20 | #include "simple.eo.c" | 20 | #include "simple.eo.c" |
diff --git a/src/tests/eio/eio_model_test_file.c b/src/tests/eio/eio_model_test_file.c index 56e6dd6..5873d7a 100644 --- a/src/tests/eio/eio_model_test_file.c +++ b/src/tests/eio/eio_model_test_file.c | |||
@@ -84,26 +84,26 @@ _load_status_cb(void *data EINA_UNUSED, const Eo_Event *event) | |||
84 | char *str; | 84 | char *str; |
85 | 85 | ||
86 | printf("Model is Loaded\n"); | 86 | printf("Model is Loaded\n"); |
87 | eo_do(event->obj, status = efl_model_property_get("filename", &value_prop)); | 87 | status = efl_model_property_get(event->obj, "filename", &value_prop); |
88 | str = eina_value_to_string(value_prop); | 88 | str = eina_value_to_string(value_prop); |
89 | printf("efl_model_loaded filename %s, status=%d\n", str, status); | 89 | printf("efl_model_loaded filename %s, status=%d\n", str, status); |
90 | free(str); | 90 | free(str); |
91 | 91 | ||
92 | eo_do(event->obj, status = efl_model_property_get("size", &value_prop)); | 92 | status = efl_model_property_get(event->obj, "size", &value_prop); |
93 | str = eina_value_to_string(value_prop); | 93 | str = eina_value_to_string(value_prop); |
94 | printf("efl_model_loaded size %s, status=%d\n", str, status); | 94 | printf("efl_model_loaded size %s, status=%d\n", str, status); |
95 | free(str); | 95 | free(str); |
96 | 96 | ||
97 | eo_do(event->obj, status = efl_model_property_get("mtime", &value_prop)); | 97 | status = efl_model_property_get(event->obj, "mtime", &value_prop); |
98 | str = eina_value_to_string(value_prop); | 98 | str = eina_value_to_string(value_prop); |
99 | printf("efl_model_loaded mtime %s, status=%d\n", str, status); | 99 | printf("efl_model_loaded mtime %s, status=%d\n", str, status); |
100 | free(str); | 100 | free(str); |
101 | 101 | ||
102 | eo_do(event->obj, efl_model_children_count_get(&total)); | 102 | efl_model_children_count_get(event->obj, &total); |
103 | printf("efl_model_test count %d\n", (int)total); | 103 | printf("efl_model_test count %d\n", (int)total); |
104 | 104 | ||
105 | /**< get full list */ | 105 | /**< get full list */ |
106 | eo_do(event->obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor)); | 106 | status = efl_model_children_slice_get(event->obj, 0, 0, (Eina_Accessor **)&accessor); |
107 | eina_accessor_free(accessor); | 107 | eina_accessor_free(accessor); |
108 | ecore_main_loop_quit(); | 108 | ecore_main_loop_quit(); |
109 | } | 109 | } |
@@ -143,7 +143,7 @@ _children_count_cb(void *data EINA_UNUSED, const Eo_Event *event) | |||
143 | fprintf(stdout, "Children count number=%d\n", *len); | 143 | fprintf(stdout, "Children count number=%d\n", *len); |
144 | reqs.children = *len; | 144 | reqs.children = *len; |
145 | 145 | ||
146 | eo_do(event->obj, efl_model_children_count_get(&total)); | 146 | efl_model_children_count_get(event->obj, &total); |
147 | fprintf(stdout, "New total children count number=%d\n", *len); | 147 | fprintf(stdout, "New total children count number=%d\n", *len); |
148 | 148 | ||
149 | return EINA_TRUE; | 149 | return EINA_TRUE; |
@@ -165,27 +165,27 @@ START_TEST(eio_model_test_test_file) | |||
165 | fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); | 165 | fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); |
166 | fail_if(!eio_init(), "ERROR: Cannot init EIO!\n"); | 166 | fail_if(!eio_init(), "ERROR: Cannot init EIO!\n"); |
167 | 167 | ||
168 | filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(EFL_MODEL_TEST_FILENAME_PATH)); | 168 | filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eoid, EFL_MODEL_TEST_FILENAME_PATH)); |
169 | fail_if(!filemodel, "ERROR: Cannot init model!\n"); | 169 | fail_if(!filemodel, "ERROR: Cannot init model!\n"); |
170 | 170 | ||
171 | eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_status_cb, NULL)); | 171 | eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_status_cb, NULL); |
172 | eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, _properties_change_cb, NULL)); | 172 | eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, _properties_change_cb, NULL); |
173 | eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL)); | 173 | eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL); |
174 | 174 | ||
175 | eo_do(filemodel, efl_model_load()); | 175 | efl_model_load(filemodel); |
176 | 176 | ||
177 | handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL); | 177 | handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL); |
178 | 178 | ||
179 | ecore_main_loop_begin(); | 179 | ecore_main_loop_begin(); |
180 | 180 | ||
181 | eo_do(filemodel, status = efl_model_property_get("filename", &value_prop)); | 181 | status = efl_model_property_get(filemodel, "filename", &value_prop); |
182 | str = eina_value_to_string(value_prop); | 182 | str = eina_value_to_string(value_prop); |
183 | printf("efl_model_test filename %s, load status %d\n", str, status); | 183 | printf("efl_model_test filename %s, load status %d\n", str, status); |
184 | 184 | ||
185 | free(str); | 185 | free(str); |
186 | 186 | ||
187 | i = 0; | 187 | i = 0; |
188 | eo_do(filemodel, efl_model_properties_get(&properties_list)); | 188 | efl_model_properties_get(filemodel, &properties_list); |
189 | EINA_ARRAY_ITER_NEXT(properties_list, i, str, iterator) | 189 | EINA_ARRAY_ITER_NEXT(properties_list, i, str, iterator) |
190 | { | 190 | { |
191 | fprintf(stdout, "Returned property list %d: %s\n", i, str); | 191 | fprintf(stdout, "Returned property list %d: %s\n", i, str); |
diff --git a/src/tests/eio/eio_model_test_monitor_add.c b/src/tests/eio/eio_model_test_monitor_add.c index 4f26a8e..b718edd 100644 --- a/src/tests/eio/eio_model_test_monitor_add.c +++ b/src/tests/eio/eio_model_test_monitor_add.c | |||
@@ -29,7 +29,7 @@ _load_monitor_status_cb(void *data, const Eo_Event *event) | |||
29 | if (!(st->status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES)) | 29 | if (!(st->status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES)) |
30 | return EINA_TRUE; | 30 | return EINA_TRUE; |
31 | 31 | ||
32 | eo_do(event->obj, efl_model_property_get("path", &value_prop)); | 32 | efl_model_property_get(event->obj, "path", &value_prop); |
33 | fail_if(!value_prop, "ERROR: Cannot get property!\n"); | 33 | fail_if(!value_prop, "ERROR: Cannot get property!\n"); |
34 | 34 | ||
35 | str = eina_value_to_string(value_prop); | 35 | str = eina_value_to_string(value_prop); |
@@ -38,9 +38,9 @@ _load_monitor_status_cb(void *data, const Eo_Event *event) | |||
38 | if(temp_filename && strcmp(str, temp_filename) == 0) | 38 | if(temp_filename && strcmp(str, temp_filename) == 0) |
39 | { | 39 | { |
40 | fprintf(stderr, "is child that we want\n"); | 40 | fprintf(stderr, "is child that we want\n"); |
41 | eo_do(event->obj, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, data)); | 41 | eo_event_callback_del(event->obj, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, data); |
42 | children_added = EINA_TRUE; | 42 | children_added = EINA_TRUE; |
43 | eo_do(parent, efl_model_child_del(event->obj)); | 43 | efl_model_child_del(parent, event->obj); |
44 | } | 44 | } |
45 | 45 | ||
46 | return EINA_FALSE; | 46 | return EINA_FALSE; |
@@ -54,13 +54,13 @@ _children_removed_cb(void *data EINA_UNUSED, const Eo_Event *event) | |||
54 | Efl_Model_Children_Event* evt = event->event_info; | 54 | Efl_Model_Children_Event* evt = event->event_info; |
55 | 55 | ||
56 | Eina_Bool b; | 56 | Eina_Bool b; |
57 | eo_do(evt->child, b = efl_model_load_status_get() & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 57 | b = efl_model_load_status_get(evt->child); |
58 | if(b) | 58 | if(b) |
59 | { | 59 | { |
60 | const Eina_Value* value_prop = NULL; | 60 | const Eina_Value* value_prop = NULL; |
61 | const char* str = NULL; | 61 | const char* str = NULL; |
62 | 62 | ||
63 | eo_do(evt->child, efl_model_property_get("path", &value_prop)); | 63 | efl_model_property_get(evt->child, "path", &value_prop); |
64 | fail_if(!value_prop, "ERROR: Cannot get property!\n"); | 64 | fail_if(!value_prop, "ERROR: Cannot get property!\n"); |
65 | 65 | ||
66 | str = eina_value_to_string(value_prop); | 66 | str = eina_value_to_string(value_prop); |
@@ -79,8 +79,8 @@ _children_added_cb(void *data EINA_UNUSED, const Eo_Event *event) | |||
79 | if (evt == NULL) | 79 | if (evt == NULL) |
80 | return EINA_TRUE; | 80 | return EINA_TRUE; |
81 | 81 | ||
82 | eo_do(evt->child, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, event->obj)); | 82 | eo_event_callback_add(evt->child, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, event->obj); |
83 | eo_do(evt->child, efl_model_load()); | 83 | efl_model_load(evt->child); |
84 | 84 | ||
85 | return EINA_TRUE; | 85 | return EINA_TRUE; |
86 | } | 86 | } |
@@ -98,7 +98,7 @@ _children_count_cb(void *data EINA_UNUSED, const Eo_Event *event) | |||
98 | fprintf(stderr, "Children count number=%d\n", *len); | 98 | fprintf(stderr, "Children count number=%d\n", *len); |
99 | 99 | ||
100 | /**< get full list */ | 100 | /**< get full list */ |
101 | eo_do(event->obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor)); | 101 | status = efl_model_children_slice_get(event->obj, 0, 0, (Eina_Accessor **)&accessor); |
102 | if(accessor != NULL) | 102 | if(accessor != NULL) |
103 | { | 103 | { |
104 | EINA_ACCESSOR_FOREACH(accessor, i, child) {} | 104 | EINA_ACCESSOR_FOREACH(accessor, i, child) {} |
@@ -125,14 +125,14 @@ START_TEST(eio_model_test_test_monitor_add) | |||
125 | 125 | ||
126 | tmpdir = eina_environment_tmp_get(); | 126 | tmpdir = eina_environment_tmp_get(); |
127 | 127 | ||
128 | filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(tmpdir)); | 128 | filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eoid, tmpdir)); |
129 | fail_if(!filemodel, "ERROR: Cannot init model!\n"); | 129 | fail_if(!filemodel, "ERROR: Cannot init model!\n"); |
130 | 130 | ||
131 | eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILD_ADDED, _children_added_cb, NULL)); | 131 | eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILD_ADDED, _children_added_cb, NULL); |
132 | eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILD_REMOVED, _children_removed_cb, NULL)); | 132 | eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILD_REMOVED, _children_removed_cb, NULL); |
133 | eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL)); | 133 | eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL); |
134 | 134 | ||
135 | eo_do(filemodel, efl_model_load()); | 135 | efl_model_load(filemodel); |
136 | 136 | ||
137 | ecore_main_loop_begin(); | 137 | ecore_main_loop_begin(); |
138 | 138 | ||
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model.c b/src/tests/eldbus/eldbus_test_eldbus_model.c index adba9f5..5439217 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model.c | |||
@@ -24,9 +24,9 @@ _eo_event_quit_cb(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) | |||
24 | void | 24 | void |
25 | efl_model_wait_for_event(Eo *obj, const Eo_Event_Description* event) | 25 | efl_model_wait_for_event(Eo *obj, const Eo_Event_Description* event) |
26 | { | 26 | { |
27 | eo_do(obj, eo_event_callback_add(event, _eo_event_quit_cb, NULL)); | 27 | eo_event_callback_add(obj, event, _eo_event_quit_cb, NULL); |
28 | ecore_main_loop_begin(); | 28 | ecore_main_loop_begin(); |
29 | eo_do(obj, eo_event_callback_del(event, _eo_event_quit_cb, NULL)); | 29 | eo_event_callback_del(obj, event, _eo_event_quit_cb, NULL); |
30 | } | 30 | } |
31 | 31 | ||
32 | static Eina_Bool | 32 | static Eina_Bool |
@@ -49,13 +49,13 @@ void | |||
49 | efl_model_wait_for_load_status(Efl_Model_Base *efl_model, Efl_Model_Load_Status expected_status) | 49 | efl_model_wait_for_load_status(Efl_Model_Base *efl_model, Efl_Model_Load_Status expected_status) |
50 | { | 50 | { |
51 | Efl_Model_Load_Status actual_status; | 51 | Efl_Model_Load_Status actual_status; |
52 | eo_do(efl_model, actual_status = efl_model_load_status_get()); | 52 | actual_status = efl_model_load_status_get(efl_model); |
53 | if (expected_status == actual_status) | 53 | if (expected_status == actual_status) |
54 | return; | 54 | return; |
55 | 55 | ||
56 | eo_do(efl_model, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_quit_cb, (void*)expected_status)); | 56 | eo_event_callback_add(efl_model, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_quit_cb, (void*)expected_status); |
57 | ecore_main_loop_begin(); | 57 | ecore_main_loop_begin(); |
58 | eo_do(efl_model, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_quit_cb, (void*)expected_status)); | 58 | eo_event_callback_del(efl_model, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _event_load_status_quit_cb, (void*)expected_status); |
59 | } | 59 | } |
60 | 60 | ||
61 | Efl_Model_Base * | 61 | Efl_Model_Base * |
@@ -63,7 +63,7 @@ efl_model_nth_child_get(Efl_Model_Base *efl_model, unsigned int n) | |||
63 | { | 63 | { |
64 | Eina_Accessor *accessor; | 64 | Eina_Accessor *accessor; |
65 | Efl_Model_Load_Status status; | 65 | Efl_Model_Load_Status status; |
66 | eo_do(efl_model, status = efl_model_children_slice_get(n, 1, &accessor)); | 66 | status = efl_model_children_slice_get(efl_model, n, 1, &accessor); |
67 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 67 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
68 | ck_assert_ptr_ne(NULL, accessor); | 68 | ck_assert_ptr_ne(NULL, accessor); |
69 | Eo *child = NULL; | 69 | Eo *child = NULL; |
@@ -83,7 +83,7 @@ efl_model_first_child_get(Efl_Model_Base *efl_model) | |||
83 | void | 83 | void |
84 | efl_model_load_and_wait_for_load_status(Eo *obj, Efl_Model_Load_Status expected_status) | 84 | efl_model_load_and_wait_for_load_status(Eo *obj, Efl_Model_Load_Status expected_status) |
85 | { | 85 | { |
86 | eo_do(obj, efl_model_load()); | 86 | efl_model_load(obj); |
87 | efl_model_wait_for_load_status(obj, expected_status); | 87 | efl_model_wait_for_load_status(obj, expected_status); |
88 | } | 88 | } |
89 | 89 | ||
@@ -106,7 +106,7 @@ check_property(Eo *object, const char *property_name, const char *expected_value | |||
106 | { | 106 | { |
107 | Eina_Value const* property_value; | 107 | Eina_Value const* property_value; |
108 | Efl_Model_Load_Status status; | 108 | Efl_Model_Load_Status status; |
109 | eo_do(object, status = efl_model_property_get(property_name, &property_value)); | 109 | status = efl_model_property_get(object, property_name, &property_value); |
110 | ck_assert_msg(EFL_MODEL_LOAD_STATUS_ERROR != status, "Nonexistent property: %s", property_name); | 110 | ck_assert_msg(EFL_MODEL_LOAD_STATUS_ERROR != status, "Nonexistent property: %s", property_name); |
111 | ck_assert_ptr_ne(NULL, property_value); | 111 | ck_assert_ptr_ne(NULL, property_value); |
112 | char *actual_value = eina_value_to_string(property_value); | 112 | char *actual_value = eina_value_to_string(property_value); |
@@ -123,10 +123,7 @@ check_property(Eo *object, const char *property_name, const char *expected_value | |||
123 | Eo * | 123 | Eo * |
124 | create_connection(void) | 124 | create_connection(void) |
125 | { | 125 | { |
126 | Eo *connection = eo_add_ref(ELDBUS_MODEL_CONNECTION_CLASS, NULL, | 126 | Eo *connection = eo_add_ref(ELDBUS_MODEL_CONNECTION_CLASS, NULL, eldbus_model_connection_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE)); |
127 | eldbus_model_connection_constructor(ELDBUS_CONNECTION_TYPE_SESSION, | ||
128 | NULL, | ||
129 | EINA_FALSE)); | ||
130 | ck_assert_ptr_ne(NULL, connection); | 127 | ck_assert_ptr_ne(NULL, connection); |
131 | return connection; | 128 | return connection; |
132 | } | 129 | } |
@@ -142,12 +139,7 @@ create_and_load_connection(void) | |||
142 | Eo * | 139 | Eo * |
143 | create_object(void) | 140 | create_object(void) |
144 | { | 141 | { |
145 | Eo *object = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, | 142 | Eo *object = eo_add_ref(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, ELDBUS_FDO_BUS, ELDBUS_FDO_PATH)); |
146 | eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION, | ||
147 | NULL, | ||
148 | EINA_FALSE, | ||
149 | ELDBUS_FDO_BUS, | ||
150 | ELDBUS_FDO_PATH)); | ||
151 | ck_assert_ptr_ne(NULL, object); | 143 | ck_assert_ptr_ne(NULL, object); |
152 | return object; | 144 | return object; |
153 | } | 145 | } |
@@ -164,7 +156,7 @@ void | |||
164 | check_efl_model_load_status_get(Efl_Model_Base *efl_model, Efl_Model_Load_Status expected_load_status) | 156 | check_efl_model_load_status_get(Efl_Model_Base *efl_model, Efl_Model_Load_Status expected_load_status) |
165 | { | 157 | { |
166 | Efl_Model_Load_Status actual_load_status; | 158 | Efl_Model_Load_Status actual_load_status; |
167 | eo_do(efl_model, actual_load_status = efl_model_load_status_get()); | 159 | actual_load_status = efl_model_load_status_get(efl_model); |
168 | ck_assert_int_eq(expected_load_status, actual_load_status); | 160 | ck_assert_int_eq(expected_load_status, actual_load_status); |
169 | } | 161 | } |
170 | 162 | ||
@@ -172,7 +164,7 @@ void | |||
172 | check_efl_model_children_count_eq(Efl_Model_Base *efl_model, unsigned int expected_children_count) | 164 | check_efl_model_children_count_eq(Efl_Model_Base *efl_model, unsigned int expected_children_count) |
173 | { | 165 | { |
174 | unsigned int actual_children_count = 0; | 166 | unsigned int actual_children_count = 0; |
175 | eo_do(efl_model, efl_model_children_count_get(&actual_children_count)); | 167 | efl_model_children_count_get(efl_model, &actual_children_count); |
176 | ck_assert_int_eq(expected_children_count, actual_children_count); | 168 | ck_assert_int_eq(expected_children_count, actual_children_count); |
177 | } | 169 | } |
178 | 170 | ||
@@ -181,7 +173,7 @@ check_efl_model_children_count_ge(Efl_Model_Base *efl_model, unsigned int minimu | |||
181 | { | 173 | { |
182 | unsigned int actual_children_count = 0; | 174 | unsigned int actual_children_count = 0; |
183 | Efl_Model_Load_Status status; | 175 | Efl_Model_Load_Status status; |
184 | eo_do(efl_model, status = efl_model_children_count_get(&actual_children_count)); | 176 | status = efl_model_children_count_get(efl_model, &actual_children_count); |
185 | // A minimum count only exists if model have EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN | 177 | // A minimum count only exists if model have EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN |
186 | ck_assert((EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN & status) == EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 178 | ck_assert((EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN & status) == EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
187 | 179 | ||
@@ -193,13 +185,13 @@ check_efl_model_children_slice_get(Efl_Model_Base *efl_model) | |||
193 | { | 185 | { |
194 | unsigned int count = 0; | 186 | unsigned int count = 0; |
195 | Efl_Model_Load_Status status; | 187 | Efl_Model_Load_Status status; |
196 | eo_do(efl_model, status = efl_model_children_count_get(&count)); | 188 | status = efl_model_children_count_get(efl_model, &count); |
197 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 189 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
198 | ck_assert_msg(count, "There must be at least 1 child to test"); | 190 | ck_assert_msg(count, "There must be at least 1 child to test"); |
199 | 191 | ||
200 | // Test slice all | 192 | // Test slice all |
201 | Eina_Accessor *accessor; | 193 | Eina_Accessor *accessor; |
202 | eo_do(efl_model, status = efl_model_children_slice_get(0, 0, &accessor)); | 194 | status = efl_model_children_slice_get(efl_model, 0, 0, &accessor); |
203 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 195 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
204 | ck_assert_ptr_ne(NULL, accessor); | 196 | ck_assert_ptr_ne(NULL, accessor); |
205 | // Get first child | 197 | // Get first child |
@@ -221,7 +213,7 @@ check_efl_model_children_slice_get(Efl_Model_Base *efl_model) | |||
221 | 213 | ||
222 | // Test slice first child | 214 | // Test slice first child |
223 | Eo *child = NULL; | 215 | Eo *child = NULL; |
224 | eo_do(efl_model, status = efl_model_children_slice_get(1, 1, &accessor)); | 216 | status = efl_model_children_slice_get(efl_model, 1, 1, &accessor); |
225 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 217 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
226 | ck_assert_ptr_ne(NULL, accessor); | 218 | ck_assert_ptr_ne(NULL, accessor); |
227 | ret = eina_accessor_data_get(accessor, 0, (void**)&child); | 219 | ret = eina_accessor_data_get(accessor, 0, (void**)&child); |
@@ -233,7 +225,7 @@ check_efl_model_children_slice_get(Efl_Model_Base *efl_model) | |||
233 | eina_accessor_free(accessor); | 225 | eina_accessor_free(accessor); |
234 | 226 | ||
235 | // Test slice last child | 227 | // Test slice last child |
236 | eo_do(efl_model, status = efl_model_children_slice_get(count, 1, &accessor)); | 228 | status = efl_model_children_slice_get(efl_model, count, 1, &accessor); |
237 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 229 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
238 | ck_assert_ptr_ne(NULL, accessor); | 230 | ck_assert_ptr_ne(NULL, accessor); |
239 | ret = eina_accessor_data_get(accessor, 0, (void**)&child); | 231 | ret = eina_accessor_data_get(accessor, 0, (void**)&child); |
@@ -245,7 +237,7 @@ check_efl_model_children_slice_get(Efl_Model_Base *efl_model) | |||
245 | eina_accessor_free(accessor); | 237 | eina_accessor_free(accessor); |
246 | 238 | ||
247 | // Test slice nonexistent element | 239 | // Test slice nonexistent element |
248 | eo_do(efl_model, status = efl_model_children_slice_get(count + 1, 1, &accessor)); | 240 | status = efl_model_children_slice_get(efl_model, count + 1, 1, &accessor); |
249 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 241 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
250 | ck_assert_ptr_eq(NULL, accessor); | 242 | ck_assert_ptr_eq(NULL, accessor); |
251 | } | 243 | } |
@@ -284,7 +276,7 @@ START_TEST(proxy) | |||
284 | efl_model_load_and_wait_for_load_status(root, EFL_MODEL_LOAD_STATUS_LOADED); | 276 | efl_model_load_and_wait_for_load_status(root, EFL_MODEL_LOAD_STATUS_LOADED); |
285 | 277 | ||
286 | Eina_Accessor *accessor = NULL; | 278 | Eina_Accessor *accessor = NULL; |
287 | eo_do(root, efl_model_children_slice_get(0, 0, &accessor)); | 279 | efl_model_children_slice_get(root, 0, 0, &accessor); |
288 | ck_assert_ptr_ne(NULL, accessor); | 280 | ck_assert_ptr_ne(NULL, accessor); |
289 | 281 | ||
290 | unsigned int i; | 282 | unsigned int i; |
@@ -314,7 +306,7 @@ eldbus_model_proxy_from_object_get(Eldbus_Model_Object *object, const char *inte | |||
314 | { | 306 | { |
315 | Eina_Accessor *accessor; | 307 | Eina_Accessor *accessor; |
316 | Efl_Model_Load_Status status; | 308 | Efl_Model_Load_Status status; |
317 | eo_do(object, status = efl_model_children_slice_get(0, 0, &accessor)); | 309 | status = efl_model_children_slice_get(object, 0, 0, &accessor); |
318 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 310 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
319 | ck_assert_ptr_ne(NULL, accessor); | 311 | ck_assert_ptr_ne(NULL, accessor); |
320 | 312 | ||
@@ -323,7 +315,7 @@ eldbus_model_proxy_from_object_get(Eldbus_Model_Object *object, const char *inte | |||
323 | EINA_ACCESSOR_FOREACH(accessor, i, proxy) | 315 | EINA_ACCESSOR_FOREACH(accessor, i, proxy) |
324 | { | 316 | { |
325 | const char *name; | 317 | const char *name; |
326 | eo_do(proxy, name = eldbus_model_proxy_name_get()); | 318 | name = eldbus_model_proxy_name_get(proxy); |
327 | ck_assert_ptr_ne(NULL, name); | 319 | ck_assert_ptr_ne(NULL, name); |
328 | if (strcmp(name, interface_name) == 0) | 320 | if (strcmp(name, interface_name) == 0) |
329 | goto end; | 321 | goto end; |
@@ -340,7 +332,7 @@ _eldbus_model_arguments_from_proxy_get(Eldbus_Model_Proxy *proxy, const char *me | |||
340 | { | 332 | { |
341 | Eina_Accessor *accessor; | 333 | Eina_Accessor *accessor; |
342 | Efl_Model_Load_Status status; | 334 | Efl_Model_Load_Status status; |
343 | eo_do(proxy, status = efl_model_children_slice_get(0, 0, &accessor)); | 335 | status = efl_model_children_slice_get(proxy, 0, 0, &accessor); |
344 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 336 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
345 | ck_assert_ptr_ne(NULL, accessor); | 337 | ck_assert_ptr_ne(NULL, accessor); |
346 | 338 | ||
@@ -352,7 +344,7 @@ _eldbus_model_arguments_from_proxy_get(Eldbus_Model_Proxy *proxy, const char *me | |||
352 | continue; | 344 | continue; |
353 | 345 | ||
354 | const char *name; | 346 | const char *name; |
355 | eo_do(child, name = eldbus_model_arguments_name_get()); | 347 | name = eldbus_model_arguments_name_get(child); |
356 | ck_assert_ptr_ne(NULL, name); | 348 | ck_assert_ptr_ne(NULL, name); |
357 | if (strcmp(name, method_name) == 0) | 349 | if (strcmp(name, method_name) == 0) |
358 | goto end; | 350 | goto end; |
@@ -381,7 +373,7 @@ check_efl_model_property_int_eq(Efl_Model_Base *efl_model, const char *property, | |||
381 | { | 373 | { |
382 | Eina_Value const* property_value; | 374 | Eina_Value const* property_value; |
383 | Efl_Model_Load_Status status; | 375 | Efl_Model_Load_Status status; |
384 | eo_do(efl_model, status = efl_model_property_get(property, &property_value)); | 376 | status = efl_model_property_get(efl_model, property, &property_value); |
385 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 377 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
386 | ck_assert_ptr_ne(NULL, property_value); | 378 | ck_assert_ptr_ne(NULL, property_value); |
387 | 379 | ||
@@ -400,7 +392,7 @@ check_efl_model_property_int_set(Efl_Model_Base *efl_model, const char *property | |||
400 | eina_value_setup(&eina_value, EINA_VALUE_TYPE_INT); | 392 | eina_value_setup(&eina_value, EINA_VALUE_TYPE_INT); |
401 | eina_value_set(&eina_value, value); | 393 | eina_value_set(&eina_value, value); |
402 | Efl_Model_Load_Status status; | 394 | Efl_Model_Load_Status status; |
403 | eo_do(efl_model, status = efl_model_property_set(property, &eina_value)); | 395 | status = efl_model_property_set(efl_model, property, &eina_value); |
404 | eina_value_flush(&eina_value); | 396 | eina_value_flush(&eina_value); |
405 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 397 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
406 | } | 398 | } |
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c index ffcc795..f3b1915 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c | |||
@@ -43,7 +43,7 @@ START_TEST(properties_get) | |||
43 | { | 43 | { |
44 | Eina_Array *properties = NULL; | 44 | Eina_Array *properties = NULL; |
45 | Efl_Model_Load_Status status; | 45 | Efl_Model_Load_Status status; |
46 | eo_do(connection, status = efl_model_properties_get(&properties)); | 46 | status = efl_model_properties_get(connection, &properties); |
47 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 47 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
48 | ck_assert_ptr_ne(NULL, properties); | 48 | ck_assert_ptr_ne(NULL, properties); |
49 | 49 | ||
@@ -52,7 +52,7 @@ START_TEST(properties_get) | |||
52 | ck_assert_int_eq(expected_properties_count, actual_properties_count); | 52 | ck_assert_int_eq(expected_properties_count, actual_properties_count); |
53 | 53 | ||
54 | // Unloaded connection populates its properties | 54 | // Unloaded connection populates its properties |
55 | eo_do(unloaded_connection, status = efl_model_properties_get(&properties)); | 55 | status = efl_model_properties_get(unloaded_connection, &properties); |
56 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); | 56 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); |
57 | ck_assert_ptr_ne(NULL, properties); | 57 | ck_assert_ptr_ne(NULL, properties); |
58 | 58 | ||
@@ -65,12 +65,12 @@ START_TEST(property_get) | |||
65 | { | 65 | { |
66 | Eina_Value const* property_value; | 66 | Eina_Value const* property_value; |
67 | Efl_Model_Load_Status status; | 67 | Efl_Model_Load_Status status; |
68 | eo_do(connection, status = efl_model_property_get(UNIQUE_NAME_PROPERTY, &property_value)); | 68 | status = efl_model_property_get(connection, UNIQUE_NAME_PROPERTY, &property_value); |
69 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 69 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
70 | ck_assert_ptr_ne(NULL, property_value); | 70 | ck_assert_ptr_ne(NULL, property_value); |
71 | 71 | ||
72 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR | 72 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR |
73 | eo_do(connection, status = efl_model_property_get("nonexistent", &property_value)); | 73 | status = efl_model_property_get(connection, "nonexistent", &property_value); |
74 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 74 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
75 | } | 75 | } |
76 | END_TEST | 76 | END_TEST |
@@ -82,19 +82,19 @@ START_TEST(property_set) | |||
82 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); | 82 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); |
83 | eina_value_set(&value, 1); | 83 | eina_value_set(&value, 1); |
84 | Efl_Model_Load_Status status; | 84 | Efl_Model_Load_Status status; |
85 | eo_do(connection, status = efl_model_property_set("nonexistent", &value)); | 85 | status = efl_model_property_set(connection, "nonexistent", &value); |
86 | eina_value_flush(&value); | 86 | eina_value_flush(&value); |
87 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 87 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
88 | 88 | ||
89 | // UNIQUE_NAME_PROPERTY is read-only | 89 | // UNIQUE_NAME_PROPERTY is read-only |
90 | eo_do(connection, status = efl_model_property_set(UNIQUE_NAME_PROPERTY, &value)); | 90 | status = efl_model_property_set(connection, UNIQUE_NAME_PROPERTY, &value); |
91 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 91 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
92 | 92 | ||
93 | // The model must be loaded to be able to set its properties | 93 | // The model must be loaded to be able to set its properties |
94 | const char *expected_value = "unloaded"; | 94 | const char *expected_value = "unloaded"; |
95 | eina_value_setup(&value, EINA_VALUE_TYPE_STRING); | 95 | eina_value_setup(&value, EINA_VALUE_TYPE_STRING); |
96 | eina_value_set(&value, expected_value); | 96 | eina_value_set(&value, expected_value); |
97 | eo_do(unloaded_connection, status = efl_model_property_set(UNIQUE_NAME_PROPERTY, &value)); | 97 | status = efl_model_property_set(unloaded_connection, UNIQUE_NAME_PROPERTY, &value); |
98 | eina_value_flush(&value); | 98 | eina_value_flush(&value); |
99 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 99 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
100 | } | 100 | } |
@@ -120,7 +120,7 @@ START_TEST(children_slice_get) | |||
120 | // Unloaded connection must return EFL_MODEL_LOAD_STATUS_UNLOADED | 120 | // Unloaded connection must return EFL_MODEL_LOAD_STATUS_UNLOADED |
121 | Eina_Accessor *accessor; | 121 | Eina_Accessor *accessor; |
122 | Efl_Model_Load_Status status; | 122 | Efl_Model_Load_Status status; |
123 | eo_do(unloaded_connection, status = efl_model_children_slice_get(0, 0, &accessor)); | 123 | status = efl_model_children_slice_get(unloaded_connection, 0, 0, &accessor); |
124 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); | 124 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); |
125 | ck_assert_ptr_eq(NULL, accessor); | 125 | ck_assert_ptr_eq(NULL, accessor); |
126 | } | 126 | } |
@@ -129,7 +129,7 @@ END_TEST | |||
129 | START_TEST(unload) | 129 | START_TEST(unload) |
130 | { | 130 | { |
131 | check_efl_model_load_status_get(connection, EFL_MODEL_LOAD_STATUS_LOADED); | 131 | check_efl_model_load_status_get(connection, EFL_MODEL_LOAD_STATUS_LOADED); |
132 | eo_do(connection, efl_model_unload()); | 132 | efl_model_unload(connection); |
133 | check_efl_model_load_status_get(connection, EFL_MODEL_LOAD_STATUS_UNLOADED); | 133 | check_efl_model_load_status_get(connection, EFL_MODEL_LOAD_STATUS_UNLOADED); |
134 | 134 | ||
135 | check_efl_model_children_count_eq(connection, 0); | 135 | check_efl_model_children_count_eq(connection, 0); |
@@ -138,14 +138,14 @@ END_TEST | |||
138 | 138 | ||
139 | START_TEST(properties_load) | 139 | START_TEST(properties_load) |
140 | { | 140 | { |
141 | eo_do(unloaded_connection, efl_model_properties_load()); | 141 | efl_model_properties_load(unloaded_connection); |
142 | check_efl_model_load_status_get(unloaded_connection, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 142 | check_efl_model_load_status_get(unloaded_connection, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
143 | } | 143 | } |
144 | END_TEST | 144 | END_TEST |
145 | 145 | ||
146 | START_TEST(children_load) | 146 | START_TEST(children_load) |
147 | { | 147 | { |
148 | eo_do(unloaded_connection, efl_model_children_load()); | 148 | efl_model_children_load(unloaded_connection); |
149 | 149 | ||
150 | check_efl_model_load_status_get(unloaded_connection, EFL_MODEL_LOAD_STATUS_LOADING_CHILDREN); | 150 | check_efl_model_load_status_get(unloaded_connection, EFL_MODEL_LOAD_STATUS_LOADING_CHILDREN); |
151 | 151 | ||
@@ -160,7 +160,7 @@ END_TEST | |||
160 | START_TEST(child_add) | 160 | START_TEST(child_add) |
161 | { | 161 | { |
162 | Eo *child; | 162 | Eo *child; |
163 | eo_do(connection, child = efl_model_child_add()); | 163 | child = efl_model_child_add(connection); |
164 | ck_assert_ptr_eq(NULL, child); | 164 | ck_assert_ptr_eq(NULL, child); |
165 | } | 165 | } |
166 | END_TEST | 166 | END_TEST |
@@ -169,15 +169,15 @@ START_TEST(child_del) | |||
169 | { | 169 | { |
170 | unsigned int expected_children_count = 0; | 170 | unsigned int expected_children_count = 0; |
171 | Efl_Model_Load_Status status; | 171 | Efl_Model_Load_Status status; |
172 | eo_do(connection, status = efl_model_children_count_get(&expected_children_count)); | 172 | status = efl_model_children_count_get(connection, &expected_children_count); |
173 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 173 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
174 | 174 | ||
175 | Eo *child = efl_model_first_child_get(connection); | 175 | Eo *child = efl_model_first_child_get(connection); |
176 | eo_do(connection, status = efl_model_child_del(child)); | 176 | status = efl_model_child_del(connection, child); |
177 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 177 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
178 | 178 | ||
179 | unsigned int actual_children_count = 0; | 179 | unsigned int actual_children_count = 0; |
180 | eo_do(connection, status = efl_model_children_count_get(&actual_children_count)); | 180 | status = efl_model_children_count_get(connection, &actual_children_count); |
181 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 181 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
182 | 182 | ||
183 | ck_assert_int_le(expected_children_count, actual_children_count); | 183 | ck_assert_int_le(expected_children_count, actual_children_count); |
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_method.c b/src/tests/eldbus/eldbus_test_eldbus_model_method.c index e4f7a81..51ed4af 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_method.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_method.c | |||
@@ -29,12 +29,7 @@ _setup(void) | |||
29 | 29 | ||
30 | fake_server = fake_server_start(&fake_server_data); | 30 | fake_server = fake_server_start(&fake_server_data); |
31 | 31 | ||
32 | fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, | 32 | fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); |
33 | eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION, | ||
34 | NULL, | ||
35 | EINA_FALSE, | ||
36 | FAKE_SERVER_BUS, | ||
37 | FAKE_SERVER_PATH)); | ||
38 | ck_assert_ptr_ne(NULL, fake_server_object); | 33 | ck_assert_ptr_ne(NULL, fake_server_object); |
39 | 34 | ||
40 | efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); | 35 | efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); |
@@ -70,7 +65,7 @@ START_TEST(properties_get) | |||
70 | { | 65 | { |
71 | Eina_Array *properties = NULL; | 66 | Eina_Array *properties = NULL; |
72 | Efl_Model_Load_Status status; | 67 | Efl_Model_Load_Status status; |
73 | eo_do(method, status = efl_model_properties_get(&properties)); | 68 | status = efl_model_properties_get(method, &properties); |
74 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 69 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
75 | ck_assert_ptr_ne(NULL, properties); | 70 | ck_assert_ptr_ne(NULL, properties); |
76 | 71 | ||
@@ -85,14 +80,14 @@ START_TEST(property_get) | |||
85 | // Input only property returns error | 80 | // Input only property returns error |
86 | Eina_Value const* dummy; | 81 | Eina_Value const* dummy; |
87 | Efl_Model_Load_Status status; | 82 | Efl_Model_Load_Status status; |
88 | eo_do(method, status = efl_model_property_get(ARGUMENT_A, &dummy)); | 83 | status = efl_model_property_get(method, ARGUMENT_A, &dummy); |
89 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 84 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
90 | 85 | ||
91 | eo_do(method, status = efl_model_property_get(ARGUMENT_RESULT, &dummy)); | 86 | status = efl_model_property_get(method, ARGUMENT_RESULT, &dummy); |
92 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 87 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
93 | 88 | ||
94 | // Nonexistent property returns error | 89 | // Nonexistent property returns error |
95 | eo_do(method, status = efl_model_property_get("nonexistent", &dummy)); | 90 | status = efl_model_property_get(method, "nonexistent", &dummy); |
96 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 91 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
97 | } | 92 | } |
98 | END_TEST | 93 | END_TEST |
@@ -102,7 +97,7 @@ START_TEST(property_set) | |||
102 | // Output argument returns error | 97 | // Output argument returns error |
103 | Eina_Value dummy = {0}; | 98 | Eina_Value dummy = {0}; |
104 | Efl_Model_Load_Status status; | 99 | Efl_Model_Load_Status status; |
105 | eo_do(method, status = efl_model_property_set(ARGUMENT_RESULT, &dummy)); | 100 | status = efl_model_property_set(method, ARGUMENT_RESULT, &dummy); |
106 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 101 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
107 | } | 102 | } |
108 | END_TEST | 103 | END_TEST |
@@ -123,7 +118,7 @@ START_TEST(children_slice_get) | |||
123 | { | 118 | { |
124 | Eina_Accessor *accessor; | 119 | Eina_Accessor *accessor; |
125 | Efl_Model_Load_Status status; | 120 | Efl_Model_Load_Status status; |
126 | eo_do(method, status = efl_model_children_slice_get(1, 1, &accessor)); | 121 | status = efl_model_children_slice_get(method, 1, 1, &accessor); |
127 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 122 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
128 | ck_assert_ptr_eq(NULL, accessor); | 123 | ck_assert_ptr_eq(NULL, accessor); |
129 | } | 124 | } |
@@ -133,7 +128,7 @@ static void | |||
133 | _check_unload(void) | 128 | _check_unload(void) |
134 | { | 129 | { |
135 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED); | 130 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED); |
136 | eo_do(method, efl_model_unload()); | 131 | efl_model_unload(method); |
137 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_UNLOADED); | 132 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_UNLOADED); |
138 | 133 | ||
139 | check_efl_model_children_count_eq(method, 0); | 134 | check_efl_model_children_count_eq(method, 0); |
@@ -149,7 +144,7 @@ START_TEST(properties_load) | |||
149 | { | 144 | { |
150 | _check_unload(); | 145 | _check_unload(); |
151 | 146 | ||
152 | eo_do(method, efl_model_properties_load()); | 147 | efl_model_properties_load(method); |
153 | efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 148 | efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
154 | 149 | ||
155 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 150 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
@@ -160,7 +155,7 @@ START_TEST(children_load) | |||
160 | { | 155 | { |
161 | _check_unload(); | 156 | _check_unload(); |
162 | 157 | ||
163 | eo_do(method, efl_model_children_load()); | 158 | efl_model_children_load(method); |
164 | efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 159 | efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
165 | 160 | ||
166 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 161 | check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
@@ -172,7 +167,7 @@ END_TEST | |||
172 | START_TEST(child_add) | 167 | START_TEST(child_add) |
173 | { | 168 | { |
174 | Eo *child; | 169 | Eo *child; |
175 | eo_do(method, child = efl_model_child_add()); | 170 | child = efl_model_child_add(method); |
176 | ck_assert_ptr_eq(NULL, child); | 171 | ck_assert_ptr_eq(NULL, child); |
177 | } | 172 | } |
178 | END_TEST | 173 | END_TEST |
@@ -182,7 +177,7 @@ START_TEST(child_del) | |||
182 | // efl_model_child_del always returns ERROR | 177 | // efl_model_child_del always returns ERROR |
183 | Eo *child = NULL; | 178 | Eo *child = NULL; |
184 | Efl_Model_Load_Status status; | 179 | Efl_Model_Load_Status status; |
185 | eo_do(method, status = efl_model_child_del(child)); | 180 | status = efl_model_child_del(method, child); |
186 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 181 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
187 | } | 182 | } |
188 | END_TEST | 183 | END_TEST |
@@ -193,7 +188,7 @@ START_TEST(call) | |||
193 | check_efl_model_property_int_set(method, ARGUMENT_B, 87654321); | 188 | check_efl_model_property_int_set(method, ARGUMENT_B, 87654321); |
194 | 189 | ||
195 | Efl_Model_Load_Status status; | 190 | Efl_Model_Load_Status status; |
196 | eo_do(method, status = eldbus_model_method_call()); | 191 | status = eldbus_model_method_call(method); |
197 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 192 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
198 | 193 | ||
199 | efl_model_wait_for_event(method, ELDBUS_MODEL_METHOD_EVENT_SUCCESSFUL_CALL); | 194 | efl_model_wait_for_event(method, ELDBUS_MODEL_METHOD_EVENT_SUCCESSFUL_CALL); |
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_object.c b/src/tests/eldbus/eldbus_test_eldbus_model_object.c index c1f1248..faa64a7 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_object.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_object.c | |||
@@ -43,7 +43,7 @@ START_TEST(properties_get) | |||
43 | { | 43 | { |
44 | Eina_Array *properties = NULL; | 44 | Eina_Array *properties = NULL; |
45 | Efl_Model_Load_Status status; | 45 | Efl_Model_Load_Status status; |
46 | eo_do(object, status = efl_model_properties_get(&properties)); | 46 | status = efl_model_properties_get(object, &properties); |
47 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 47 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
48 | ck_assert_ptr_ne(NULL, properties); | 48 | ck_assert_ptr_ne(NULL, properties); |
49 | 49 | ||
@@ -52,7 +52,7 @@ START_TEST(properties_get) | |||
52 | ck_assert_int_eq(expected_properties_count, actual_properties_count); | 52 | ck_assert_int_eq(expected_properties_count, actual_properties_count); |
53 | 53 | ||
54 | // Unloaded object populates its properties | 54 | // Unloaded object populates its properties |
55 | eo_do(unloaded_object, status = efl_model_properties_get(&properties)); | 55 | status = efl_model_properties_get(unloaded_object, &properties); |
56 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); | 56 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); |
57 | ck_assert_ptr_ne(NULL, properties); | 57 | ck_assert_ptr_ne(NULL, properties); |
58 | 58 | ||
@@ -65,11 +65,11 @@ START_TEST(property_get) | |||
65 | { | 65 | { |
66 | const Eina_Value* property_value; | 66 | const Eina_Value* property_value; |
67 | Efl_Model_Load_Status status; | 67 | Efl_Model_Load_Status status; |
68 | eo_do(object, status = efl_model_property_get(UNIQUE_NAME_PROPERTY, &property_value)); | 68 | status = efl_model_property_get(object, UNIQUE_NAME_PROPERTY, &property_value); |
69 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 69 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
70 | 70 | ||
71 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR | 71 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR |
72 | eo_do(object, status = efl_model_property_get("nonexistent", &property_value)); | 72 | status = efl_model_property_get(object, "nonexistent", &property_value); |
73 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 73 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
74 | } | 74 | } |
75 | END_TEST | 75 | END_TEST |
@@ -81,19 +81,19 @@ START_TEST(property_set) | |||
81 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); | 81 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); |
82 | eina_value_set(&value, 1); | 82 | eina_value_set(&value, 1); |
83 | Efl_Model_Load_Status status; | 83 | Efl_Model_Load_Status status; |
84 | eo_do(object, status = efl_model_property_set("nonexistent", &value)); | 84 | status = efl_model_property_set(object, "nonexistent", &value); |
85 | eina_value_flush(&value); | 85 | eina_value_flush(&value); |
86 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 86 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
87 | 87 | ||
88 | // UNIQUE_NAME_PROPERTY is read-only | 88 | // UNIQUE_NAME_PROPERTY is read-only |
89 | eo_do(object, status = efl_model_property_set(UNIQUE_NAME_PROPERTY, &value)); | 89 | status = efl_model_property_set(object, UNIQUE_NAME_PROPERTY, &value); |
90 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 90 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
91 | 91 | ||
92 | // The model must be loaded to be able to set its properties | 92 | // The model must be loaded to be able to set its properties |
93 | const char *expected_value = "unloaded"; | 93 | const char *expected_value = "unloaded"; |
94 | eina_value_setup(&value, EINA_VALUE_TYPE_STRING); | 94 | eina_value_setup(&value, EINA_VALUE_TYPE_STRING); |
95 | eina_value_set(&value, expected_value); | 95 | eina_value_set(&value, expected_value); |
96 | eo_do(unloaded_object, status = efl_model_property_set(UNIQUE_NAME_PROPERTY, &value)); | 96 | status = efl_model_property_set(unloaded_object, UNIQUE_NAME_PROPERTY, &value); |
97 | eina_value_flush(&value); | 97 | eina_value_flush(&value); |
98 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 98 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
99 | } | 99 | } |
@@ -119,7 +119,7 @@ START_TEST(children_slice_get) | |||
119 | // Unloaded object must return EFL_MODEL_LOAD_STATUS_UNLOADED | 119 | // Unloaded object must return EFL_MODEL_LOAD_STATUS_UNLOADED |
120 | Eina_Accessor *accessor; | 120 | Eina_Accessor *accessor; |
121 | Efl_Model_Load_Status status; | 121 | Efl_Model_Load_Status status; |
122 | eo_do(unloaded_object, status = efl_model_children_slice_get(0, 0, &accessor)); | 122 | status = efl_model_children_slice_get(unloaded_object, 0, 0, &accessor); |
123 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); | 123 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); |
124 | ck_assert_ptr_eq(NULL, accessor); | 124 | ck_assert_ptr_eq(NULL, accessor); |
125 | } | 125 | } |
@@ -128,7 +128,7 @@ END_TEST | |||
128 | START_TEST(unload) | 128 | START_TEST(unload) |
129 | { | 129 | { |
130 | check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_LOADED); | 130 | check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_LOADED); |
131 | eo_do(object, efl_model_unload()); | 131 | efl_model_unload(object); |
132 | check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_UNLOADED); | 132 | check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_UNLOADED); |
133 | 133 | ||
134 | check_efl_model_children_count_eq(object, 0); | 134 | check_efl_model_children_count_eq(object, 0); |
@@ -137,14 +137,14 @@ END_TEST | |||
137 | 137 | ||
138 | START_TEST(properties_load) | 138 | START_TEST(properties_load) |
139 | { | 139 | { |
140 | eo_do(unloaded_object, efl_model_properties_load()); | 140 | efl_model_properties_load(unloaded_object); |
141 | check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 141 | check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
142 | } | 142 | } |
143 | END_TEST | 143 | END_TEST |
144 | 144 | ||
145 | START_TEST(children_load) | 145 | START_TEST(children_load) |
146 | { | 146 | { |
147 | eo_do(unloaded_object, efl_model_children_load()); | 147 | efl_model_children_load(unloaded_object); |
148 | 148 | ||
149 | check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADING_CHILDREN); | 149 | check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADING_CHILDREN); |
150 | 150 | ||
@@ -159,7 +159,7 @@ END_TEST | |||
159 | START_TEST(child_add) | 159 | START_TEST(child_add) |
160 | { | 160 | { |
161 | Eo *child; | 161 | Eo *child; |
162 | eo_do(object, child = efl_model_child_add()); | 162 | child = efl_model_child_add(object); |
163 | ck_assert_ptr_eq(NULL, child); | 163 | ck_assert_ptr_eq(NULL, child); |
164 | } | 164 | } |
165 | END_TEST | 165 | END_TEST |
@@ -168,15 +168,15 @@ START_TEST(child_del) | |||
168 | { | 168 | { |
169 | unsigned int expected_children_count = 0; | 169 | unsigned int expected_children_count = 0; |
170 | Efl_Model_Load_Status status; | 170 | Efl_Model_Load_Status status; |
171 | eo_do(object, status = efl_model_children_count_get(&expected_children_count)); | 171 | status = efl_model_children_count_get(object, &expected_children_count); |
172 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 172 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
173 | 173 | ||
174 | Eo *child = efl_model_first_child_get(object); | 174 | Eo *child = efl_model_first_child_get(object); |
175 | eo_do(object, status = efl_model_child_del(child)); | 175 | status = efl_model_child_del(object, child); |
176 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 176 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
177 | 177 | ||
178 | unsigned int actual_children_count = 0; | 178 | unsigned int actual_children_count = 0; |
179 | eo_do(object, status = efl_model_children_count_get(&actual_children_count)); | 179 | status = efl_model_children_count_get(object, &actual_children_count); |
180 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 180 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
181 | 181 | ||
182 | ck_assert_int_le(expected_children_count, actual_children_count); | 182 | ck_assert_int_le(expected_children_count, actual_children_count); |
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c b/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c index 98ce124..741ee95b 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c | |||
@@ -51,13 +51,13 @@ START_TEST(properties_get) | |||
51 | // ELDBUS_FDO_INTERFACE have no properties | 51 | // ELDBUS_FDO_INTERFACE have no properties |
52 | Eina_Array *properties = NULL; | 52 | Eina_Array *properties = NULL; |
53 | Efl_Model_Load_Status status; | 53 | Efl_Model_Load_Status status; |
54 | eo_do(dbus_proxy, status = efl_model_properties_get(&properties)); | 54 | status = efl_model_properties_get(dbus_proxy, &properties); |
55 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 55 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
56 | ck_assert_ptr_ne(NULL, properties); | 56 | ck_assert_ptr_ne(NULL, properties); |
57 | ck_assert_int_eq(0, eina_array_count(properties)); | 57 | ck_assert_int_eq(0, eina_array_count(properties)); |
58 | 58 | ||
59 | // Must be loaded to get the properties | 59 | // Must be loaded to get the properties |
60 | eo_do(unloaded_dbus_proxy, status = efl_model_properties_get(&properties)); | 60 | status = efl_model_properties_get(unloaded_dbus_proxy, &properties); |
61 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 61 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
62 | } | 62 | } |
63 | END_TEST | 63 | END_TEST |
@@ -67,7 +67,7 @@ START_TEST(property_get) | |||
67 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR | 67 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR |
68 | const Eina_Value* property_value; | 68 | const Eina_Value* property_value; |
69 | Efl_Model_Load_Status status; | 69 | Efl_Model_Load_Status status; |
70 | eo_do(dbus_proxy, status = efl_model_property_get("nonexistent", &property_value)); | 70 | status = efl_model_property_get(dbus_proxy, "nonexistent", &property_value); |
71 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 71 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
72 | } | 72 | } |
73 | END_TEST | 73 | END_TEST |
@@ -79,7 +79,7 @@ START_TEST(property_set) | |||
79 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); | 79 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); |
80 | eina_value_set(&value, 1); | 80 | eina_value_set(&value, 1); |
81 | Efl_Model_Load_Status status; | 81 | Efl_Model_Load_Status status; |
82 | eo_do(dbus_proxy, status = efl_model_property_set("nonexistent", &value)); | 82 | status = efl_model_property_set(dbus_proxy, "nonexistent", &value); |
83 | eina_value_flush(&value); | 83 | eina_value_flush(&value); |
84 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 84 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
85 | } | 85 | } |
@@ -105,7 +105,7 @@ START_TEST(children_slice_get) | |||
105 | // Unloaded dbus_proxy must return EFL_MODEL_LOAD_STATUS_UNLOADED | 105 | // Unloaded dbus_proxy must return EFL_MODEL_LOAD_STATUS_UNLOADED |
106 | Eina_Accessor *accessor; | 106 | Eina_Accessor *accessor; |
107 | Efl_Model_Load_Status status; | 107 | Efl_Model_Load_Status status; |
108 | eo_do(unloaded_dbus_proxy, status = efl_model_children_slice_get(0, 0, &accessor)); | 108 | status = efl_model_children_slice_get(unloaded_dbus_proxy, 0, 0, &accessor); |
109 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); | 109 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); |
110 | ck_assert_ptr_eq(NULL, accessor); | 110 | ck_assert_ptr_eq(NULL, accessor); |
111 | } | 111 | } |
@@ -114,7 +114,7 @@ END_TEST | |||
114 | START_TEST(unload) | 114 | START_TEST(unload) |
115 | { | 115 | { |
116 | check_efl_model_load_status_get(dbus_proxy, EFL_MODEL_LOAD_STATUS_LOADED); | 116 | check_efl_model_load_status_get(dbus_proxy, EFL_MODEL_LOAD_STATUS_LOADED); |
117 | eo_do(dbus_proxy, efl_model_unload()); | 117 | efl_model_unload(dbus_proxy); |
118 | check_efl_model_load_status_get(dbus_proxy, EFL_MODEL_LOAD_STATUS_UNLOADED); | 118 | check_efl_model_load_status_get(dbus_proxy, EFL_MODEL_LOAD_STATUS_UNLOADED); |
119 | 119 | ||
120 | check_efl_model_children_count_eq(dbus_proxy, 0); | 120 | check_efl_model_children_count_eq(dbus_proxy, 0); |
@@ -123,14 +123,14 @@ END_TEST | |||
123 | 123 | ||
124 | START_TEST(properties_load) | 124 | START_TEST(properties_load) |
125 | { | 125 | { |
126 | eo_do(unloaded_dbus_proxy, efl_model_properties_load()); | 126 | efl_model_properties_load(unloaded_dbus_proxy); |
127 | check_efl_model_load_status_get(unloaded_dbus_proxy, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 127 | check_efl_model_load_status_get(unloaded_dbus_proxy, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
128 | } | 128 | } |
129 | END_TEST | 129 | END_TEST |
130 | 130 | ||
131 | START_TEST(children_load) | 131 | START_TEST(children_load) |
132 | { | 132 | { |
133 | eo_do(unloaded_dbus_proxy, efl_model_children_load()); | 133 | efl_model_children_load(unloaded_dbus_proxy); |
134 | 134 | ||
135 | efl_model_wait_for_load_status(unloaded_dbus_proxy, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 135 | efl_model_wait_for_load_status(unloaded_dbus_proxy, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
136 | 136 | ||
@@ -143,7 +143,7 @@ END_TEST | |||
143 | START_TEST(child_add) | 143 | START_TEST(child_add) |
144 | { | 144 | { |
145 | Eo *child; | 145 | Eo *child; |
146 | eo_do(dbus_proxy, child = efl_model_child_add()); | 146 | child = efl_model_child_add(dbus_proxy); |
147 | ck_assert_ptr_eq(NULL, child); | 147 | ck_assert_ptr_eq(NULL, child); |
148 | } | 148 | } |
149 | END_TEST | 149 | END_TEST |
@@ -152,15 +152,15 @@ START_TEST(child_del) | |||
152 | { | 152 | { |
153 | unsigned int expected_children_count = 0; | 153 | unsigned int expected_children_count = 0; |
154 | Efl_Model_Load_Status status; | 154 | Efl_Model_Load_Status status; |
155 | eo_do(dbus_proxy, status = efl_model_children_count_get(&expected_children_count)); | 155 | status = efl_model_children_count_get(dbus_proxy, &expected_children_count); |
156 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 156 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
157 | 157 | ||
158 | Eo *child = efl_model_first_child_get(dbus_proxy); | 158 | Eo *child = efl_model_first_child_get(dbus_proxy); |
159 | eo_do(dbus_proxy, status = efl_model_child_del(child)); | 159 | status = efl_model_child_del(dbus_proxy, child); |
160 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 160 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
161 | 161 | ||
162 | unsigned int actual_children_count = 0; | 162 | unsigned int actual_children_count = 0; |
163 | eo_do(dbus_proxy, status = efl_model_children_count_get(&actual_children_count)); | 163 | status = efl_model_children_count_get(dbus_proxy, &actual_children_count); |
164 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 164 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
165 | 165 | ||
166 | ck_assert_int_le(expected_children_count, actual_children_count); | 166 | ck_assert_int_le(expected_children_count, actual_children_count); |
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c index 3185f2e..7c31874 100644 --- a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c +++ b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c | |||
@@ -27,12 +27,7 @@ _setup(void) | |||
27 | 27 | ||
28 | fake_server = fake_server_start(&fake_server_data); | 28 | fake_server = fake_server_start(&fake_server_data); |
29 | 29 | ||
30 | fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, | 30 | fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); |
31 | eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION, | ||
32 | NULL, | ||
33 | EINA_FALSE, | ||
34 | FAKE_SERVER_BUS, | ||
35 | FAKE_SERVER_PATH)); | ||
36 | ck_assert_ptr_ne(NULL, fake_server_object); | 31 | ck_assert_ptr_ne(NULL, fake_server_object); |
37 | 32 | ||
38 | efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); | 33 | efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); |
@@ -68,7 +63,7 @@ START_TEST(properties_get) | |||
68 | { | 63 | { |
69 | Eina_Array *properties = NULL; | 64 | Eina_Array *properties = NULL; |
70 | Efl_Model_Load_Status status; | 65 | Efl_Model_Load_Status status; |
71 | eo_do(pong_signal, status = efl_model_properties_get(&properties)); | 66 | status = efl_model_properties_get(pong_signal, &properties); |
72 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 67 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
73 | ck_assert_ptr_ne(NULL, properties); | 68 | ck_assert_ptr_ne(NULL, properties); |
74 | 69 | ||
@@ -83,12 +78,12 @@ START_TEST(property_get) | |||
83 | // Signal properties always have output direction | 78 | // Signal properties always have output direction |
84 | Eina_Value const* dummy; | 79 | Eina_Value const* dummy; |
85 | Efl_Model_Load_Status status; | 80 | Efl_Model_Load_Status status; |
86 | eo_do(pong_signal, status = efl_model_property_get(ARGUMENT_A, &dummy)); | 81 | status = efl_model_property_get(pong_signal, ARGUMENT_A, &dummy); |
87 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 82 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
88 | ck_assert_ptr_ne(NULL, dummy); | 83 | ck_assert_ptr_ne(NULL, dummy); |
89 | 84 | ||
90 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR | 85 | // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR |
91 | eo_do(pong_signal, status = efl_model_property_get("nonexistent", &dummy)); | 86 | status = efl_model_property_get(pong_signal, "nonexistent", &dummy); |
92 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 87 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
93 | } | 88 | } |
94 | END_TEST | 89 | END_TEST |
@@ -98,7 +93,7 @@ START_TEST(property_set) | |||
98 | // Signals have output arguments only. All returns error | 93 | // Signals have output arguments only. All returns error |
99 | Eina_Value dummy = {0}; | 94 | Eina_Value dummy = {0}; |
100 | Efl_Model_Load_Status status; | 95 | Efl_Model_Load_Status status; |
101 | eo_do(pong_signal, status = efl_model_property_set(ARGUMENT_A, &dummy)); | 96 | status = efl_model_property_set(pong_signal, ARGUMENT_A, &dummy); |
102 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 97 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
103 | } | 98 | } |
104 | END_TEST | 99 | END_TEST |
@@ -119,7 +114,7 @@ START_TEST(children_slice_get) | |||
119 | { | 114 | { |
120 | Eina_Accessor *accessor; | 115 | Eina_Accessor *accessor; |
121 | Efl_Model_Load_Status status; | 116 | Efl_Model_Load_Status status; |
122 | eo_do(pong_signal, status = efl_model_children_slice_get(1, 1, &accessor)); | 117 | status = efl_model_children_slice_get(pong_signal, 1, 1, &accessor); |
123 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 118 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
124 | ck_assert_ptr_eq(NULL, accessor); | 119 | ck_assert_ptr_eq(NULL, accessor); |
125 | } | 120 | } |
@@ -129,7 +124,7 @@ static void | |||
129 | _check_unload(void) | 124 | _check_unload(void) |
130 | { | 125 | { |
131 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED); | 126 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED); |
132 | eo_do(pong_signal, efl_model_unload()); | 127 | efl_model_unload(pong_signal); |
133 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_UNLOADED); | 128 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_UNLOADED); |
134 | 129 | ||
135 | check_efl_model_children_count_eq(pong_signal, 0); | 130 | check_efl_model_children_count_eq(pong_signal, 0); |
@@ -145,7 +140,7 @@ START_TEST(properties_load) | |||
145 | { | 140 | { |
146 | _check_unload(); | 141 | _check_unload(); |
147 | 142 | ||
148 | eo_do(pong_signal, efl_model_properties_load()); | 143 | efl_model_properties_load(pong_signal); |
149 | efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 144 | efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
150 | 145 | ||
151 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 146 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
@@ -156,7 +151,7 @@ START_TEST(children_load) | |||
156 | { | 151 | { |
157 | _check_unload(); | 152 | _check_unload(); |
158 | 153 | ||
159 | eo_do(pong_signal, efl_model_children_load()); | 154 | efl_model_children_load(pong_signal); |
160 | efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 155 | efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
161 | 156 | ||
162 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 157 | check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
@@ -168,7 +163,7 @@ END_TEST | |||
168 | START_TEST(child_add) | 163 | START_TEST(child_add) |
169 | { | 164 | { |
170 | Eo *child; | 165 | Eo *child; |
171 | eo_do(pong_signal, child = efl_model_child_add()); | 166 | child = efl_model_child_add(pong_signal); |
172 | ck_assert_ptr_eq(NULL, child); | 167 | ck_assert_ptr_eq(NULL, child); |
173 | } | 168 | } |
174 | END_TEST | 169 | END_TEST |
@@ -178,7 +173,7 @@ START_TEST(child_del) | |||
178 | // efl_model_child_del always returns ERROR | 173 | // efl_model_child_del always returns ERROR |
179 | Eo *child = NULL; | 174 | Eo *child = NULL; |
180 | Efl_Model_Load_Status status; | 175 | Efl_Model_Load_Status status; |
181 | eo_do(pong_signal, status = efl_model_child_del(child)); | 176 | status = efl_model_child_del(pong_signal, child); |
182 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 177 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
183 | } | 178 | } |
184 | END_TEST | 179 | END_TEST |
@@ -193,7 +188,7 @@ START_TEST(signals) | |||
193 | check_efl_model_property_int_set(ping_method, ARGUMENT_A, 99); | 188 | check_efl_model_property_int_set(ping_method, ARGUMENT_A, 99); |
194 | 189 | ||
195 | Efl_Model_Load_Status status; | 190 | Efl_Model_Load_Status status; |
196 | eo_do(ping_method, status = eldbus_model_method_call()); | 191 | status = eldbus_model_method_call(ping_method); |
197 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 192 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
198 | 193 | ||
199 | efl_model_wait_for_event(pong_signal, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED); | 194 | efl_model_wait_for_event(pong_signal, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED); |
diff --git a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c index 7a12d32..09ef4cc 100644 --- a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c +++ b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c | |||
@@ -33,12 +33,7 @@ _setup(void) | |||
33 | }; | 33 | }; |
34 | fake_server = fake_server_start(&fake_server_data); | 34 | fake_server = fake_server_start(&fake_server_data); |
35 | 35 | ||
36 | fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, | 36 | fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); |
37 | eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION, | ||
38 | NULL, | ||
39 | EINA_FALSE, | ||
40 | FAKE_SERVER_BUS, | ||
41 | FAKE_SERVER_PATH)); | ||
42 | ck_assert_ptr_ne(NULL, fake_server_object); | 37 | ck_assert_ptr_ne(NULL, fake_server_object); |
43 | 38 | ||
44 | efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); | 39 | efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); |
@@ -70,7 +65,7 @@ START_TEST(properties_get) | |||
70 | { | 65 | { |
71 | Eina_Array *properties = NULL; | 66 | Eina_Array *properties = NULL; |
72 | Efl_Model_Load_Status status; | 67 | Efl_Model_Load_Status status; |
73 | eo_do(fake_server_proxy, status = efl_model_properties_get(&properties)); | 68 | status = efl_model_properties_get(fake_server_proxy, &properties); |
74 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 69 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
75 | ck_assert_ptr_ne(NULL, properties); | 70 | ck_assert_ptr_ne(NULL, properties); |
76 | 71 | ||
@@ -90,7 +85,7 @@ START_TEST(property_get) | |||
90 | // Write-only property returns error | 85 | // Write-only property returns error |
91 | const Eina_Value *dummy; | 86 | const Eina_Value *dummy; |
92 | Efl_Model_Load_Status status; | 87 | Efl_Model_Load_Status status; |
93 | eo_do(fake_server_proxy, status = efl_model_property_get(FAKE_SERVER_WRITEONLY_PROPERTY, &dummy)); | 88 | status = efl_model_property_get(fake_server_proxy, FAKE_SERVER_WRITEONLY_PROPERTY, &dummy); |
94 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 89 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
95 | 90 | ||
96 | _teardown(); | 91 | _teardown(); |
@@ -104,7 +99,7 @@ _check_property_set(const char *property_name, int expected_property_value, int | |||
104 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); | 99 | eina_value_setup(&value, EINA_VALUE_TYPE_INT); |
105 | eina_value_set(&value, expected_property_value); | 100 | eina_value_set(&value, expected_property_value); |
106 | Efl_Model_Load_Status status; | 101 | Efl_Model_Load_Status status; |
107 | eo_do(fake_server_proxy, status = efl_model_property_set(property_name, &value)); | 102 | status = efl_model_property_set(fake_server_proxy, property_name, &value); |
108 | eina_value_flush(&value); | 103 | eina_value_flush(&value); |
109 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 104 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
110 | 105 | ||
@@ -121,7 +116,7 @@ START_TEST(property_set) | |||
121 | // Read-only property returns error | 116 | // Read-only property returns error |
122 | Eina_Value dummy = {0}; | 117 | Eina_Value dummy = {0}; |
123 | Efl_Model_Load_Status status; | 118 | Efl_Model_Load_Status status; |
124 | eo_do(fake_server_proxy, status = efl_model_property_set(FAKE_SERVER_READONLY_PROPERTY, &dummy)); | 119 | status = efl_model_property_set(fake_server_proxy, FAKE_SERVER_READONLY_PROPERTY, &dummy); |
125 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 120 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
126 | 121 | ||
127 | _teardown(); | 122 | _teardown(); |
@@ -149,9 +144,9 @@ START_TEST(children_slice_get) | |||
149 | Eldbus_Model_Arguments *method2 = efl_model_nth_child_get(fake_server_proxy, 2); | 144 | Eldbus_Model_Arguments *method2 = efl_model_nth_child_get(fake_server_proxy, 2); |
150 | Eldbus_Model_Arguments *signal1 = efl_model_nth_child_get(fake_server_proxy, 3); | 145 | Eldbus_Model_Arguments *signal1 = efl_model_nth_child_get(fake_server_proxy, 3); |
151 | 146 | ||
152 | const char *actual_method1_name = eo_do_ret(method1, actual_method1_name, eldbus_model_arguments_name_get()); | 147 | const char *actual_method1_name = eldbus_model_arguments_name_get(method1); |
153 | const char *actual_method2_name = eo_do_ret(method2, actual_method2_name, eldbus_model_arguments_name_get()); | 148 | const char *actual_method2_name = eldbus_model_arguments_name_get(method2); |
154 | const char *actual_signal1_name = eo_do_ret(signal1, actual_signal1_name, eldbus_model_arguments_name_get()); | 149 | const char *actual_signal1_name = eldbus_model_arguments_name_get(signal1); |
155 | 150 | ||
156 | ck_assert_ptr_ne(NULL, actual_method1_name); | 151 | ck_assert_ptr_ne(NULL, actual_method1_name); |
157 | ck_assert_ptr_ne(NULL, actual_method2_name); | 152 | ck_assert_ptr_ne(NULL, actual_method2_name); |
@@ -173,7 +168,7 @@ static void | |||
173 | _check_unload(void) | 168 | _check_unload(void) |
174 | { | 169 | { |
175 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED); | 170 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED); |
176 | eo_do(fake_server_proxy, efl_model_unload()); | 171 | efl_model_unload(fake_server_proxy); |
177 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_UNLOADED); | 172 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_UNLOADED); |
178 | 173 | ||
179 | check_efl_model_children_count_eq(fake_server_proxy, 0); | 174 | check_efl_model_children_count_eq(fake_server_proxy, 0); |
@@ -191,7 +186,7 @@ START_TEST(properties_load) | |||
191 | { | 186 | { |
192 | _check_unload(); | 187 | _check_unload(); |
193 | 188 | ||
194 | eo_do(fake_server_proxy, efl_model_properties_load()); | 189 | efl_model_properties_load(fake_server_proxy); |
195 | efl_model_wait_for_load_status(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 190 | efl_model_wait_for_load_status(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
196 | 191 | ||
197 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); | 192 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); |
@@ -204,7 +199,7 @@ START_TEST(children_load) | |||
204 | { | 199 | { |
205 | _check_unload(); | 200 | _check_unload(); |
206 | 201 | ||
207 | eo_do(fake_server_proxy, efl_model_children_load()); | 202 | efl_model_children_load(fake_server_proxy); |
208 | efl_model_wait_for_load_status(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 203 | efl_model_wait_for_load_status(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
209 | 204 | ||
210 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); | 205 | check_efl_model_load_status_get(fake_server_proxy, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); |
@@ -217,7 +212,7 @@ END_TEST | |||
217 | 212 | ||
218 | START_TEST(child_add) | 213 | START_TEST(child_add) |
219 | { | 214 | { |
220 | Eo *child = eo_do_ret(fake_server_proxy, child, efl_model_child_add()); | 215 | Eo *child = efl_model_child_add(fake_server_proxy); |
221 | ck_assert_ptr_eq(NULL, child); | 216 | ck_assert_ptr_eq(NULL, child); |
222 | 217 | ||
223 | _teardown(); | 218 | _teardown(); |
@@ -229,16 +224,16 @@ START_TEST(child_del) | |||
229 | // Tests that it is not possible to delete children | 224 | // Tests that it is not possible to delete children |
230 | unsigned int expected_children_count = 0; | 225 | unsigned int expected_children_count = 0; |
231 | Efl_Model_Load_Status status; | 226 | Efl_Model_Load_Status status; |
232 | eo_do(fake_server_proxy, status = efl_model_children_count_get(&expected_children_count)); | 227 | status = efl_model_children_count_get(fake_server_proxy, &expected_children_count); |
233 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 228 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
234 | 229 | ||
235 | // efl_model_child_del always returns ERROR | 230 | // efl_model_child_del always returns ERROR |
236 | Eo *child = efl_model_first_child_get(fake_server_proxy); | 231 | Eo *child = efl_model_first_child_get(fake_server_proxy); |
237 | eo_do(fake_server_proxy, status = efl_model_child_del(child)); | 232 | status = efl_model_child_del(fake_server_proxy, child); |
238 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); | 233 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); |
239 | 234 | ||
240 | unsigned int actual_children_count = 0; | 235 | unsigned int actual_children_count = 0; |
241 | eo_do(fake_server_proxy, status = efl_model_children_count_get(&actual_children_count)); | 236 | status = efl_model_children_count_get(fake_server_proxy, &actual_children_count); |
242 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); | 237 | ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); |
243 | 238 | ||
244 | ck_assert_int_le(expected_children_count, actual_children_count); | 239 | ck_assert_int_le(expected_children_count, actual_children_count); |
diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c index 4efbfc9..f88e045 100644 --- a/src/tests/emotion/emotion_test_main-eo.c +++ b/src/tests/emotion/emotion_test_main-eo.c | |||
@@ -76,7 +76,7 @@ static const char *theme_file = NULL; | |||
76 | static void | 76 | static void |
77 | bg_resize(Evas_Coord w, Evas_Coord h) | 77 | bg_resize(Evas_Coord w, Evas_Coord h) |
78 | { | 78 | { |
79 | eo_do(o_bg, efl_gfx_size_set(w, h)); | 79 | efl_gfx_size_set(o_bg, w, h); |
80 | } | 80 | } |
81 | 81 | ||
82 | static void | 82 | static void |
@@ -84,8 +84,7 @@ main_resize(Ecore_Evas *ee) | |||
84 | { | 84 | { |
85 | Evas_Coord w, h; | 85 | Evas_Coord w, h; |
86 | 86 | ||
87 | eo_do(ecore_evas_get(ee), | 87 | evas_canvas_output_viewport_get(ecore_evas_get(ee), NULL, NULL, &w, &h); |
88 | evas_canvas_output_viewport_get(NULL, NULL, &w, &h)); | ||
89 | bg_resize(w, h); | 88 | bg_resize(w, h); |
90 | } | 89 | } |
91 | 90 | ||
@@ -113,15 +112,13 @@ static void | |||
113 | bg_setup(void) | 112 | bg_setup(void) |
114 | { | 113 | { |
115 | o_bg = eo_add(EDJE_OBJECT_CLASS, evas); | 114 | o_bg = eo_add(EDJE_OBJECT_CLASS, evas); |
116 | eo_do(o_bg, efl_file_set(theme_file, "background"), | 115 | efl_file_set(o_bg, theme_file, "background"); |
117 | efl_gfx_position_set(0, 0), | 116 | efl_gfx_position_set(o_bg, 0, 0); |
118 | efl_gfx_size_set(startw, starth), | 117 | efl_gfx_size_set(o_bg, startw, starth); |
119 | efl_gfx_stack_layer_set(-999), | 118 | efl_gfx_stack_layer_set(o_bg, -999); |
120 | efl_gfx_visible_set(EINA_TRUE), | 119 | efl_gfx_visible_set(o_bg, EINA_TRUE); |
121 | evas_obj_focus_set(EINA_TRUE), | 120 | evas_obj_focus_set(o_bg, EINA_TRUE); |
122 | 121 | eo_event_callback_add(o_bg, EVAS_OBJECT_EVENT_KEY_DOWN, bg_key_down, NULL); | |
123 | eo_event_callback_add(EVAS_OBJECT_EVENT_KEY_DOWN, | ||
124 | bg_key_down, NULL)); | ||
125 | } | 122 | } |
126 | 123 | ||
127 | static void | 124 | static void |
@@ -309,7 +306,7 @@ video_obj_time_changed(Evas_Object *obj, Evas_Object *edje) | |||
309 | pos = emotion_object_position_get(obj); | 306 | pos = emotion_object_position_get(obj); |
310 | len = emotion_object_play_length_get(obj); | 307 | len = emotion_object_play_length_get(obj); |
311 | scale = (len > 0.0) ? pos / len : 0.0; | 308 | scale = (len > 0.0) ? pos / len : 0.0; |
312 | eo_do(edje, edje_obj_part_drag_value_set("video_progress", scale, 0.0)); | 309 | edje_obj_part_drag_value_set(edje, "video_progress", scale, 0.0); |
313 | 310 | ||
314 | lh = len / 3600; | 311 | lh = len / 3600; |
315 | lm = len / 60 - (lh * 60); | 312 | lm = len / 60 - (lh * 60); |
@@ -323,7 +320,7 @@ video_obj_time_changed(Evas_Object *obj, Evas_Object *edje) | |||
323 | 320 | ||
324 | snprintf(buf, sizeof(buf), "%i:%02i:%02i.%02i / %i:%02i:%02i", | 321 | snprintf(buf, sizeof(buf), "%i:%02i:%02i.%02i / %i:%02i:%02i", |
325 | ph, pm, ps, pf, lh, lm, ls); | 322 | ph, pm, ps, pf, lh, lm, ls); |
326 | eo_do(edje, edje_obj_part_text_set("video_progress_txt", buf)); | 323 | edje_obj_part_text_set(edje, "video_progress_txt", buf); |
327 | } | 324 | } |
328 | 325 | ||
329 | static Eina_Bool | 326 | static Eina_Bool |
@@ -356,12 +353,11 @@ video_obj_frame_resize_cb(void *data, const Eo_Event *event) | |||
356 | printf("HANDLE %ix%i @ %3.3f\n", iw, ih, ratio); | 353 | printf("HANDLE %ix%i @ %3.3f\n", iw, ih, ratio); |
357 | if (ratio > 0.0) iw = (ih * ratio) + 0.5; | 354 | if (ratio > 0.0) iw = (ih * ratio) + 0.5; |
358 | evas_object_size_hint_min_set(event->obj, iw, ih); | 355 | evas_object_size_hint_min_set(event->obj, iw, ih); |
359 | eo_do(oe, edje_obj_part_swallow( "video_swallow", event->obj), | 356 | edje_obj_part_swallow(oe, "video_swallow", event->obj); |
360 | edje_obj_size_min_calc(&w, &h), | 357 | edje_obj_size_min_calc(oe, &w, &h); |
361 | efl_gfx_size_set(w, h) | 358 | efl_gfx_size_set(oe, w, h); |
362 | ); | 359 | evas_obj_size_hint_min_set(event->obj, 0, 0); |
363 | eo_do(event->obj, evas_obj_size_hint_min_set(0, 0)); | 360 | edje_obj_part_swallow(oe, "video_swallow", event->obj); |
364 | eo_do(oe, edje_obj_part_swallow( "video_swallow", event->obj)); | ||
365 | 361 | ||
366 | return EINA_TRUE; | 362 | return EINA_TRUE; |
367 | } | 363 | } |
@@ -459,7 +455,7 @@ video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission EINA_U | |||
459 | { | 455 | { |
460 | Evas_Object *ov = data; | 456 | Evas_Object *ov = data; |
461 | emotion_object_play_set(ov, EINA_TRUE); | 457 | emotion_object_play_set(ov, EINA_TRUE); |
462 | eo_do(o, edje_obj_signal_emit("video_state", "play")); | 458 | edje_obj_signal_emit(o, "video_state", "play"); |
463 | } | 459 | } |
464 | 460 | ||
465 | static void | 461 | static void |
@@ -467,7 +463,7 @@ video_obj_signal_pause_cb(void *data, Evas_Object *o, const char *emission EINA_ | |||
467 | { | 463 | { |
468 | Evas_Object *ov = data; | 464 | Evas_Object *ov = data; |
469 | emotion_object_play_set(ov, EINA_FALSE); | 465 | emotion_object_play_set(ov, EINA_FALSE); |
470 | eo_do(o, edje_obj_signal_emit("video_state", "pause")); | 466 | edje_obj_signal_emit(o, "video_state", "pause"); |
471 | } | 467 | } |
472 | 468 | ||
473 | static void | 469 | static void |
@@ -476,7 +472,7 @@ video_obj_signal_stop_cb(void *data, Evas_Object *o, const char *emission EINA_U | |||
476 | Evas_Object *ov = data; | 472 | Evas_Object *ov = data; |
477 | emotion_object_play_set(ov, EINA_FALSE); | 473 | emotion_object_play_set(ov, EINA_FALSE); |
478 | emotion_object_position_set(ov, 0.0); | 474 | emotion_object_position_set(ov, 0.0); |
479 | eo_do(o, edje_obj_signal_emit("video_state", "stop")); | 475 | edje_obj_signal_emit(o, "video_state", "stop"); |
480 | } | 476 | } |
481 | 477 | ||
482 | static void | 478 | static void |
@@ -486,7 +482,7 @@ video_obj_signal_jump_cb(void *data, Evas_Object *o, const char *emission EINA_U | |||
486 | double len; | 482 | double len; |
487 | double x, y; | 483 | double x, y; |
488 | 484 | ||
489 | eo_do(o, edje_obj_part_drag_value_get(source, &x, &y)); | 485 | edje_obj_part_drag_value_get(o, source, &x, &y); |
490 | len = emotion_object_play_length_get(ov); | 486 | len = emotion_object_play_length_get(ov); |
491 | emotion_object_position_set(ov, x * len); | 487 | emotion_object_position_set(ov, x * len); |
492 | } | 488 | } |
@@ -499,11 +495,11 @@ video_obj_signal_alpha_cb(void *data, Evas_Object *o, const char *emission EINA_ | |||
499 | double x, y; | 495 | double x, y; |
500 | char buf[256]; | 496 | char buf[256]; |
501 | 497 | ||
502 | eo_do(o, edje_obj_part_drag_value_get(source, &x, &y)); | 498 | edje_obj_part_drag_value_get(o, source, &x, &y); |
503 | alpha = 255 * y; | 499 | alpha = 255 * y; |
504 | eo_do(ov, efl_gfx_color_set(alpha, alpha, alpha, alpha)); | 500 | efl_gfx_color_set(ov, alpha, alpha, alpha, alpha); |
505 | snprintf(buf, sizeof(buf), "alpha %.0f", alpha); | 501 | snprintf(buf, sizeof(buf), "alpha %.0f", alpha); |
506 | eo_do(o, edje_obj_part_text_set("video_alpha_txt", buf)); | 502 | edje_obj_part_text_set(o, "video_alpha_txt", buf); |
507 | } | 503 | } |
508 | 504 | ||
509 | static void | 505 | static void |
@@ -513,10 +509,10 @@ video_obj_signal_vol_cb(void *data, Evas_Object *o, const char *emission EINA_UN | |||
513 | double vol; | 509 | double vol; |
514 | char buf[256]; | 510 | char buf[256]; |
515 | 511 | ||
516 | eo_do(o, edje_obj_part_drag_value_get(source, NULL, &vol)); | 512 | edje_obj_part_drag_value_get(o, source, NULL, &vol); |
517 | emotion_object_audio_volume_set(ov, vol); | 513 | emotion_object_audio_volume_set(ov, vol); |
518 | snprintf(buf, sizeof(buf), "vol %.2f", vol); | 514 | snprintf(buf, sizeof(buf), "vol %.2f", vol); |
519 | eo_do(o, edje_obj_part_text_set("video_volume_txt", buf)); | 515 | edje_obj_part_text_set(o, "video_volume_txt", buf); |
520 | } | 516 | } |
521 | 517 | ||
522 | static void | 518 | static void |
@@ -525,14 +521,13 @@ video_obj_signal_frame_move_start_cb(void *data EINA_UNUSED, Evas_Object *o, con | |||
525 | Frame_Data *fd; | 521 | Frame_Data *fd; |
526 | Evas_Coord x, y; | 522 | Evas_Coord x, y; |
527 | 523 | ||
528 | eo_do(o, fd = eo_key_data_get("frame_data")); | 524 | fd = eo_key_data_get(o, "frame_data"); |
529 | if (!fd) return; | 525 | if (!fd) return; |
530 | fd->moving = 1; | 526 | fd->moving = 1; |
531 | eo_do(evas_object_evas_get(o), | 527 | evas_canvas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y); |
532 | evas_canvas_pointer_canvas_xy_get(&x, &y)); | ||
533 | fd->x = x; | 528 | fd->x = x; |
534 | fd->y = y; | 529 | fd->y = y; |
535 | eo_do(o, efl_gfx_stack_raise()); | 530 | efl_gfx_stack_raise(o); |
536 | } | 531 | } |
537 | 532 | ||
538 | static void | 533 | static void |
@@ -540,7 +535,7 @@ video_obj_signal_frame_move_stop_cb(void *data EINA_UNUSED, Evas_Object *o, cons | |||
540 | { | 535 | { |
541 | Frame_Data *fd; | 536 | Frame_Data *fd; |
542 | 537 | ||
543 | eo_do(o, fd = eo_key_data_get("frame_data")); | 538 | fd = eo_key_data_get(o, "frame_data"); |
544 | if (!fd) return; | 539 | if (!fd) return; |
545 | fd->moving = 0; | 540 | fd->moving = 0; |
546 | } | 541 | } |
@@ -551,14 +546,13 @@ video_obj_signal_frame_resize_start_cb(void *data EINA_UNUSED, Evas_Object *o, c | |||
551 | Frame_Data *fd; | 546 | Frame_Data *fd; |
552 | Evas_Coord x, y; | 547 | Evas_Coord x, y; |
553 | 548 | ||
554 | eo_do(o, fd = eo_key_data_get("frame_data")); | 549 | fd = eo_key_data_get(o, "frame_data"); |
555 | if (!fd) return; | 550 | if (!fd) return; |
556 | fd->resizing = 1; | 551 | fd->resizing = 1; |
557 | eo_do(evas_object_evas_get(o), | 552 | evas_canvas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y); |
558 | evas_canvas_pointer_canvas_xy_get(&x, &y)); | ||
559 | fd->x = x; | 553 | fd->x = x; |
560 | fd->y = y; | 554 | fd->y = y; |
561 | eo_do(o, efl_gfx_stack_raise()); | 555 | efl_gfx_stack_raise(o); |
562 | } | 556 | } |
563 | 557 | ||
564 | static void | 558 | static void |
@@ -566,7 +560,7 @@ video_obj_signal_frame_resize_stop_cb(void *data EINA_UNUSED, Evas_Object *o, co | |||
566 | { | 560 | { |
567 | Frame_Data *fd; | 561 | Frame_Data *fd; |
568 | 562 | ||
569 | eo_do(o, fd = eo_key_data_get("frame_data")); | 563 | fd = eo_key_data_get(o, "frame_data"); |
570 | if (!fd) return; | 564 | if (!fd) return; |
571 | fd->resizing = 0; | 565 | fd->resizing = 0; |
572 | } | 566 | } |
@@ -576,18 +570,15 @@ video_obj_signal_frame_move_cb(void *data EINA_UNUSED, Evas_Object *o, const cha | |||
576 | { | 570 | { |
577 | Frame_Data *fd; | 571 | Frame_Data *fd; |
578 | 572 | ||
579 | eo_do(o, fd = eo_key_data_get("frame_data")); | 573 | fd = eo_key_data_get(o, "frame_data"); |
580 | if (!fd) return; | 574 | if (!fd) return; |
581 | if (fd->moving) | 575 | if (fd->moving) |
582 | { | 576 | { |
583 | Evas_Coord x, y, ox, oy; | 577 | Evas_Coord x, y, ox, oy; |
584 | 578 | ||
585 | eo_do(evas_object_evas_get(o), | 579 | evas_canvas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y); |
586 | evas_canvas_pointer_canvas_xy_get(&x, &y)); | 580 | efl_gfx_position_get(o, &ox, &oy); |
587 | eo_do(o, | 581 | efl_gfx_position_set(o, ox + (x - fd->x), oy + (y - fd->y)); |
588 | efl_gfx_position_get(&ox, &oy), | ||
589 | efl_gfx_position_set(ox + (x - fd->x), oy + (y - fd->y)) | ||
590 | ); | ||
591 | fd->x = x; | 582 | fd->x = x; |
592 | fd->y = y; | 583 | fd->y = y; |
593 | } | 584 | } |
@@ -595,9 +586,8 @@ video_obj_signal_frame_move_cb(void *data EINA_UNUSED, Evas_Object *o, const cha | |||
595 | { | 586 | { |
596 | Evas_Coord x, y, ow, oh; | 587 | Evas_Coord x, y, ow, oh; |
597 | 588 | ||
598 | eo_do(evas_object_evas_get(o), | 589 | evas_canvas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y); |
599 | evas_canvas_pointer_canvas_xy_get(&x, &y)); | 590 | efl_gfx_size_get(o, &ow, &oh); |
600 | eo_do(o, efl_gfx_size_get(&ow, &oh)); | ||
601 | evas_object_resize(o, ow + (x - fd->x), oh + (y - fd->y)); | 591 | evas_object_resize(o, ow + (x - fd->x), oh + (y - fd->y)); |
602 | fd->x = x; | 592 | fd->x = x; |
603 | fd->y = y; | 593 | fd->y = y; |
@@ -650,43 +640,35 @@ init_video_object(const char *module_filename, const char *filename) | |||
650 | if (!fd) exit(1); | 640 | if (!fd) exit(1); |
651 | 641 | ||
652 | oe = eo_add(EDJE_OBJECT_CLASS, evas); | 642 | oe = eo_add(EDJE_OBJECT_CLASS, evas); |
653 | eo_do(oe, | 643 | eo_event_callback_add(oe, EVAS_OBJECT_EVENT_FREE, _oe_free_cb, fd); |
654 | eo_event_callback_add(EVAS_OBJECT_EVENT_FREE, _oe_free_cb, fd), | 644 | eo_key_data_set(oe, "frame_data", fd); |
655 | eo_key_data_set("frame_data", fd), | 645 | efl_file_set(oe, theme_file, reflex ? "video_controller/reflex" : "video_controller"); |
656 | efl_file_set(theme_file, | 646 | edje_obj_part_swallow(oe, "video_swallow", o); |
657 | reflex ? "video_controller/reflex" : "video_controller"), | ||
658 | edje_obj_part_swallow("video_swallow", o)); | ||
659 | 647 | ||
660 | offset = 20 * (eina_list_count(video_objs) - 1); | 648 | offset = 20 * (eina_list_count(video_objs) - 1); |
661 | eo_do(oe, | 649 | efl_gfx_position_set(oe, offset, offset); |
662 | efl_gfx_position_set(offset, offset), | 650 | edje_obj_size_min_calc(oe, &w, &h); |
663 | edje_obj_size_min_calc(&w, &h), | 651 | efl_gfx_size_set(oe, w, h); |
664 | efl_gfx_size_set(w, h)); | 652 | |
665 | 653 | eo_event_callback_array_add(o, emotion_object_test_callbacks, oe); | |
666 | eo_do(o, eo_event_callback_array_add(emotion_object_test_callbacks, oe)); | 654 | |
667 | 655 | edje_obj_signal_callback_add(oe, "video_control", "play", video_obj_signal_play_cb, o); | |
668 | eo_do(oe, | 656 | edje_obj_signal_callback_add(oe, "video_control", "pause", video_obj_signal_pause_cb, o); |
669 | edje_obj_signal_callback_add("video_control", "play", video_obj_signal_play_cb, o), | 657 | edje_obj_signal_callback_add(oe, "video_control", "stop", video_obj_signal_stop_cb, o); |
670 | edje_obj_signal_callback_add("video_control", "pause", video_obj_signal_pause_cb, o), | 658 | edje_obj_signal_callback_add(oe, "drag", "video_progress", video_obj_signal_jump_cb, o); |
671 | edje_obj_signal_callback_add("video_control", "stop", video_obj_signal_stop_cb, o), | 659 | edje_obj_signal_callback_add(oe, "drag", "video_alpha", video_obj_signal_alpha_cb, o); |
672 | edje_obj_signal_callback_add("drag", "video_progress", video_obj_signal_jump_cb, o), | 660 | edje_obj_signal_callback_add(oe, "drag", "video_volume", video_obj_signal_vol_cb, o); |
673 | edje_obj_signal_callback_add("drag", "video_alpha", video_obj_signal_alpha_cb, o), | 661 | edje_obj_signal_callback_add(oe, "frame_move", "start", video_obj_signal_frame_move_start_cb, oe); |
674 | edje_obj_signal_callback_add("drag", "video_volume", video_obj_signal_vol_cb, o), | 662 | edje_obj_signal_callback_add(oe, "frame_move", "stop", video_obj_signal_frame_move_stop_cb, oe); |
675 | 663 | edje_obj_signal_callback_add(oe, "frame_resize", "start", video_obj_signal_frame_resize_start_cb, oe); | |
676 | edje_obj_signal_callback_add("frame_move", "start", video_obj_signal_frame_move_start_cb, oe), | 664 | edje_obj_signal_callback_add(oe, "frame_resize", "stop", video_obj_signal_frame_resize_stop_cb, oe); |
677 | edje_obj_signal_callback_add("frame_move", "stop", video_obj_signal_frame_move_stop_cb, oe), | 665 | edje_obj_signal_callback_add(oe, "mouse, move", "*", video_obj_signal_frame_move_cb, oe); |
678 | edje_obj_signal_callback_add("frame_resize", "start", video_obj_signal_frame_resize_start_cb, oe), | 666 | edje_obj_part_drag_value_set(oe, "video_alpha", 0.0, 1.0); |
679 | edje_obj_signal_callback_add("frame_resize", "stop", video_obj_signal_frame_resize_stop_cb, oe), | 667 | edje_obj_part_text_set(oe, "video_alpha_txt", "alpha 255"); |
680 | edje_obj_signal_callback_add("mouse,move", "*", video_obj_signal_frame_move_cb, oe), | 668 | edje_obj_part_drag_value_set(oe, "video_volume", 0.0, 0.5); |
681 | 669 | edje_obj_part_text_set(oe, "video_volume_txt", "vol 0.50"); | |
682 | edje_obj_part_drag_value_set("video_alpha", 0.0, 1.0), | 670 | edje_obj_signal_emit(oe, "video_state", "play"); |
683 | edje_obj_part_text_set("video_alpha_txt", "alpha 255"), | 671 | efl_gfx_visible_set(oe, EINA_TRUE); |
684 | edje_obj_part_drag_value_set("video_volume", 0.0, 0.5), | ||
685 | edje_obj_part_text_set("video_volume_txt", "vol 0.50"), | ||
686 | |||
687 | edje_obj_signal_emit("video_state", "play"), | ||
688 | |||
689 | efl_gfx_visible_set(EINA_TRUE)); | ||
690 | } | 672 | } |
691 | 673 | ||
692 | int | 674 | int |
diff --git a/src/tests/eo/access/access_main.c b/src/tests/eo/access/access_main.c index 61cd381..d8d825b 100644 --- a/src/tests/eo/access/access_main.c +++ b/src/tests/eo/access/access_main.c | |||
@@ -15,7 +15,8 @@ main(int argc, char *argv[]) | |||
15 | 15 | ||
16 | Eo *obj = eo_add(INHERIT_CLASS, NULL); | 16 | Eo *obj = eo_add(INHERIT_CLASS, NULL); |
17 | 17 | ||
18 | eo_do(obj, simple_a_set(1), inherit_prot_print()); | 18 | simple_a_set(obj, 1); |
19 | inherit_prot_print(obj); | ||
19 | 20 | ||
20 | Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); | 21 | Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); |
21 | printf("Pub: %d\n", pd->public_x2); | 22 | printf("Pub: %d\n", pd->public_x2); |
diff --git a/src/tests/eo/access/access_simple.c b/src/tests/eo/access/access_simple.c index 55e55e0..b4f8766 100644 --- a/src/tests/eo/access/access_simple.c +++ b/src/tests/eo/access/access_simple.c | |||
@@ -27,7 +27,7 @@ _a_set(Eo *obj, void *class_data, int a) | |||
27 | pd->protected.protected_x1 = a + 1; | 27 | pd->protected.protected_x1 = a + 1; |
28 | pd->protected.public.public_x2 = a + 2; | 28 | pd->protected.public.public_x2 = a + 2; |
29 | 29 | ||
30 | eo_do(obj, eo_event_callback_call(EV_A_CHANGED, &pd->a)); | 30 | eo_event_callback_call(obj, EV_A_CHANGED, &pd->a); |
31 | } | 31 | } |
32 | 32 | ||
33 | EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a); | 33 | EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a); |
diff --git a/src/tests/eo/children/children_main.c b/src/tests/eo/children/children_main.c index 0e0832f..8935228 100644 --- a/src/tests/eo/children/children_main.c +++ b/src/tests/eo/children/children_main.c | |||
@@ -28,7 +28,7 @@ main(int argc, char *argv[]) | |||
28 | Eo *child2 = eo_add(SIMPLE_CLASS, parent); | 28 | Eo *child2 = eo_add(SIMPLE_CLASS, parent); |
29 | Eo *child3 = eo_add(SIMPLE_CLASS, parent); | 29 | Eo *child3 = eo_add(SIMPLE_CLASS, parent); |
30 | 30 | ||
31 | eo_do(parent, iter = eo_children_iterator_new()); | 31 | iter = eo_children_iterator_new(parent); |
32 | fail_if(!iter); | 32 | fail_if(!iter); |
33 | 33 | ||
34 | CHECK_ITER_DATA(iter, chld, child1); | 34 | CHECK_ITER_DATA(iter, chld, child1); |
@@ -40,7 +40,7 @@ main(int argc, char *argv[]) | |||
40 | 40 | ||
41 | eo_del(child2); | 41 | eo_del(child2); |
42 | 42 | ||
43 | eo_do(parent, iter = eo_children_iterator_new()); | 43 | iter = eo_children_iterator_new(parent); |
44 | fail_if(!iter); | 44 | fail_if(!iter); |
45 | 45 | ||
46 | CHECK_ITER_DATA(iter, chld, child1); | 46 | CHECK_ITER_DATA(iter, chld, child1); |
@@ -52,7 +52,7 @@ main(int argc, char *argv[]) | |||
52 | 52 | ||
53 | eo_del(child1); | 53 | eo_del(child1); |
54 | 54 | ||
55 | eo_do(parent, iter = eo_children_iterator_new()); | 55 | iter = eo_children_iterator_new(parent); |
56 | fail_if(!iter); | 56 | fail_if(!iter); |
57 | 57 | ||
58 | CHECK_ITER_DATA(iter, chld, child3); | 58 | CHECK_ITER_DATA(iter, chld, child3); |
@@ -62,7 +62,7 @@ main(int argc, char *argv[]) | |||
62 | 62 | ||
63 | eo_del(child3); | 63 | eo_del(child3); |
64 | 64 | ||
65 | eo_do(parent, iter = eo_children_iterator_new()); | 65 | iter = eo_children_iterator_new(parent); |
66 | fail_if(iter); | 66 | fail_if(iter); |
67 | 67 | ||
68 | eo_unref(parent); | 68 | eo_unref(parent); |
diff --git a/src/tests/eo/composite_objects/composite_objects_comp.c b/src/tests/eo/composite_objects/composite_objects_comp.c index 32116c9..59ab956 100644 --- a/src/tests/eo/composite_objects/composite_objects_comp.c +++ b/src/tests/eo/composite_objects/composite_objects_comp.c | |||
@@ -16,7 +16,7 @@ static int | |||
16 | _a_get(Eo *obj, void *class_data EINA_UNUSED) | 16 | _a_get(Eo *obj, void *class_data EINA_UNUSED) |
17 | { | 17 | { |
18 | int a = 0; | 18 | int a = 0; |
19 | eo_do_super(obj, MY_CLASS, a = simple_a_get()); | 19 | a = simple_a_get(eo_super(obj, MY_CLASS)); |
20 | 20 | ||
21 | return a; | 21 | return a; |
22 | } | 22 | } |
@@ -25,16 +25,16 @@ static Eo * | |||
25 | _constructor(Eo *obj, void *class_data EINA_UNUSED) | 25 | _constructor(Eo *obj, void *class_data EINA_UNUSED) |
26 | { | 26 | { |
27 | Eina_Bool tmp; | 27 | Eina_Bool tmp; |
28 | obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 28 | obj = eo_constructor(eo_super(obj, MY_CLASS)); |
29 | 29 | ||
30 | Eo *simple = eo_add(SIMPLE_CLASS, obj); | 30 | Eo *simple = eo_add(SIMPLE_CLASS, obj); |
31 | eo_do(obj, eo_composite_attach(simple)); | 31 | eo_composite_attach(obj, simple); |
32 | eo_do(simple, eo_event_callback_forwarder_add(EV_A_CHANGED, obj)); | 32 | eo_event_callback_forwarder_add(simple, EV_A_CHANGED, obj); |
33 | 33 | ||
34 | fail_if(eo_do_ret(obj, tmp, eo_composite_part_is())); | 34 | fail_if(eo_composite_part_is(obj)); |
35 | fail_if(!eo_do_ret(simple, tmp, eo_composite_part_is())); | 35 | fail_if(!eo_composite_part_is(simple)); |
36 | 36 | ||
37 | eo_do(obj, eo_key_data_set("simple-obj", simple)); | 37 | eo_key_data_set(obj, "simple-obj", simple); |
38 | 38 | ||
39 | return obj; | 39 | return obj; |
40 | } | 40 | } |
diff --git a/src/tests/eo/composite_objects/composite_objects_main.c b/src/tests/eo/composite_objects/composite_objects_main.c index 5ad11c6..9e90eb4 100644 --- a/src/tests/eo/composite_objects/composite_objects_main.c +++ b/src/tests/eo/composite_objects/composite_objects_main.c | |||
@@ -32,49 +32,49 @@ main(int argc, char *argv[]) | |||
32 | eo_init(); | 32 | eo_init(); |
33 | 33 | ||
34 | Eo *obj = eo_add(COMP_CLASS, NULL); | 34 | Eo *obj = eo_add(COMP_CLASS, NULL); |
35 | eo_do(obj, eo_event_callback_add(EV_A_CHANGED, _a_changed_cb, NULL)); | 35 | eo_event_callback_add(obj, EV_A_CHANGED, _a_changed_cb, NULL); |
36 | 36 | ||
37 | fail_if(!eo_isa(obj, COMP_CLASS)); | 37 | fail_if(!eo_isa(obj, COMP_CLASS)); |
38 | fail_if(!eo_isa(obj, SIMPLE_CLASS)); | 38 | fail_if(!eo_isa(obj, SIMPLE_CLASS)); |
39 | 39 | ||
40 | int a = 0; | 40 | int a = 0; |
41 | cb_called = EINA_FALSE; | 41 | cb_called = EINA_FALSE; |
42 | eo_do(obj, simple_a_set(1)); | 42 | simple_a_set(obj, 1); |
43 | fail_if(!cb_called); | 43 | fail_if(!cb_called); |
44 | 44 | ||
45 | /* Test functions from all across the chain. */ | 45 | /* Test functions from all across the chain. */ |
46 | cb_called = EINA_FALSE; | 46 | cb_called = EINA_FALSE; |
47 | eo_do(obj, simple_a_set1(1)); | 47 | simple_a_set1(obj, 1); |
48 | fail_if(!cb_called); | 48 | fail_if(!cb_called); |
49 | cb_called = EINA_FALSE; | 49 | cb_called = EINA_FALSE; |
50 | eo_do(obj, simple_a_set15(1)); | 50 | simple_a_set15(obj, 1); |
51 | fail_if(!cb_called); | 51 | fail_if(!cb_called); |
52 | cb_called = EINA_FALSE; | 52 | cb_called = EINA_FALSE; |
53 | eo_do(obj, simple_a_set32(1)); | 53 | simple_a_set32(obj, 1); |
54 | fail_if(!cb_called); | 54 | fail_if(!cb_called); |
55 | 55 | ||
56 | eo_do(obj, a = simple_a_get()); | 56 | a = simple_a_get(obj); |
57 | fail_if(a != 1); | 57 | fail_if(a != 1); |
58 | 58 | ||
59 | /* disable the callback forwarder, and fail if it's still called. */ | 59 | /* disable the callback forwarder, and fail if it's still called. */ |
60 | Eo *simple = NULL; | 60 | Eo *simple = NULL; |
61 | eo_do(obj, simple = eo_key_data_get("simple-obj")); | 61 | simple = eo_key_data_get(obj, "simple-obj"); |
62 | eo_ref(simple); | 62 | eo_ref(simple); |
63 | eo_do(simple, eo_event_callback_forwarder_del(EV_A_CHANGED, obj)); | 63 | eo_event_callback_forwarder_del(simple, EV_A_CHANGED, obj); |
64 | 64 | ||
65 | cb_called = EINA_FALSE; | 65 | cb_called = EINA_FALSE; |
66 | eo_do(obj, simple_a_set(2)); | 66 | simple_a_set(obj, 2); |
67 | fail_if(cb_called); | 67 | fail_if(cb_called); |
68 | 68 | ||
69 | fail_if(!eo_do_ret(simple, tmp,eo_composite_part_is())); | 69 | fail_if(!eo_composite_part_is(simple)); |
70 | fail_if(!eo_do_ret(obj, tmp,eo_composite_detach(simple))); | 70 | fail_if(!eo_composite_detach(obj, simple)); |
71 | fail_if(eo_do_ret(obj, tmp,eo_composite_detach(simple))); | 71 | fail_if(eo_composite_detach(obj, simple)); |
72 | fail_if(eo_do_ret(simple, tmp,eo_composite_part_is())); | 72 | fail_if(eo_composite_part_is(simple)); |
73 | fail_if(!eo_do_ret(obj, tmp,eo_composite_attach(simple))); | 73 | fail_if(!eo_composite_attach(obj, simple)); |
74 | fail_if(!eo_do_ret(simple, tmp,eo_composite_part_is())); | 74 | fail_if(!eo_composite_part_is(simple)); |
75 | fail_if(eo_do_ret(obj, tmp,eo_composite_attach(simple))); | 75 | fail_if(eo_composite_attach(obj, simple)); |
76 | 76 | ||
77 | fail_if(eo_do_ret(simple, tmp,eo_composite_attach(obj))); | 77 | fail_if(eo_composite_attach(simple, obj)); |
78 | 78 | ||
79 | eo_unref(simple); | 79 | eo_unref(simple); |
80 | eo_unref(obj); | 80 | eo_unref(obj); |
diff --git a/src/tests/eo/composite_objects/composite_objects_simple.c b/src/tests/eo/composite_objects/composite_objects_simple.c index b9c906e..5c64cc0 100644 --- a/src/tests/eo/composite_objects/composite_objects_simple.c +++ b/src/tests/eo/composite_objects/composite_objects_simple.c | |||
@@ -17,7 +17,7 @@ _a_set(Eo *obj, void *class_data, int a) | |||
17 | printf("%s %d\n", eo_class_name_get(MY_CLASS), a); | 17 | printf("%s %d\n", eo_class_name_get(MY_CLASS), a); |
18 | pd->a = a; | 18 | pd->a = a; |
19 | 19 | ||
20 | eo_do(obj, eo_event_callback_call(EV_A_CHANGED, &pd->a)); | 20 | eo_event_callback_call(obj, EV_A_CHANGED, &pd->a); |
21 | } | 21 | } |
22 | 22 | ||
23 | static int | 23 | static int |
diff --git a/src/tests/eo/constructors/constructors_main.c b/src/tests/eo/constructors/constructors_main.c index cab5e7f..5844e46 100644 --- a/src/tests/eo/constructors/constructors_main.c +++ b/src/tests/eo/constructors/constructors_main.c | |||
@@ -28,10 +28,13 @@ main(int argc, char *argv[]) | |||
28 | 28 | ||
29 | fail_if(my_init_count != 2); | 29 | fail_if(my_init_count != 2); |
30 | 30 | ||
31 | eo_do(obj, simple_a_set(1), simple_b_set(2)); | 31 | simple_a_set(obj, 1); |
32 | simple_b_set(obj, 2); | ||
32 | 33 | ||
33 | int a = 0, b = 0; | 34 | int a = 0, b = 0; |
34 | eo_do(obj, a = simple_a_get(), b = simple_b_get(), mixin_add_and_print(5)); | 35 | a = simple_a_get(obj); |
36 | b = simple_b_get(obj); | ||
37 | mixin_add_and_print(obj, 5); | ||
35 | fail_if(a != 1); | 38 | fail_if(a != 1); |
36 | fail_if(b != 2); | 39 | fail_if(b != 2); |
37 | 40 | ||
@@ -69,19 +72,18 @@ main(int argc, char *argv[]) | |||
69 | obj = eo_add(SIMPLE_CLASS, NULL); | 72 | obj = eo_add(SIMPLE_CLASS, NULL); |
70 | fail_if(!obj); | 73 | fail_if(!obj); |
71 | fail_if(my_init_count != 2); | 74 | fail_if(my_init_count != 2); |
72 | eo_do(obj, a = simple_a_get()); | 75 | a = simple_a_get(obj); |
73 | fail_if(a != 0); | 76 | fail_if(a != 0); |
74 | 77 | ||
75 | my_init_count = 0; | 78 | my_init_count = 0; |
76 | obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(7)); | 79 | obj = eo_add(SIMPLE_CLASS, NULL, simple_a_set(eoid, 7)); |
77 | fail_if(!obj); | 80 | fail_if(!obj); |
78 | fail_if(my_init_count != 2); | 81 | fail_if(my_init_count != 2); |
79 | eo_do(obj, a = simple_a_get();); | 82 | a = simple_a_get(obj); |
80 | fail_if(a != 7); | 83 | fail_if(a != 7); |
81 | 84 | ||
82 | my_init_count = 0; | 85 | my_init_count = 0; |
83 | obj = eo_add(SIMPLE_CLASS, NULL, simple_b_set(6), simple_a_set(-1), | 86 | obj = eo_add(SIMPLE_CLASS, NULL, simple_b_set(eoid, 6), simple_a_set(eoid, -1), b = simple_b_get(eoid)); |
84 | b = simple_b_get()); | ||
85 | fail_if(obj); | 87 | fail_if(obj); |
86 | fail_if(b != 6); | 88 | fail_if(b != 6); |
87 | fail_if(my_init_count != 0); | 89 | fail_if(my_init_count != 0); |
diff --git a/src/tests/eo/constructors/constructors_mixin.c b/src/tests/eo/constructors/constructors_mixin.c index 10213b1..b2e523b 100644 --- a/src/tests/eo/constructors/constructors_mixin.c +++ b/src/tests/eo/constructors/constructors_mixin.c | |||
@@ -12,7 +12,8 @@ static void | |||
12 | _add_and_print_set(Eo *obj, void *class_data EINA_UNUSED, int x) | 12 | _add_and_print_set(Eo *obj, void *class_data EINA_UNUSED, int x) |
13 | { | 13 | { |
14 | int a = 0, b = 0; | 14 | int a = 0, b = 0; |
15 | eo_do(obj, a = simple_a_get(), b = simple_b_get()); | 15 | a = simple_a_get(obj); |
16 | b = simple_b_get(obj); | ||
16 | printf("%s %d\n", __func__, a + b + x); | 17 | printf("%s %d\n", __func__, a + b + x); |
17 | } | 18 | } |
18 | 19 | ||
@@ -23,13 +24,13 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED) | |||
23 | { | 24 | { |
24 | my_init_count++; | 25 | my_init_count++; |
25 | 26 | ||
26 | return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 27 | return eo_constructor(eo_super(obj, MY_CLASS)); |
27 | } | 28 | } |
28 | 29 | ||
29 | static void | 30 | static void |
30 | _destructor(Eo *obj, void *class_data EINA_UNUSED) | 31 | _destructor(Eo *obj, void *class_data EINA_UNUSED) |
31 | { | 32 | { |
32 | eo_do_super(obj, MY_CLASS, eo_destructor()); | 33 | eo_destructor(eo_super(obj, MY_CLASS)); |
33 | 34 | ||
34 | my_init_count--; | 35 | my_init_count--; |
35 | } | 36 | } |
diff --git a/src/tests/eo/constructors/constructors_simple.c b/src/tests/eo/constructors/constructors_simple.c index d287485..370ca60 100644 --- a/src/tests/eo/constructors/constructors_simple.c +++ b/src/tests/eo/constructors/constructors_simple.c | |||
@@ -44,7 +44,7 @@ _constructor(Eo *obj, void *class_data EINA_UNUSED) | |||
44 | { | 44 | { |
45 | my_init_count++; | 45 | my_init_count++; |
46 | 46 | ||
47 | return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 47 | return eo_constructor(eo_super(obj, MY_CLASS)); |
48 | } | 48 | } |
49 | 49 | ||
50 | static Eo* | 50 | static Eo* |
@@ -53,7 +53,7 @@ _finalize(Eo *obj, void *class_data EINA_UNUSED) | |||
53 | Eo *ret; | 53 | Eo *ret; |
54 | Private_Data *pd = class_data; | 54 | Private_Data *pd = class_data; |
55 | 55 | ||
56 | eo_do_super(obj, MY_CLASS, ret = eo_finalize()); | 56 | ret = eo_finalize(eo_super(obj, MY_CLASS)); |
57 | 57 | ||
58 | if (pd->a < 0) | 58 | if (pd->a < 0) |
59 | { | 59 | { |
@@ -66,7 +66,7 @@ _finalize(Eo *obj, void *class_data EINA_UNUSED) | |||
66 | static void | 66 | static void |
67 | _destructor(Eo *obj, void *class_data EINA_UNUSED) | 67 | _destructor(Eo *obj, void *class_data EINA_UNUSED) |
68 | { | 68 | { |
69 | eo_do_super(obj, MY_CLASS, eo_destructor()); | 69 | eo_destructor(eo_super(obj, MY_CLASS)); |
70 | 70 | ||
71 | my_init_count--; | 71 | my_init_count--; |
72 | } | 72 | } |
diff --git a/src/tests/eo/constructors/constructors_simple2.c b/src/tests/eo/constructors/constructors_simple2.c index e0c6804..b1e59f8 100644 --- a/src/tests/eo/constructors/constructors_simple2.c +++ b/src/tests/eo/constructors/constructors_simple2.c | |||
@@ -11,7 +11,7 @@ | |||
11 | static Eo * | 11 | static Eo * |
12 | _constructor(Eo *obj, void *class_data EINA_UNUSED) | 12 | _constructor(Eo *obj, void *class_data EINA_UNUSED) |
13 | { | 13 | { |
14 | obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 14 | obj = eo_constructor(eo_super(obj, MY_CLASS)); |
15 | 15 | ||
16 | return NULL; | 16 | return NULL; |
17 | } | 17 | } |
diff --git a/src/tests/eo/constructors/constructors_simple6.c b/src/tests/eo/constructors/constructors_simple6.c index 9f4355d..f3e12b8 100644 --- a/src/tests/eo/constructors/constructors_simple6.c +++ b/src/tests/eo/constructors/constructors_simple6.c | |||
@@ -11,7 +11,7 @@ | |||
11 | static void | 11 | static void |
12 | _destructor(Eo *obj, void *class_data EINA_UNUSED) | 12 | _destructor(Eo *obj, void *class_data EINA_UNUSED) |
13 | { | 13 | { |
14 | eo_do_super(obj, MY_CLASS, eo_destructor()); | 14 | eo_destructor(eo_super(obj, MY_CLASS)); |
15 | } | 15 | } |
16 | 16 | ||
17 | static Eo_Op_Description op_descs [] = { | 17 | static Eo_Op_Description op_descs [] = { |
diff --git a/src/tests/eo/constructors/constructors_simple7.c b/src/tests/eo/constructors/constructors_simple7.c index d3ec9ea..c821d25 100644 --- a/src/tests/eo/constructors/constructors_simple7.c +++ b/src/tests/eo/constructors/constructors_simple7.c | |||
@@ -15,7 +15,7 @@ static Eo * | |||
15 | _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) | 15 | _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) |
16 | { | 16 | { |
17 | /* FIXME: Actually test it. */ | 17 | /* FIXME: Actually test it. */ |
18 | return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 18 | return eo_constructor(eo_super(obj, MY_CLASS)); |
19 | } | 19 | } |
20 | 20 | ||
21 | static Eo_Op_Description op_descs [] = { | 21 | static Eo_Op_Description op_descs [] = { |
diff --git a/src/tests/eo/function_overrides/function_overrides_inherit2.c b/src/tests/eo/function_overrides/function_overrides_inherit2.c index e250ee3..b4602aa 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit2.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit2.c | |||
@@ -15,11 +15,11 @@ static void | |||
15 | _a_set(Eo *obj, void *class_data EINA_UNUSED, int a) | 15 | _a_set(Eo *obj, void *class_data EINA_UNUSED, int a) |
16 | { | 16 | { |
17 | printf("%s %d\n", eo_class_name_get(MY_CLASS), a); | 17 | printf("%s %d\n", eo_class_name_get(MY_CLASS), a); |
18 | eo_do(obj, simple_a_print()); | 18 | simple_a_print(obj); |
19 | eo_do_super(obj, MY_CLASS, simple_a_set(a + 1)); | 19 | simple_a_set(eo_super(obj, MY_CLASS), a + 1); |
20 | 20 | ||
21 | Eina_Bool called = EINA_FALSE; | 21 | Eina_Bool called = EINA_FALSE; |
22 | eo_do_super(obj, MY_CLASS, called = simple_a_print()); | 22 | called = simple_a_print(eo_super(obj, MY_CLASS)); |
23 | fail_if(!called); | 23 | fail_if(!called); |
24 | } | 24 | } |
25 | 25 | ||
@@ -28,7 +28,7 @@ _print(Eo *obj, void *class_data EINA_UNUSED) | |||
28 | { | 28 | { |
29 | Eina_Bool called = EINA_FALSE; | 29 | Eina_Bool called = EINA_FALSE; |
30 | printf("Hey\n"); | 30 | printf("Hey\n"); |
31 | eo_do_super(obj, MY_CLASS, called = inherit2_print()); | 31 | called = inherit2_print(eo_super(obj, MY_CLASS)); |
32 | fail_if(called); | 32 | fail_if(called); |
33 | 33 | ||
34 | return EINA_TRUE; | 34 | return EINA_TRUE; |
@@ -47,10 +47,10 @@ _class_print(Eo_Class *klass, void *data EINA_UNUSED) | |||
47 | { | 47 | { |
48 | Eina_Bool called = EINA_FALSE; | 48 | Eina_Bool called = EINA_FALSE; |
49 | printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS)); | 49 | printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS)); |
50 | eo_do_super(klass, MY_CLASS, called = simple_class_print()); | 50 | called = simple_class_print(eo_super(klass, MY_CLASS)); |
51 | fail_if(!called); | 51 | fail_if(!called); |
52 | 52 | ||
53 | eo_do_super(klass, MY_CLASS, called = simple_class_print2()); | 53 | called = simple_class_print2(eo_super(klass, MY_CLASS)); |
54 | fail_if(!called); | 54 | fail_if(!called); |
55 | 55 | ||
56 | return EINA_TRUE; | 56 | return EINA_TRUE; |
diff --git a/src/tests/eo/function_overrides/function_overrides_inherit3.c b/src/tests/eo/function_overrides/function_overrides_inherit3.c index 2f96d59..4c23281 100644 --- a/src/tests/eo/function_overrides/function_overrides_inherit3.c +++ b/src/tests/eo/function_overrides/function_overrides_inherit3.c | |||
@@ -13,7 +13,7 @@ static void | |||
13 | _a_set(Eo *obj, void *class_data EINA_UNUSED, int a) | 13 | _a_set(Eo *obj, void *class_data EINA_UNUSED, int a) |
14 | { | 14 | { |
15 | printf("%s %d\n", eo_class_name_get(MY_CLASS), a); | 15 | printf("%s %d\n", eo_class_name_get(MY_CLASS), a); |
16 | eo_do_super(obj, MY_CLASS, simple_a_set(a + 1)); | 16 | simple_a_set(eo_super(obj, MY_CLASS), a + 1); |
17 | } | 17 | } |
18 | 18 | ||
19 | static Eo_Op_Description op_descs[] = { | 19 | static Eo_Op_Description op_descs[] = { |
diff --git a/src/tests/eo/function_overrides/function_overrides_main.c b/src/tests/eo/function_overrides/function_overrides_main.c index 920595c..b2aa840 100644 --- a/src/tests/eo/function_overrides/function_overrides_main.c +++ b/src/tests/eo/function_overrides/function_overrides_main.c | |||
@@ -20,7 +20,7 @@ main(int argc, char *argv[]) | |||
20 | Eina_Bool called = EINA_FALSE; | 20 | Eina_Bool called = EINA_FALSE; |
21 | Eo *obj = eo_add(INHERIT2_CLASS, NULL); | 21 | Eo *obj = eo_add(INHERIT2_CLASS, NULL); |
22 | 22 | ||
23 | eo_do(obj, simple_a_set(1)); | 23 | simple_a_set(obj, 1); |
24 | Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); | 24 | Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); |
25 | fail_if(pd->a != 2); | 25 | fail_if(pd->a != 2); |
26 | 26 | ||
@@ -28,47 +28,48 @@ main(int argc, char *argv[]) | |||
28 | 28 | ||
29 | obj = eo_add(INHERIT3_CLASS, NULL); | 29 | obj = eo_add(INHERIT3_CLASS, NULL); |
30 | 30 | ||
31 | eo_do(obj, simple_a_set(1)); | 31 | simple_a_set(obj, 1); |
32 | pd = eo_data_scope_get(obj, SIMPLE_CLASS); | 32 | pd = eo_data_scope_get(obj, SIMPLE_CLASS); |
33 | fail_if(pd->a != 3); | 33 | fail_if(pd->a != 3); |
34 | 34 | ||
35 | eo_unref(obj); | 35 | eo_unref(obj); |
36 | 36 | ||
37 | obj = eo_add(INHERIT2_CLASS, NULL); | 37 | obj = eo_add(INHERIT2_CLASS, NULL); |
38 | eo_do(obj, called = inherit2_print()); | 38 | called = inherit2_print(obj); |
39 | fail_if(!called); | 39 | fail_if(!called); |
40 | eo_do(obj, called = inherit2_print(), called = inherit2_print()); | 40 | called = inherit2_print(obj); |
41 | called = inherit2_print(obj); | ||
41 | fail_if(!called); | 42 | fail_if(!called); |
42 | eo_unref(obj); | 43 | eo_unref(obj); |
43 | 44 | ||
44 | obj = eo_add(SIMPLE_CLASS, NULL); | 45 | obj = eo_add(SIMPLE_CLASS, NULL); |
45 | eo_do(obj, called = inherit2_print()); | 46 | called = inherit2_print(obj); |
46 | fail_if(called); | 47 | fail_if(called); |
47 | 48 | ||
48 | #ifdef EO_DEBUG | 49 | #ifdef EO_DEBUG |
49 | eo_do(obj, called = simple_class_print()); | 50 | called = simple_class_print(obj); |
50 | fail_if(called); | 51 | fail_if(called); |
51 | #endif | 52 | #endif |
52 | 53 | ||
53 | eo_do(SIMPLE_CLASS, called = simple_class_print()); | 54 | called = simple_class_print(SIMPLE_CLASS); |
54 | fail_if(!called); | 55 | fail_if(!called); |
55 | 56 | ||
56 | eo_do(INHERIT_CLASS, called = simple_class_print()); | 57 | called = simple_class_print(INHERIT_CLASS); |
57 | fail_if(!called); | 58 | fail_if(!called); |
58 | 59 | ||
59 | eo_do(INHERIT2_CLASS, called = simple_class_print()); | 60 | called = simple_class_print(INHERIT2_CLASS); |
60 | fail_if(!called); | 61 | fail_if(!called); |
61 | 62 | ||
62 | eo_do(INHERIT3_CLASS, called = simple_class_print()); | 63 | called = simple_class_print(INHERIT3_CLASS); |
63 | fail_if(!called); | 64 | fail_if(!called); |
64 | 65 | ||
65 | #ifdef EO_DEBUG | 66 | #ifdef EO_DEBUG |
66 | eo_do(SIMPLE_CLASS, called = simple_a_print()); | 67 | called = simple_a_print(SIMPLE_CLASS); |
67 | fail_if(called); | 68 | fail_if(called); |
68 | #endif | 69 | #endif |
69 | 70 | ||
70 | eo_do_super(obj, SIMPLE_CLASS, eo_constructor()); | 71 | eo_constructor(eo_super(obj, SIMPLE_CLASS)); |
71 | eo_do_super(obj, SIMPLE_CLASS, eo_destructor()); | 72 | eo_destructor(eo_super(obj, SIMPLE_CLASS)); |
72 | 73 | ||
73 | eo_unref(obj); | 74 | eo_unref(obj); |
74 | 75 | ||
diff --git a/src/tests/eo/function_overrides/function_overrides_simple.c b/src/tests/eo/function_overrides/function_overrides_simple.c index dc5f0dd..57942f7 100644 --- a/src/tests/eo/function_overrides/function_overrides_simple.c +++ b/src/tests/eo/function_overrides/function_overrides_simple.c | |||
@@ -34,10 +34,10 @@ _class_print(Eo_Class *klass, void *class_data EINA_UNUSED) | |||
34 | { | 34 | { |
35 | printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS)); | 35 | printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS)); |
36 | Eina_Bool called = EINA_FALSE; | 36 | Eina_Bool called = EINA_FALSE; |
37 | eo_do_super(klass, MY_CLASS, called = simple_class_print()); | 37 | called = simple_class_print(eo_super(klass, MY_CLASS)); |
38 | fail_if(called); | 38 | fail_if(called); |
39 | 39 | ||
40 | eo_do_super(klass, MY_CLASS, called = simple_class_print2()); | 40 | called = simple_class_print2(eo_super(klass, MY_CLASS)); |
41 | fail_if(called); | 41 | fail_if(called); |
42 | 42 | ||
43 | return EINA_TRUE; | 43 | return EINA_TRUE; |
diff --git a/src/tests/eo/interface/interface_main.c b/src/tests/eo/interface/interface_main.c index 40936d4..a85f030 100644 --- a/src/tests/eo/interface/interface_main.c +++ b/src/tests/eo/interface/interface_main.c | |||
@@ -18,16 +18,21 @@ main(int argc, char *argv[]) | |||
18 | 18 | ||
19 | Eo *obj = eo_add(SIMPLE_CLASS, NULL); | 19 | Eo *obj = eo_add(SIMPLE_CLASS, NULL); |
20 | 20 | ||
21 | eo_do(obj, simple_a_set(1), simple_b_set(2)); | 21 | simple_a_set(obj, 1); |
22 | simple_b_set(obj, 2); | ||
22 | 23 | ||
23 | int a = 0, b = 0, sum = 0; | 24 | int a = 0, b = 0, sum = 0; |
24 | eo_do(obj, a = simple_a_get(), b = simple_b_get(), sum = interface_ab_sum_get()); | 25 | a = simple_a_get(obj); |
26 | b = simple_b_get(obj); | ||
27 | sum = interface_ab_sum_get(obj); | ||
25 | fail_if(sum != a + b); | 28 | fail_if(sum != a + b); |
26 | 29 | ||
27 | sum = 0; | 30 | sum = 0; |
28 | eo_do(obj, sum = interface_ab_sum_get(), sum = interface_ab_sum_get()); | 31 | sum = interface_ab_sum_get(obj); |
32 | sum = interface_ab_sum_get(obj); | ||
29 | fail_if(sum != a + b); | 33 | fail_if(sum != a + b); |
30 | eo_do(obj, sum = interface2_ab_sum_get2(), sum = interface2_ab_sum_get2()); | 34 | sum = interface2_ab_sum_get2(obj); |
35 | sum = interface2_ab_sum_get2(obj); | ||
31 | fail_if(sum != a + b + 1); | 36 | fail_if(sum != a + b + 1); |
32 | 37 | ||
33 | eo_unref(obj); | 38 | eo_unref(obj); |
diff --git a/src/tests/eo/interface/interface_simple.c b/src/tests/eo/interface/interface_simple.c index cad7f24..589274f 100644 --- a/src/tests/eo/interface/interface_simple.c +++ b/src/tests/eo/interface/interface_simple.c | |||
@@ -40,7 +40,8 @@ static int | |||
40 | _ab_sum_get(Eo *obj, void *class_data EINA_UNUSED) | 40 | _ab_sum_get(Eo *obj, void *class_data EINA_UNUSED) |
41 | { | 41 | { |
42 | int a = 0, b = 0; | 42 | int a = 0, b = 0; |
43 | eo_do(obj, a = simple_a_get(), b = simple_b_get()); | 43 | a = simple_a_get(obj); |
44 | b = simple_b_get(obj); | ||
44 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); | 45 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); |
45 | return a + b; | 46 | return a + b; |
46 | } | 47 | } |
@@ -49,7 +50,8 @@ static int | |||
49 | _ab_sum_get2(Eo *obj, void *class_data EINA_UNUSED) | 50 | _ab_sum_get2(Eo *obj, void *class_data EINA_UNUSED) |
50 | { | 51 | { |
51 | int a = 0, b = 0; | 52 | int a = 0, b = 0; |
52 | eo_do(obj, a = simple_a_get(), b = simple_b_get()); | 53 | a = simple_a_get(obj); |
54 | b = simple_b_get(obj); | ||
53 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); | 55 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); |
54 | return a + b + 1; | 56 | return a + b + 1; |
55 | } | 57 | } |
diff --git a/src/tests/eo/mixin/mixin_inherit.c b/src/tests/eo/mixin/mixin_inherit.c index 8098c1c..b583bef 100644 --- a/src/tests/eo/mixin/mixin_inherit.c +++ b/src/tests/eo/mixin/mixin_inherit.c | |||
@@ -13,7 +13,7 @@ static int | |||
13 | _a_get(Eo *obj, void *class_data EINA_UNUSED) | 13 | _a_get(Eo *obj, void *class_data EINA_UNUSED) |
14 | { | 14 | { |
15 | int ret = 0; | 15 | int ret = 0; |
16 | eo_do_super(obj, MY_CLASS, ret = simple_a_get()); | 16 | ret = simple_a_get(eo_super(obj, MY_CLASS)); |
17 | printf("%s %d\n", __func__, ret); | 17 | printf("%s %d\n", __func__, ret); |
18 | 18 | ||
19 | return ret; | 19 | return ret; |
diff --git a/src/tests/eo/mixin/mixin_main.c b/src/tests/eo/mixin/mixin_main.c index 6ab6af2..d3c1dbf 100644 --- a/src/tests/eo/mixin/mixin_main.c +++ b/src/tests/eo/mixin/mixin_main.c | |||
@@ -20,13 +20,17 @@ main(int argc, char *argv[]) | |||
20 | 20 | ||
21 | Eo *obj = eo_add(SIMPLE_CLASS, NULL); | 21 | Eo *obj = eo_add(SIMPLE_CLASS, NULL); |
22 | 22 | ||
23 | eo_do(obj, simple_a_set(1), simple_b_set(2)); | 23 | simple_a_set(obj, 1); |
24 | simple_b_set(obj, 2); | ||
24 | 25 | ||
25 | int a = 0, b = 0, sum = 0; | 26 | int a = 0, b = 0, sum = 0; |
26 | eo_do(obj, a = simple_a_get(), b = simple_b_get(), sum = mixin_ab_sum_get()); | 27 | a = simple_a_get(obj); |
28 | b = simple_b_get(obj); | ||
29 | sum = mixin_ab_sum_get(obj); | ||
27 | fail_if(sum != a + b + 2); /* 2 for the two mixins... */ | 30 | fail_if(sum != a + b + 2); /* 2 for the two mixins... */ |
28 | 31 | ||
29 | eo_do(obj, sum = mixin_ab_sum_get(), sum = mixin_ab_sum_get()); | 32 | sum = mixin_ab_sum_get(obj); |
33 | sum = mixin_ab_sum_get(obj); | ||
30 | 34 | ||
31 | Mixin2_Public_Data *pd2 = eo_data_scope_get(obj, MIXIN2_CLASS); | 35 | Mixin2_Public_Data *pd2 = eo_data_scope_get(obj, MIXIN2_CLASS); |
32 | fail_if(pd2->count != 6); | 36 | fail_if(pd2->count != 6); |
@@ -37,7 +41,8 @@ main(int argc, char *argv[]) | |||
37 | eo_unref(obj); | 41 | eo_unref(obj); |
38 | 42 | ||
39 | obj = eo_add(INHERIT_CLASS, NULL); | 43 | obj = eo_add(INHERIT_CLASS, NULL); |
40 | eo_do(obj, simple_a_set(5), a = simple_a_get()); | 44 | simple_a_set(obj, 5); |
45 | a = simple_a_get(obj); | ||
41 | printf("%d\n", a); | 46 | printf("%d\n", a); |
42 | fail_if(a != 5); | 47 | fail_if(a != 5); |
43 | 48 | ||
diff --git a/src/tests/eo/mixin/mixin_mixin.c b/src/tests/eo/mixin/mixin_mixin.c index d8569d4..427293e 100644 --- a/src/tests/eo/mixin/mixin_mixin.c +++ b/src/tests/eo/mixin/mixin_mixin.c | |||
@@ -12,7 +12,8 @@ static int | |||
12 | _ab_sum_get(Eo *obj, void *class_data EINA_UNUSED) | 12 | _ab_sum_get(Eo *obj, void *class_data EINA_UNUSED) |
13 | { | 13 | { |
14 | int a = 0, b = 0; | 14 | int a = 0, b = 0; |
15 | eo_do(obj, a = simple_a_get(), b = simple_b_get()); | 15 | a = simple_a_get(obj); |
16 | b = simple_b_get(obj); | ||
16 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); | 17 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); |
17 | return a + b; | 18 | return a + b; |
18 | } | 19 | } |
@@ -20,13 +21,13 @@ _ab_sum_get(Eo *obj, void *class_data EINA_UNUSED) | |||
20 | static Eo * | 21 | static Eo * |
21 | _constructor(Eo *obj, void *class_data EINA_UNUSED) | 22 | _constructor(Eo *obj, void *class_data EINA_UNUSED) |
22 | { | 23 | { |
23 | return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 24 | return eo_constructor(eo_super(obj, MY_CLASS)); |
24 | } | 25 | } |
25 | 26 | ||
26 | static void | 27 | static void |
27 | _destructor(Eo *obj, void *class_data EINA_UNUSED) | 28 | _destructor(Eo *obj, void *class_data EINA_UNUSED) |
28 | { | 29 | { |
29 | eo_do_super(obj, MY_CLASS, eo_destructor()); | 30 | eo_destructor(eo_super(obj, MY_CLASS)); |
30 | } | 31 | } |
31 | 32 | ||
32 | EAPI EO_FUNC_BODY(mixin_ab_sum_get, int, 0); | 33 | EAPI EO_FUNC_BODY(mixin_ab_sum_get, int, 0); |
diff --git a/src/tests/eo/mixin/mixin_mixin2.c b/src/tests/eo/mixin/mixin_mixin2.c index 7aff72b..93f30f6 100644 --- a/src/tests/eo/mixin/mixin_mixin2.c +++ b/src/tests/eo/mixin/mixin_mixin2.c | |||
@@ -18,14 +18,15 @@ _ab_sum_get(Eo *obj, void *class_data) | |||
18 | Mixin2_Public_Data *pd = (Mixin2_Public_Data *) class_data; | 18 | Mixin2_Public_Data *pd = (Mixin2_Public_Data *) class_data; |
19 | int sum = 0; | 19 | int sum = 0; |
20 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); | 20 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); |
21 | eo_do_super(obj, MY_CLASS, sum = mixin_ab_sum_get()); | 21 | sum = mixin_ab_sum_get(eo_super(obj, MY_CLASS)); |
22 | 22 | ||
23 | ++sum; | 23 | ++sum; |
24 | pd->count += 2; | 24 | pd->count += 2; |
25 | 25 | ||
26 | { | 26 | { |
27 | int _a = 0, _b = 0; | 27 | int _a = 0, _b = 0; |
28 | eo_do(obj, _a = simple_a_get(), _b = simple_b_get()); | 28 | _a = simple_a_get(obj); |
29 | _b = simple_b_get(obj); | ||
29 | fail_if(sum != _a + _b + 1); | 30 | fail_if(sum != _a + _b + 1); |
30 | } | 31 | } |
31 | 32 | ||
@@ -35,14 +36,14 @@ _ab_sum_get(Eo *obj, void *class_data) | |||
35 | static Eo * | 36 | static Eo * |
36 | _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) | 37 | _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) |
37 | { | 38 | { |
38 | obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 39 | obj = eo_constructor(eo_super(obj, MY_CLASS)); |
39 | return obj; | 40 | return obj; |
40 | } | 41 | } |
41 | 42 | ||
42 | static void | 43 | static void |
43 | _destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) | 44 | _destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) |
44 | { | 45 | { |
45 | eo_do_super(obj, MY_CLASS, eo_destructor()); | 46 | eo_destructor(eo_super(obj, MY_CLASS)); |
46 | } | 47 | } |
47 | 48 | ||
48 | static Eo_Op_Description op_descs[] = { | 49 | static Eo_Op_Description op_descs[] = { |
diff --git a/src/tests/eo/mixin/mixin_mixin3.c b/src/tests/eo/mixin/mixin_mixin3.c index d5c2ed7..2a946e4 100644 --- a/src/tests/eo/mixin/mixin_mixin3.c +++ b/src/tests/eo/mixin/mixin_mixin3.c | |||
@@ -18,14 +18,15 @@ _ab_sum_get(Eo *obj, void *class_data EINA_UNUSED) | |||
18 | Mixin3_Public_Data *pd = (Mixin3_Public_Data *) class_data; | 18 | Mixin3_Public_Data *pd = (Mixin3_Public_Data *) class_data; |
19 | int sum = 0; | 19 | int sum = 0; |
20 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); | 20 | printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); |
21 | eo_do_super(obj, MY_CLASS, sum = mixin_ab_sum_get()); | 21 | sum = mixin_ab_sum_get(eo_super(obj, MY_CLASS)); |
22 | 22 | ||
23 | ++sum; | 23 | ++sum; |
24 | pd->count += 3; | 24 | pd->count += 3; |
25 | 25 | ||
26 | { | 26 | { |
27 | int _a = 0, _b = 0; | 27 | int _a = 0, _b = 0; |
28 | eo_do(obj, _a = simple_a_get(), _b = simple_b_get()); | 28 | _a = simple_a_get(obj); |
29 | _b = simple_b_get(obj); | ||
29 | fail_if(sum != _a + _b + 2); | 30 | fail_if(sum != _a + _b + 2); |
30 | } | 31 | } |
31 | 32 | ||
@@ -35,13 +36,13 @@ _ab_sum_get(Eo *obj, void *class_data EINA_UNUSED) | |||
35 | static Eo * | 36 | static Eo * |
36 | _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) | 37 | _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) |
37 | { | 38 | { |
38 | return eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 39 | return eo_constructor(eo_super(obj, MY_CLASS)); |
39 | } | 40 | } |
40 | 41 | ||
41 | static void | 42 | static void |
42 | _destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) | 43 | _destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) |
43 | { | 44 | { |
44 | eo_do_super(obj, MY_CLASS, eo_destructor()); | 45 | eo_destructor(eo_super(obj, MY_CLASS)); |
45 | } | 46 | } |
46 | 47 | ||
47 | static Eo_Op_Description op_descs[] = { | 48 | static Eo_Op_Description op_descs[] = { |
diff --git a/src/tests/eo/signals/signals_main.c b/src/tests/eo/signals/signals_main.c index 4fcfaef..5d40331 100644 --- a/src/tests/eo/signals/signals_main.c +++ b/src/tests/eo/signals/signals_main.c | |||
@@ -23,8 +23,8 @@ _a_changed_cb(void *data, const Eo_Event *event) | |||
23 | 23 | ||
24 | cb_count++; | 24 | cb_count++; |
25 | 25 | ||
26 | eo_do(event->obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _null_cb, (void *) 23423)); | 26 | eo_event_callback_priority_add(event->obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _null_cb, (void *) 23423); |
27 | eo_do(event->obj, eo_event_callback_del(EV_A_CHANGED, _null_cb, (void *) 23423)); | 27 | eo_event_callback_del(event->obj, EV_A_CHANGED, _null_cb, (void *) 23423); |
28 | 28 | ||
29 | /* Stop as we reached the 3rd one. */ | 29 | /* Stop as we reached the 3rd one. */ |
30 | return (cb_count != 3); | 30 | return (cb_count != 3); |
@@ -41,132 +41,132 @@ main(int argc, char *argv[]) | |||
41 | Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); | 41 | Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); |
42 | 42 | ||
43 | /* The order of these two is undetermined. */ | 43 | /* The order of these two is undetermined. */ |
44 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2)); | 44 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2); |
45 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1)); | 45 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1); |
46 | /* This will be called afterwards. */ | 46 | /* This will be called afterwards. */ |
47 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_DEFAULT, _a_changed_cb, (void *) 3)); | 47 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_DEFAULT, _a_changed_cb, (void *) 3); |
48 | /* This will never be called because the previous callback returns NULL. */ | 48 | /* This will never be called because the previous callback returns NULL. */ |
49 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_AFTER, _a_changed_cb, (void *) 4)); | 49 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_AFTER, _a_changed_cb, (void *) 4); |
50 | 50 | ||
51 | eo_do(obj, simple_a_set(1)); | 51 | simple_a_set(obj, 1); |
52 | 52 | ||
53 | fail_if(cb_count != 3); | 53 | fail_if(cb_count != 3); |
54 | 54 | ||
55 | eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 3)); | 55 | eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 3); |
56 | fail_if(pd->cb_count != 3); | 56 | fail_if(pd->cb_count != 3); |
57 | 57 | ||
58 | eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 12)); | 58 | eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 12); |
59 | fail_if(pd->cb_count != 3); | 59 | fail_if(pd->cb_count != 3); |
60 | 60 | ||
61 | eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 4)); | 61 | eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 4); |
62 | fail_if(pd->cb_count != 2); | 62 | fail_if(pd->cb_count != 2); |
63 | 63 | ||
64 | eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 2)); | 64 | eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 2); |
65 | fail_if(pd->cb_count != 1); | 65 | fail_if(pd->cb_count != 1); |
66 | 66 | ||
67 | eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 1)); | 67 | eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 1); |
68 | fail_if(pd->cb_count != 0); | 68 | fail_if(pd->cb_count != 0); |
69 | 69 | ||
70 | /* Freeze/thaw. */ | 70 | /* Freeze/thaw. */ |
71 | int fcount = 0; | 71 | int fcount = 0; |
72 | cb_count = 0; | 72 | cb_count = 0; |
73 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1)); | 73 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1); |
74 | fail_if(pd->cb_count != 1); | 74 | fail_if(pd->cb_count != 1); |
75 | 75 | ||
76 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 76 | fcount = eo_event_freeze_count_get(obj); |
77 | fail_if(fcount != 0); | 77 | fail_if(fcount != 0); |
78 | 78 | ||
79 | eo_do(obj, eo_event_freeze()); | 79 | eo_event_freeze(obj); |
80 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 80 | fcount = eo_event_freeze_count_get(obj); |
81 | fail_if(fcount != 1); | 81 | fail_if(fcount != 1); |
82 | 82 | ||
83 | eo_do(obj, eo_event_freeze()); | 83 | eo_event_freeze(obj); |
84 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 84 | fcount = eo_event_freeze_count_get(obj); |
85 | fail_if(fcount != 2); | 85 | fail_if(fcount != 2); |
86 | 86 | ||
87 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2)); | 87 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2); |
88 | fail_if(pd->cb_count != 2); | 88 | fail_if(pd->cb_count != 2); |
89 | 89 | ||
90 | eo_do(obj, simple_a_set(2)); | 90 | simple_a_set(obj, 2); |
91 | fail_if(cb_count != 0); | 91 | fail_if(cb_count != 0); |
92 | eo_do(obj, eo_event_thaw()); | 92 | eo_event_thaw(obj); |
93 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 93 | fcount = eo_event_freeze_count_get(obj); |
94 | fail_if(fcount != 1); | 94 | fail_if(fcount != 1); |
95 | 95 | ||
96 | eo_do(obj, eo_event_thaw()); | 96 | eo_event_thaw(obj); |
97 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 97 | fcount = eo_event_freeze_count_get(obj); |
98 | fail_if(fcount != 0); | 98 | fail_if(fcount != 0); |
99 | 99 | ||
100 | eo_do(obj, simple_a_set(3)); | 100 | simple_a_set(obj, 3); |
101 | fail_if(cb_count != 2); | 101 | fail_if(cb_count != 2); |
102 | 102 | ||
103 | cb_count = 0; | 103 | cb_count = 0; |
104 | eo_do(obj, eo_event_thaw()); | 104 | eo_event_thaw(obj); |
105 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 105 | fcount = eo_event_freeze_count_get(obj); |
106 | fail_if(fcount != 0); | 106 | fail_if(fcount != 0); |
107 | 107 | ||
108 | eo_do(obj, eo_event_freeze()); | 108 | eo_event_freeze(obj); |
109 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 109 | fcount = eo_event_freeze_count_get(obj); |
110 | fail_if(fcount != 1); | 110 | fail_if(fcount != 1); |
111 | 111 | ||
112 | eo_do(obj, simple_a_set(2)); | 112 | simple_a_set(obj, 2); |
113 | fail_if(cb_count != 0); | 113 | fail_if(cb_count != 0); |
114 | eo_do(obj, eo_event_thaw()); | 114 | eo_event_thaw(obj); |
115 | eo_do(obj, fcount = eo_event_freeze_count_get()); | 115 | fcount = eo_event_freeze_count_get(obj); |
116 | fail_if(fcount != 0); | 116 | fail_if(fcount != 0); |
117 | 117 | ||
118 | eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 1)); | 118 | eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 1); |
119 | fail_if(pd->cb_count != 1); | 119 | fail_if(pd->cb_count != 1); |
120 | eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 2)); | 120 | eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 2); |
121 | fail_if(pd->cb_count != 0); | 121 | fail_if(pd->cb_count != 0); |
122 | 122 | ||
123 | /* Global Freeze/thaw. */ | 123 | /* Global Freeze/thaw. */ |
124 | fcount = 0; | 124 | fcount = 0; |
125 | cb_count = 0; | 125 | cb_count = 0; |
126 | pd->cb_count = 0; | 126 | pd->cb_count = 0; |
127 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1)); | 127 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1); |
128 | fail_if(pd->cb_count != 1); | 128 | fail_if(pd->cb_count != 1); |
129 | 129 | ||
130 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 130 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
131 | fail_if(fcount != 0); | 131 | fail_if(fcount != 0); |
132 | 132 | ||
133 | eo_do(EO_CLASS, eo_event_global_freeze()); | 133 | eo_event_global_freeze(EO_CLASS); |
134 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 134 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
135 | fail_if(fcount != 1); | 135 | fail_if(fcount != 1); |
136 | 136 | ||
137 | eo_do(EO_CLASS, eo_event_global_freeze()); | 137 | eo_event_global_freeze(EO_CLASS); |
138 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 138 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
139 | fail_if(fcount != 2); | 139 | fail_if(fcount != 2); |
140 | 140 | ||
141 | eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2)); | 141 | eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2); |
142 | fail_if(pd->cb_count != 2); | 142 | fail_if(pd->cb_count != 2); |
143 | 143 | ||
144 | eo_do(obj, simple_a_set(2)); | 144 | simple_a_set(obj, 2); |
145 | fail_if(cb_count != 0); | 145 | fail_if(cb_count != 0); |
146 | eo_do(EO_CLASS, eo_event_global_thaw()); | 146 | eo_event_global_thaw(EO_CLASS); |
147 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 147 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
148 | fail_if(fcount != 1); | 148 | fail_if(fcount != 1); |
149 | 149 | ||
150 | eo_do(EO_CLASS, eo_event_global_thaw()); | 150 | eo_event_global_thaw(EO_CLASS); |
151 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 151 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
152 | fail_if(fcount != 0); | 152 | fail_if(fcount != 0); |
153 | 153 | ||
154 | eo_do(obj, simple_a_set(3)); | 154 | simple_a_set(obj, 3); |
155 | fail_if(cb_count != 2); | 155 | fail_if(cb_count != 2); |
156 | 156 | ||
157 | cb_count = 0; | 157 | cb_count = 0; |
158 | eo_do(EO_CLASS, eo_event_global_thaw()); | 158 | eo_event_global_thaw(EO_CLASS); |
159 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 159 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
160 | fail_if(fcount != 0); | 160 | fail_if(fcount != 0); |
161 | 161 | ||
162 | eo_do(EO_CLASS, eo_event_global_freeze()); | 162 | eo_event_global_freeze(EO_CLASS); |
163 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 163 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
164 | fail_if(fcount != 1); | 164 | fail_if(fcount != 1); |
165 | 165 | ||
166 | eo_do(obj, simple_a_set(2)); | 166 | simple_a_set(obj, 2); |
167 | fail_if(cb_count != 0); | 167 | fail_if(cb_count != 0); |
168 | eo_do(EO_CLASS, eo_event_global_thaw()); | 168 | eo_event_global_thaw(EO_CLASS); |
169 | eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); | 169 | fcount = eo_event_global_freeze_count_get(EO_CLASS); |
170 | fail_if(fcount != 0); | 170 | fail_if(fcount != 0); |
171 | 171 | ||
172 | 172 | ||
diff --git a/src/tests/eo/signals/signals_simple.c b/src/tests/eo/signals/signals_simple.c index d3145e5..8a70f5f 100644 --- a/src/tests/eo/signals/signals_simple.c +++ b/src/tests/eo/signals/signals_simple.c | |||
@@ -23,7 +23,7 @@ _a_set(Eo *obj, void *class_data, int a) | |||
23 | pd->a = a; | 23 | pd->a = a; |
24 | printf("%s %d\n", __func__, pd->a); | 24 | printf("%s %d\n", __func__, pd->a); |
25 | 25 | ||
26 | eo_do(obj, eo_event_callback_call(EV_A_CHANGED, &pd->a)); | 26 | eo_event_callback_call(obj, EV_A_CHANGED, &pd->a); |
27 | } | 27 | } |
28 | 28 | ||
29 | Eina_Bool | 29 | Eina_Bool |
@@ -59,12 +59,12 @@ _cb_deled(void *data, const Eo_Event *event) | |||
59 | static Eo * | 59 | static Eo * |
60 | _constructor(Eo *obj, void *class_data EINA_UNUSED) | 60 | _constructor(Eo *obj, void *class_data EINA_UNUSED) |
61 | { | 61 | { |
62 | obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); | 62 | obj = eo_constructor(eo_super(obj, MY_CLASS)); |
63 | 63 | ||
64 | eo_do(obj, eo_event_callback_add(EO_BASE_EVENT_CALLBACK_ADD, _cb_added, NULL)); | 64 | eo_event_callback_add(obj, EO_BASE_EVENT_CALLBACK_ADD, _cb_added, NULL); |
65 | eo_do(obj, eo_event_callback_add(EO_BASE_EVENT_CALLBACK_DEL, _cb_deled, NULL)); | 65 | eo_event_callback_add(obj, EO_BASE_EVENT_CALLBACK_DEL, _cb_deled, NULL); |
66 | 66 | ||
67 | eo_do(obj, eo_key_data_set("cb_count", NULL)); |