[vlc-commits] commit: Add test cases for bug #3812 ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Jun 27 16:12:41 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 27 17:10:07 2010 +0300| [98b31e7c13df3ec76b848003ed829afc4b1fad52] | committer: Rémi Denis-Courmont 

Add test cases for bug #3812
(cherry picked from commit 9529ae4e8cd615f311bbfba8cab466dc427fdfb9)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=98b31e7c13df3ec76b848003ed829afc4b1fad52
---

 test/libvlc/media_player.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/test/libvlc/media_player.c b/test/libvlc/media_player.c
index 0b0be8d..0e02858 100644
--- a/test/libvlc/media_player.c
+++ b/test/libvlc/media_player.c
@@ -48,6 +48,31 @@ static void wait_paused(libvlc_media_player_t *mp)
     assert(state == libvlc_Paused || state == libvlc_Ended);
 }
 
+/* Test a bunch of A/V properties. This most does nothing since the current
+ * test file contains a dummy audio track. This is a smoke test. */
+static void test_audio_video(libvlc_media_player_t *mp)
+{
+    bool fs = libvlc_get_fullscreen(mp);
+    libvlc_set_fullscreen(mp, true);
+    assert(libvlc_get_fullscreen(mp));
+    libvlc_set_fullscreen(mp, false);
+    assert(!libvlc_get_fullscreen(mp));
+    libvlc_toggle_fullscreen(mp);
+    assert(libvlc_get_fullscreen(mp));
+    libvlc_toggle_fullscreen(mp);
+    assert(!libvlc_get_fullscreen(mp));
+    libvlc_set_fullscreen(mp, fs);
+    assert(libvlc_get_fullscreen(mp) == fs);
+
+    assert(libvlc_video_get_scale(mp) == 0.); /* default */
+    libvlc_video_set_scale(mp, 0.); /* no-op */
+    libvlc_video_set_scale(mp, 2.5);
+    assert(libvlc_video_get_scale(mp) == 2.5);
+    libvlc_video_set_scale(mp, 0.);
+    libvlc_video_set_scale(mp, 0.); /* no-op */
+    assert(libvlc_video_get_scale(mp) == 0.);
+}
+
 static void test_media_player_set_media(const char** argv, int argc)
 {
     const char * file = test_default_sample;



More information about the vlc-commits mailing list