summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_audio.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-03-04 15:56:19 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-03-04 16:01:45 +0900
commit9750bd51f2688a2990c57f2e464010edb210415a (patch)
tree53a803a6c90eb73e187342bddacd9f8611d37ed0 /src/tests/ecore/ecore_test_ecore_audio.c
parent8ddfa35da67fe035805961f5c89312e61325586f (diff)
Ecore suite: Fix hangs when PulseAudio is not present
EFL can be built with PulseAudio support even if PA is not present on the system. In that case, ecore_suite will hang forever. Let's just catch the error instead. Note: make check will fail if PA is not available (but not hang) This is not related to Tom's recent mail (but yeah it reminded me of this bug^^) Fixes T732.
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore_audio.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index 0a55e3f..78e13e5 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -13,6 +13,16 @@
13#include <Ecore.h> 13#include <Ecore.h>
14#include <Ecore_Audio.h> 14#include <Ecore_Audio.h>
15 15
16static Eina_Bool _failed_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
17{
18 Eina_Bool *pulse_context_failed = data;
19
20 if (pulse_context_failed) *pulse_context_failed = EINA_TRUE;
21 ecore_main_loop_quit();
22
23 return EINA_TRUE;
24}
25
16static Eina_Bool _finished_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 26static Eina_Bool _finished_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
17{ 27{
18 ecore_main_loop_quit(); 28 ecore_main_loop_quit();
@@ -48,6 +58,7 @@ START_TEST(ecore_test_ecore_audio_obj_pulse)
48{ 58{
49 Eo *in, *out; 59 Eo *in, *out;
50 Eina_Bool ret; 60 Eina_Bool ret;
61 Eina_Bool pulse_context_failed = EINA_FALSE;
51 62
52 in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); 63 in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
53 fail_if(!in); 64 fail_if(!in);
@@ -62,11 +73,13 @@ START_TEST(ecore_test_ecore_audio_obj_pulse)
62 ecore_timer_add(0.3, _seek_vol, in); 73 ecore_timer_add(0.3, _seek_vol, in);
63 74
64 eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_STOPPED, _finished_cb, NULL)); 75 eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_STOPPED, _finished_cb, NULL));
76 eo_do(out, eo_event_callback_add(ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_FAIL, _failed_cb, &pulse_context_failed));
65 77
66 eo_do(out, ecore_audio_obj_out_input_attach(in, &ret)); 78 eo_do(out, ecore_audio_obj_out_input_attach(in, &ret));
67 fail_if(!ret); 79 fail_if(!ret);
68 80
69 ecore_main_loop_begin(); 81 ecore_main_loop_begin();
82 fail_if(pulse_context_failed);
70 83
71 eo_del(out); 84 eo_del(out);
72 eo_del(in); 85 eo_del(in);