summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_audio.c
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-04-12 18:43:40 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:14:32 +0100
commit542b8743bbae5bba73a7431df570dd034016956f (patch)
tree2b0728c2d3ee10ef5077950c6edaffeebe173f7d /src/tests/ecore/ecore_test_ecore_audio.c
parent9da64ff201ca97ee7a22b019ccaf82f8306600a3 (diff)
ecore_audio: Enable soundfile test for eo
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index 0ed3b66..2baed96 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -11,9 +11,6 @@
11#include <Ecore.h> 11#include <Ecore.h>
12#include <Ecore_Audio.h> 12#include <Ecore_Audio.h>
13 13
14#define SF_FORMAT_RAW 0x040000
15#define SF_FORMAT_PCM_U8 0x0005
16
17#define SOUNDS_DIR TESTS_SRC_DIR 14#define SOUNDS_DIR TESTS_SRC_DIR
18 15
19#if 0 16#if 0
@@ -169,28 +166,6 @@ START_TEST(ecore_test_ecore_audio_default)
169} 166}
170END_TEST 167END_TEST
171 168
172START_TEST(ecore_test_ecore_audio_sndfile)
173{
174 double len;
175
176 in = ecore_audio_input_add(ECORE_AUDIO_TYPE_SNDFILE);
177 fail_if(!in);
178
179 ecore_audio_input_data_set(in, &len);
180 ecore_audio_input_name_set(in, "sms.ogg");
181 ecore_audio_input_sndfile_filename_set(in, SOUNDS_DIR"sms.ogg");
182 fail_if(ecore_audio_input_channels_get(in) != 2);
183 fail_if(ecore_audio_input_samplerate_get(in) != 44100);
184 len = ecore_audio_input_length_get(in);
185// fail_if(len == 0);
186// fail_if(len != ecore_audio_input_remaining_get(in));
187 fail_if(strcmp("sms.ogg", ecore_audio_input_name_get(in)));
188
189 fail_if(ecore_audio_input_data_get(in) != &len);
190 ecore_audio_input_del(in);
191}
192END_TEST
193
194struct buffer { 169struct buffer {
195 int offset; 170 int offset;
196 int length; 171 int length;
@@ -330,6 +305,31 @@ START_TEST(ecore_test_ecore_audio_custom)
330END_TEST 305END_TEST
331#endif 306#endif
332 307
308START_TEST(ecore_test_ecore_audio_obj_sndfile)
309{
310 Eo *in;
311 double len, rem;
312 int channel, rate;
313
314 in = eo_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
315 fail_if(!in);
316
317 eo_do(in, ecore_audio_obj_name_set("sms.ogg"));
318 eo_do(in, ecore_audio_obj_source_set(SOUNDS_DIR"/sms.ogg"));
319
320 eo_do(in, ecore_audio_obj_in_channels_get(&channel));
321 fail_if(channel != 2);
322 eo_do(in, ecore_audio_obj_in_samplerate_get(&rate));
323 fail_if(rate != 44100);
324 eo_do(in, ecore_audio_obj_in_length_get(&len));
325 fail_if(len == 0);
326 eo_do(in, ecore_audio_obj_in_remaining_get(&rem));
327 fail_if(len != rem);
328
329 eo_del(in);
330}
331END_TEST
332
333START_TEST(ecore_test_ecore_audio_obj_in_out) 333START_TEST(ecore_test_ecore_audio_obj_in_out)
334{ 334{
335 Eo *out2; 335 Eo *out2;
@@ -468,10 +468,10 @@ ecore_test_ecore_audio(TCase *tc)
468 468
469 tcase_add_test(tc, ecore_test_ecore_audio_obj); 469 tcase_add_test(tc, ecore_test_ecore_audio_obj);
470 tcase_add_test(tc, ecore_test_ecore_audio_obj_in_out); 470 tcase_add_test(tc, ecore_test_ecore_audio_obj_in_out);
471 tcase_add_test(tc, ecore_test_ecore_audio_obj_sndfile);
471 472
472/* 473/*
473 tcase_add_test(tc, ecore_test_ecore_audio_default); 474 tcase_add_test(tc, ecore_test_ecore_audio_default);
474 tcase_add_test(tc, ecore_test_ecore_audio_sndfile);
475 tcase_add_test(tc, ecore_test_ecore_audio_sndfile_vio); 475 tcase_add_test(tc, ecore_test_ecore_audio_sndfile_vio);
476 tcase_add_test(tc, ecore_test_ecore_audio_custom); 476 tcase_add_test(tc, ecore_test_ecore_audio_custom);
477 tcase_add_test(tc, ecore_test_ecore_audio_cleanup); 477 tcase_add_test(tc, ecore_test_ecore_audio_cleanup);