diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2018-03-29 00:42:10 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2018-03-29 13:30:55 +0900 |
commit | 2fb5cc3ad09f6aaf82b5d1131ac5ed22ed848bd4 (patch) | |
tree | 7a2c2c0371789ae4b139ebdf4a9ef60f82d324aa /src/tests/ecore | |
parent | cc2b7a10a8236e2b3cc4a25b4b4fda95e00884fc (diff) | |
download | efl-2fb5cc3ad09f6aaf82b5d1131ac5ed22ed848bd4.tar.gz |
efl_add_ref - fis to use efl_add properly with a parent.
fixes bc18b7e7ad1f8c5d587400b27fabab0865017011 and
168849e8a08966ecc284e28f64126a3a85965965
Diffstat (limited to 'src/tests/ecore')
-rw-r--r-- | src/tests/ecore/ecore_test_ecore_audio.c | 61 | ||||
-rw-r--r-- | src/tests/ecore/ecore_test_promise2.c | 4 |
2 files changed, 33 insertions, 32 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c index c7e40062ed..7969be0e0a 100644 --- a/src/tests/ecore/ecore_test_ecore_audio.c +++ b/src/tests/ecore/ecore_test_ecore_audio.c @@ -57,14 +57,14 @@ START_TEST(ecore_test_ecore_audio_obj_pulse) Eina_Bool ret = EINA_FALSE; Eina_Bool pulse_context_failed = EINA_FALSE; - in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); + in = efl_add(ECORE_AUDIO_IN_SNDFILE_CLASS, efl_main_loop_get()); fail_if(!in); efl_name_set(in, "sample.wav"); ret = ecore_audio_obj_source_set(in, TESTS_SRC_DIR"/sample.wav"); fail_if(!ret); - out = efl_add_ref(ECORE_AUDIO_OUT_PULSE_CLASS, NULL); + out = efl_add(ECORE_AUDIO_OUT_PULSE_CLASS, efl_main_loop_get()); fail_if(!out); ecore_timer_add(1.8, _seek_vol, in); @@ -78,8 +78,8 @@ START_TEST(ecore_test_ecore_audio_obj_pulse) ecore_main_loop_begin(); fail_if(pulse_context_failed); - efl_unref(out); - efl_unref(in); + efl_del(out); + efl_del(in); } END_TEST #endif @@ -96,7 +96,7 @@ static Eina_Bool _idle_del(void *data) { Eo *in = data; - efl_unref(in); + efl_del(in); ecore_idler_add(_quit, NULL); return EINA_FALSE; @@ -108,12 +108,12 @@ START_TEST(ecore_test_ecore_audio_cleanup) int freq = 1000; Eina_Bool ret = EINA_FALSE; - in = efl_add_ref(ECORE_AUDIO_IN_TONE_CLASS, NULL); + in = efl_add(ECORE_AUDIO_IN_TONE_CLASS, efl_main_loop_get()); fail_if(!in); efl_key_data_set(in, ECORE_AUDIO_ATTR_TONE_FREQ, &freq); ecore_audio_obj_in_length_set(in, 2); - out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); + out = efl_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, efl_main_loop_get()); fail_if(!out); ret = ecore_audio_obj_format_set(out, ECORE_AUDIO_FORMAT_OGG); fail_if(!ret); @@ -124,6 +124,7 @@ START_TEST(ecore_test_ecore_audio_cleanup) fail_if(!ret); ecore_idler_add(_idle_del, in); + ecore_idler_add(_idle_del, out); ecore_main_loop_begin(); @@ -139,7 +140,7 @@ START_TEST(ecore_test_ecore_audio_obj_tone) Eina_Bool ret; char *tmp; - in = efl_add_ref(ECORE_AUDIO_IN_TONE_CLASS, NULL); + in = efl_add(ECORE_AUDIO_IN_TONE_CLASS, efl_main_loop_get()); fail_if(!in); efl_name_set(in, "tone"); @@ -197,7 +198,7 @@ START_TEST(ecore_test_ecore_audio_obj_tone) len = ecore_audio_obj_in_remaining_get(in); fail_if(len != 1.0); - out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); + out = efl_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, efl_main_loop_get()); fail_if(!out); efl_name_set(out, "tmp.wav"); @@ -214,8 +215,8 @@ START_TEST(ecore_test_ecore_audio_obj_tone) ecore_main_loop_begin(); - efl_unref(in); - efl_unref(out); + efl_del(in); + efl_del(out); //TODO: Compare and fail ecore_file_remove(TESTS_BUILD_DIR"/tmp.wav"); @@ -231,7 +232,7 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile) Ecore_Audio_Format fmt; const char *src; - in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL); + in = efl_add(ECORE_AUDIO_IN_SNDFILE_CLASS, efl_main_loop_get()); fail_if(!in); fmt = ecore_audio_obj_format_get(in); @@ -277,7 +278,7 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile) len = ecore_audio_obj_in_seek(in, -1.5, SEEK_END); fail_if(fabs(rem - 1 - len) > 0.6); - out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); + out = efl_add(ECORE_AUDIO_OUT_SNDFILE_CLASS, efl_main_loop_get()); fail_if(!out); efl_name_set(out, "tmp.wav"); @@ -304,8 +305,8 @@ START_TEST(ecore_test_ecore_audio_obj_sndfile) ecore_main_loop_begin(); - efl_unref(in); - efl_unref(out); + efl_del(in); + efl_del(out); //TODO: Compare and fail ecore_file_remove(TESTS_BUILD_DIR"/tmp.wav"); @@ -318,9 +319,9 @@ START_TEST(ecore_test_ecore_audio_obj_in_out) Eina_List *in3; Eina_Bool attached; - Eo *in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL); - Eo *in2 = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL); - Eo *out = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL); + Eo *in = efl_add(ECORE_AUDIO_IN_CLASS, efl_main_loop_get()); + Eo *in2 = efl_add(ECORE_AUDIO_IN_CLASS, efl_main_loop_get()); + Eo *out = efl_add(ECORE_AUDIO_OUT_CLASS, efl_main_loop_get()); fail_if(!in); fail_if(!in2); @@ -357,20 +358,20 @@ START_TEST(ecore_test_ecore_audio_obj_in_out) fail_if(eina_list_count(in3) != 2); fail_if(eina_list_data_get(in3) != in); - efl_unref(in2); + efl_del(in2); in3 = ecore_audio_obj_out_inputs_get(out); fail_if(eina_list_count(in3) != 1); fail_if(eina_list_data_get(in3) != in); - efl_unref(out); + efl_del(out); out2 = ecore_audio_obj_in_output_get(in); fail_if(out2); - efl_unref(in); + efl_del(in); } END_TEST @@ -416,10 +417,10 @@ START_TEST(ecore_test_ecore_audio_obj_vio) { Eo *in, *out; - in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL); + in = efl_add(ECORE_AUDIO_IN_CLASS, efl_main_loop_get()); fail_if(!in); - out = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL); + out = efl_add(ECORE_AUDIO_OUT_CLASS, efl_main_loop_get()); fail_if(!out); ecore_audio_obj_vio_set(in, &in_vio, NULL, NULL); @@ -429,8 +430,8 @@ START_TEST(ecore_test_ecore_audio_obj_vio) ecore_main_loop_begin(); - efl_unref(out); - efl_unref(in); + efl_del(out); + efl_del(in); } END_TEST @@ -454,7 +455,7 @@ START_TEST(ecore_test_ecore_audio_obj_in) Ecore_Audio_Vio vio; Eina_Bool freed = EINA_FALSE; - Eo *in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL); + Eo *in = efl_add(ECORE_AUDIO_IN_CLASS, efl_main_loop_get()); fail_if(!in); @@ -529,7 +530,7 @@ START_TEST(ecore_test_ecore_audio_obj_in) fail_if(buf[i] != 0x00); } - efl_unref(in); + efl_del(in); } END_TEST @@ -541,10 +542,10 @@ START_TEST(ecore_test_ecore_audio_obj) double volume; Eo *objs[2], *obj; - objs[0] = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL); + objs[0] = efl_add(ECORE_AUDIO_IN_CLASS, efl_main_loop_get()); fail_if(!objs[0]); - objs[1] = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL); + objs[1] = efl_add(ECORE_AUDIO_OUT_CLASS, efl_main_loop_get()); fail_if(!objs[1]); for (i=0; i<2; i++) { @@ -577,7 +578,7 @@ START_TEST(ecore_test_ecore_audio_obj) volume = ecore_audio_obj_volume_get(obj); fail_if(volume != 0.5); - efl_unref(obj); + efl_del(obj); } } diff --git a/src/tests/ecore/ecore_test_promise2.c b/src/tests/ecore/ecore_test_promise2.c index bd9eec8158..52ae594193 100644 --- a/src/tests/ecore/ecore_test_promise2.c +++ b/src/tests/ecore/ecore_test_promise2.c @@ -871,7 +871,7 @@ START_TEST(efl_test_promise_eo) fail_if(!ecore_init()); //Use a random object.. - obj = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL); + obj = efl_add(EFL_IO_BUFFER_CLASS, efl_main_loop_get()); fail_if(!obj); efl_key_data_set(obj, "free_called", &free_called); f = eina_future_chain(_int_future_get(), @@ -930,7 +930,7 @@ START_TEST(efl_test_promise_eo_link) fail_if(!ecore_init()); //Use a random object.. - obj = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL); + obj = efl_add(EFL_IO_BUFFER_CLASS, efl_main_loop_get()); fail_if(!obj); efl_key_data_set(obj, "err_called", &err_called); |