[vlc-devel] commit: failing testapi test added (Filippo Carone )

git version control git at videolan.org
Thu Mar 27 00:05:06 CET 2008


vlc | branch: master | Filippo Carone <littlejohn at videolan.org> | Thu Mar 27 00:05:09 2008 +0100| [7179862ee5ec72a7d85a9ceb8ef818f609108704]

failing testapi test added

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

 src/control/testapi.c |   47 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/src/control/testapi.c b/src/control/testapi.c
index 449f7b5..e4388ec 100644
--- a/src/control/testapi.c
+++ b/src/control/testapi.c
@@ -259,16 +259,57 @@ static void test_events (const char ** argv, int argc)
     catch ();
 }
 
+static void test_media_player_play_stop(const char** argv, int argc)
+{
+    libvlc_instance_t *vlc;
+    libvlc_media_descriptor_t *md;
+    libvlc_media_instance_t *mi;
+    const char** file = "../bindings/java/core/src/test/resources/raffa_voice.ogg";
+
+    log ("Testing playback of %s\n", file);
+
+    libvlc_exception_init (&ex);
+    vlc = libvlc_new (argc, argv, &ex);
+    catch ();
+
+    md = libvlc_media_descriptor_new (vlc, file, &ex);
+    catch ();
+
+    mi = libvlc_media_instance_new_from_media_descriptor (md, &ex);
+    catch ();
+    
+    libvlc_media_descriptor_release (md);
+
+    libvlc_media_instance_play (mi, &ex);
+    catch ();
+
+    /* FIXME: Do something clever */
+    sleep(1);
+
+    assert( libvlc_media_instance_get_state (mi, &ex) != libvlc_Error );
+    catch ();
+
+    libvlc_media_instance_stop (mi, &ex);
+    catch ();
+
+    libvlc_media_instance_release (mi);
+    catch ();
+
+    libvlc_release (vlc);
+    catch ();
+    
+}
+
 int main (int argc, char *argv[])
 {
     const char *args[argc + 5];
     int nlibvlc_args = sizeof (args) / sizeof (args[0]);
 
-    alarm (30); /* Make sure "make check" does not get stuck */
+    alarm (50); /* Make sure "make check" does not get stuck */
 
     args[0] = "-vvv";
     args[1] = "-I";
-    args[2] = "-dummy";
+    args[2] = "dummy";
     args[3] = "--plugin-path=../modules";
     args[4] = "--vout=dummy";
     args[5] = "--aout=dummy";
@@ -277,6 +318,8 @@ int main (int argc, char *argv[])
 
     test_core (args, nlibvlc_args);
 
+    test_media_player_play_stop(args, nlibvlc_args);
+
     test_events (args, nlibvlc_args);
 
     test_media_list (args, nlibvlc_args);




More information about the vlc-devel mailing list