jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9750bd51f2688a2990c57f2e464010edb210415a

commit 9750bd51f2688a2990c57f2e464010edb210415a
Author: Jean-Philippe Andre <[email protected]>
Date:   Tue Mar 4 15:56:19 2014 +0900

    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.
---
 src/tests/ecore/ecore_test_ecore_audio.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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 @@
 #include <Ecore.h>
 #include <Ecore_Audio.h>
 
+static Eina_Bool _failed_cb(void *data, Eo *obj EINA_UNUSED, const 
Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+  Eina_Bool *pulse_context_failed = data;
+
+  if (pulse_context_failed) *pulse_context_failed = EINA_TRUE;
+  ecore_main_loop_quit();
+
+  return EINA_TRUE;
+}
+
 static Eina_Bool _finished_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, 
const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
 {
   ecore_main_loop_quit();
@@ -48,6 +58,7 @@ START_TEST(ecore_test_ecore_audio_obj_pulse)
 {
    Eo *in, *out;
    Eina_Bool ret;
+   Eina_Bool pulse_context_failed = EINA_FALSE;
 
    in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
    fail_if(!in);
@@ -62,11 +73,13 @@ START_TEST(ecore_test_ecore_audio_obj_pulse)
    ecore_timer_add(0.3, _seek_vol, in);
 
    eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_STOPPED, _finished_cb, 
NULL));
+   eo_do(out, eo_event_callback_add(ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_FAIL, 
_failed_cb, &pulse_context_failed));
 
    eo_do(out, ecore_audio_obj_out_input_attach(in, &ret));
    fail_if(!ret);
 
    ecore_main_loop_begin();
+   fail_if(pulse_context_failed);
 
    eo_del(out);
    eo_del(in);

-- 


Reply via email to