asdfuser pushed a commit to branch master.
commit ed011b10cc9ff87b19a7c17c43f4ce22c57c135a
Author: Daniel Willmann <[email protected]>
Date: Mon Apr 29 19:38:40 2013 +0100
ecore_audio: Test pulseaudio output if it is enabled
Signed-off-by: Daniel Willmann <[email protected]>
---
src/tests/ecore/ecore_test_ecore_audio.c | 48 +++++++++++++++++++++++++++++++-
1 file changed, 47 insertions(+), 1 deletion(-)
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c
b/src/tests/ecore/ecore_test_ecore_audio.c
index ec52973..75c5bb0 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -2,6 +2,8 @@
#include <config.h>
#endif
+#include <math.h>
+
#include <Ecore_Audio.h>
#include <Ecore_File.h>
@@ -317,6 +319,50 @@ static Eina_Bool _looped_cb(void *data EINA_UNUSED, Eo
*obj, const Eo_Event_Desc
return EINA_TRUE;
}
+#ifdef HAVE_PULSE
+static Eina_Bool
+_seek_vol(void *data)
+{
+ double len;
+ Eo *in = data;
+
+ eo_do(in, ecore_audio_obj_volume_set(0.4));
+ eo_do(in, ecore_audio_obj_in_seek(-0.3, SEEK_END, &len));
+ fail_if(len < 0);
+
+ return EINA_FALSE;
+}
+
+START_TEST(ecore_test_ecore_audio_obj_pulse)
+{
+ Eo *in, *out;
+ Eina_Bool ret;
+
+ in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
+ fail_if(!in);
+
+ eo_do(in, ecore_audio_obj_name_set("modem.wav"));
+ eo_do(in, ecore_audio_obj_source_set(TESTS_SRC_DIR"/modem.wav", &ret));
+ fail_if(!ret);
+
+ out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
+ fail_if(!out);
+
+ 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, ecore_audio_obj_out_input_attach(in, &ret));
+ fail_if(!ret);
+
+ ecore_main_loop_begin();
+
+ eo_del(out);
+ eo_del(in);
+}
+END_TEST
+#endif
+
START_TEST(ecore_test_ecore_audio_obj_tone)
{
Eo *in, *out;
@@ -747,7 +793,7 @@ ecore_test_ecore_audio(TCase *tc)
#ifdef HAVE_SNDFILE
tcase_add_test(tc, ecore_test_ecore_audio_obj_sndfile);
#endif
-#ifdef HAVE_PUSE
+#ifdef HAVE_PULSE
tcase_add_test(tc, ecore_test_ecore_audio_obj_pulse);
#endif
--
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr