[vlc-devel] commit: new failing test for medialistplayer_next (Filippo Carone )

git version control git at videolan.org
Fri Mar 21 16:22:08 CET 2008


vlc | branch: master | Filippo Carone <littlejohn at videolan.org> | Fri Mar 21 16:22:25 2008 +0100| [38f79bff37d907dd2765f8e94f2162bcea2cf7e7]

new failing test for medialistplayer_next

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

 .../java/org/videolan/jvlc/MediaListPlayer.java    |   10 +++++++
 .../jvlc/internal/MediaListPlayerTest.java         |   29 ++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
index e9a720e..091e0f1 100644
--- a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
+++ b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
@@ -55,6 +55,10 @@ public class MediaListPlayer
         return jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 1;
     }
 
+    
+    /**
+     * 
+     */
     public void play()
     {
         libvlc_exception_t exception = new libvlc_exception_t();
@@ -83,6 +87,12 @@ public class MediaListPlayer
         libvlc_exception_t exception = new libvlc_exception_t();
         jvlc.getLibvlc().libvlc_media_list_player_pause(instance, exception);
     }
+    
+    public void next()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_next(instance, exception);
+    }
 
     /**
      * Plays the given descriptor and returns only when the player has started to play.
diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
index 79314d2..dde067d 100644
--- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
+++ b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
@@ -226,5 +226,34 @@ public class MediaListPlayerTest
         libvlc.libvlc_media_list_player_set_media_instance(mediaListPlayer, mi, exception);
         Assert.assertEquals(0, exception.raised);
     }
+    
+    @Test
+    public void mediaListPlayerNextNoItems()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
+        libvlc.libvlc_media_list_player_next(mediaListPlayer, exception);
+        Assert.assertEquals(1, exception.raised);
+    }
+    
+    /**
+     * fails, see https://trac.videolan.org/vlc/ticket/1535
+     */
+//    @Test
+    public void mediaListPlayerNext() throws Exception
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
+        LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
+        LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
+        libvlc.libvlc_media_list_add_media_descriptor(mediaList, mediaDescriptor, exception);
+        libvlc.libvlc_media_list_add_media_descriptor(mediaList, mediaDescriptor, exception);
+        libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception);
+        libvlc.libvlc_media_list_player_play_item_at_index(mediaListPlayer, 0, exception);
+        Thread.sleep(150);
+        libvlc.libvlc_media_list_player_next(mediaListPlayer, exception);
+        Assert.assertEquals(0, exception.raised);
+    }
+    
 
 }




More information about the vlc-devel mailing list