]> git.sesse.net Git - vlc/commitdiff
Add test cases for bug #3812
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 27 Jun 2010 14:10:07 +0000 (17:10 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 27 Jun 2010 14:10:07 +0000 (17:10 +0300)
test/libvlc/media_player.c

index 0b0be8d863677330df2329f2ce8856dbdc40019d..0e028582ea157f3b1a355d343718bb4fa7a4f5cd 100644 (file)
@@ -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;