summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_audio.c
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-04-11 18:21:37 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:12:17 +0100
commit48b78234a8f540b2fc1c78bb344b9ac519b2621b (patch)
tree44c5f410bed9fbf232015d6ebb48660ad118a17f /src/tests/ecore/ecore_test_ecore_audio.c
parentbfc46016733657202bb94ee4a5d95a1cb12d9213 (diff)
ecore_audio: Build Eo-based Ecore_Audio and tests now
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore_audio.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c112
1 files changed, 100 insertions, 12 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index bcf4b22..0ed3b66 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -17,15 +17,6 @@
17#define SOUNDS_DIR TESTS_SRC_DIR 17#define SOUNDS_DIR TESTS_SRC_DIR
18 18
19#if 0 19#if 0
20/* TODO: must fix these tests to produce no warnings and to be
21 * passing on all platforms that support them.
22 *
23 * It would be nice if timers are not used so it doesn't take an
24 * eternity to run ecore_suite. :-)
25 */
26static Ecore_Audio_Object *out;
27static Ecore_Audio_Object *in;
28
29Eina_Bool 20Eina_Bool
30seek(void *data) 21seek(void *data)
31{ 22{
@@ -339,6 +330,101 @@ START_TEST(ecore_test_ecore_audio_custom)
339END_TEST 330END_TEST
340#endif 331#endif
341 332
333START_TEST(ecore_test_ecore_audio_obj_in_out)
334{
335 Eo *out2;
336 Eina_List *in3;
337
338 Eo *in = eo_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
339 Eo *in2 = eo_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
340 Eo *out = eo_add(ECORE_AUDIO_OBJ_OUT_CLASS, NULL);
341
342 fail_if(!in);
343 fail_if(!in2);
344 fail_if(!out);
345
346 fail_if(!eo_do(in, ecore_audio_obj_in_output_get(&out2)));
347
348 fail_if(out2);
349
350 fail_if(!eo_do(out, ecore_audio_obj_out_inputs_get(&in3)));
351
352 fail_if(eina_list_count(in3) != 0);
353
354 fail_if(!eo_do(out, ecore_audio_obj_out_input_attach(in)));
355
356 fail_if(!eo_do(in, ecore_audio_obj_in_output_get(&out2)));
357
358 fail_if(out2 != out);
359
360 fail_if(!eo_do(out, ecore_audio_obj_out_inputs_get(&in3)));
361
362 fail_if(eina_list_count(in3) != 1);
363 fail_if(eina_list_data_get(in3) != in);
364
365 fail_if(!eo_do(out, ecore_audio_obj_out_input_attach(in2)));
366
367 fail_if(!eo_do(out, ecore_audio_obj_out_inputs_get(&in3)));
368
369 fail_if(eina_list_count(in3) != 2);
370 fail_if(eina_list_data_get(in3) != in);
371
372 eo_del(in2);
373
374 fail_if(!eo_do(out, ecore_audio_obj_out_inputs_get(&in3)));
375
376 fail_if(eina_list_count(in3) != 1);
377 fail_if(eina_list_data_get(in3) != in);
378
379 eo_del(out);
380
381 fail_if(!eo_do(in, ecore_audio_obj_in_output_get(&out2)));
382
383 fail_if(out2);
384
385 eo_del(in);
386}
387END_TEST
388
389START_TEST(ecore_test_ecore_audio_obj)
390{
391 const char *name;
392 Eina_Bool paused;
393 double volume;
394
395 Eo *in = eo_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
396
397 fail_if(!in);
398
399 fail_if(!eo_do(in, ecore_audio_obj_name_get(&name)));
400
401 fail_if(name);
402
403 fail_if(!eo_do(in, ecore_audio_obj_name_set("In1")));
404 fail_if(!eo_do(in, ecore_audio_obj_name_get(&name)));
405
406 ck_assert_str_eq(name, "In1");
407
408 fail_if(!eo_do(in, ecore_audio_obj_name_get(NULL)));
409
410 fail_if(!eo_do(in, ecore_audio_obj_paused_get(&paused)));
411 fail_if(paused);
412
413 fail_if(!eo_do(in, ecore_audio_obj_paused_set(EINA_TRUE)));
414 fail_if(!eo_do(in, ecore_audio_obj_paused_get(&paused)));
415 fail_if(!paused);
416
417 fail_if(!eo_do(in, ecore_audio_obj_volume_get(&volume)));
418 fail_if(volume != 1.0);
419
420 fail_if(!eo_do(in, ecore_audio_obj_volume_set(0.5)));
421 fail_if(!eo_do(in, ecore_audio_obj_volume_get(&volume)));
422 fail_if(volume != 0.5);
423
424 eo_del(in);
425}
426END_TEST
427
342START_TEST(ecore_test_ecore_audio_init) 428START_TEST(ecore_test_ecore_audio_init)
343{ 429{
344 int ret; 430 int ret;
@@ -380,13 +466,15 @@ ecore_test_ecore_audio(TCase *tc)
380 466
381 tcase_add_test(tc, ecore_test_ecore_audio_init); 467 tcase_add_test(tc, ecore_test_ecore_audio_init);
382 468
383#if 0 469 tcase_add_test(tc, ecore_test_ecore_audio_obj);
470 tcase_add_test(tc, ecore_test_ecore_audio_obj_in_out);
471
472/*
384 tcase_add_test(tc, ecore_test_ecore_audio_default); 473 tcase_add_test(tc, ecore_test_ecore_audio_default);
385 tcase_add_test(tc, ecore_test_ecore_audio_sndfile); 474 tcase_add_test(tc, ecore_test_ecore_audio_sndfile);
386 tcase_add_test(tc, ecore_test_ecore_audio_sndfile_vio); 475 tcase_add_test(tc, ecore_test_ecore_audio_sndfile_vio);
387 tcase_add_test(tc, ecore_test_ecore_audio_custom); 476 tcase_add_test(tc, ecore_test_ecore_audio_custom);
388
389 tcase_add_test(tc, ecore_test_ecore_audio_cleanup); 477 tcase_add_test(tc, ecore_test_ecore_audio_cleanup);
390#endif 478*/
391} 479}
392 480