[vlc-commits] test: add coverage for audio output and device functions

Rémi Denis-Courmont git at videolan.org
Sun Jul 14 14:07:54 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 14 15:07:39 2013 +0300| [490b5fd0106ed7ad21047a4d455c14aca3c6aa07] | committer: Rémi Denis-Courmont

test: add coverage for audio output and device functions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=490b5fd0106ed7ad21047a4d455c14aca3c6aa07
---

 test/libvlc/core.c |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/test/libvlc/core.c b/test/libvlc/core.c
index 8580631..b7fe646 100644
--- a/test/libvlc/core.c
+++ b/test/libvlc/core.c
@@ -68,12 +68,42 @@ static void test_audiovideofilterlists (const char ** argv, int argc)
     libvlc_release (vlc);
 }
 
+static void test_audio_output (void)
+{
+    libvlc_instance_t *vlc = libvlc_new (0, NULL);
+    assert (vlc != NULL);
+
+    libvlc_audio_output_t *mods = libvlc_audio_output_list_get (vlc);
+    assert (mods != NULL);
+
+    puts ("Audio outputs:");
+    for (const libvlc_audio_output_t *o = mods; o != NULL; o = o->p_next)
+    {
+        libvlc_audio_output_device_t *devs;
+
+        printf(" %s: %s\n", o->psz_name, o->psz_description);
+
+        devs = libvlc_audio_output_device_list_get (vlc, o->psz_name);
+        if (devs == NULL)
+            continue;
+        for (const libvlc_audio_output_device_t *d = devs;
+             d != NULL;
+             d = d->p_next)
+             printf("  %s: %s\n", d->psz_device, d->psz_description);
+
+        libvlc_audio_output_device_list_release (devs);
+    }
+    libvlc_audio_output_list_release (mods);
+    libvlc_release (vlc);
+}
+
 int main (void)
 {
     test_init();
 
     test_core (test_defaults_args, test_defaults_nargs);
     test_audiovideofilterlists (test_defaults_args, test_defaults_nargs);
+    test_audio_output ();
 
     return 0;
 }



More information about the vlc-commits mailing list