[vlc-commits] test: test libvlc_media_player_(set|get)_role

Rémi Denis-Courmont git at videolan.org
Sun Jun 5 11:27:37 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun  5 12:26:06 2016 +0300| [2ce8926498c26f0ceb7ba271c0d44f8f62e1d401] | committer: Rémi Denis-Courmont

test: test libvlc_media_player_(set|get)_role

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

 include/vlc/libvlc_media_player.h |    1 +
 test/libvlc/media_player.c        |   14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 85b0155..a1df7a5 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1982,6 +1982,7 @@ typedef enum libvlc_media_player_role {
     libvlc_role_Production /**< Audio editting/production */,
     libvlc_role_Accessibility /**< Accessibility */,
     libvlc_role_Test /** Testing */,
+#define libvlc_role_Last libvlc_role_Test
 } libvlc_media_player_role_t;
 
 /**
diff --git a/test/libvlc/media_player.c b/test/libvlc/media_player.c
index 43dd44c..f3198b5 100644
--- a/test/libvlc/media_player.c
+++ b/test/libvlc/media_player.c
@@ -80,6 +80,19 @@ static void test_audio_video(libvlc_media_player_t *mp)
     libvlc_audio_output_device_list_release( aouts );
 }
 
+static void test_role(libvlc_media_player_t *mp)
+{
+    int role;
+
+    /* Test default value */
+    assert(libvlc_media_player_get_role(mp) == libvlc_role_Video);
+
+    for (role = 0; libvlc_media_player_set_role(mp, role) == 0; role++)
+        assert(libvlc_media_player_get_role(mp) == role);
+
+    assert(role > libvlc_role_Last);
+}
+
 static void test_media_player_set_media(const char** argv, int argc)
 {
     const char * file = test_default_sample;
@@ -158,6 +171,7 @@ static void test_media_player_pause_stop(const char** argv, int argc)
     libvlc_media_release (md);
 
     test_audio_video(mi);
+    test_role(mi);
 
     libvlc_media_player_play (mi);
     log ("Waiting for playing\n");



More information about the vlc-commits mailing list