]> git.sesse.net Git - vlc/blobdiff - test/libvlc/media_list_player.c
LibVLC core: remove exceptions
[vlc] / test / libvlc / media_list_player.c
index f63d960bbe46f11c756f261fbe18ba2a261740df..7e0717ac3577c534300ca81c055cb12dcebee00d 100644 (file)
@@ -101,14 +101,14 @@ static void test_media_list_player_items_queue(const char** argv, int argc)
     log ("Testing media player item queue-ing\n");
 
     libvlc_exception_init (&ex);
-    vlc = libvlc_new (argc, argv, &ex);
-    catch ();
+    vlc = libvlc_new (argc, argv);
+    assert (vlc != NULL);
 
     md = libvlc_media_new (vlc, file, &ex);
     catch ();
 
-    ml = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml = libvlc_media_list_new (vlc);
+    assert (ml != NULL);
 
     mlp = libvlc_media_list_player_new (vlc, &ex);
     catch ();
@@ -142,8 +142,9 @@ static void test_media_list_player_items_queue(const char** argv, int argc)
     libvlc_media_list_player_set_media_list (mlp, ml);
 
     libvlc_event_manager_t * em = libvlc_media_list_player_event_manager(mlp);
-    libvlc_event_attach(em, libvlc_MediaListPlayerNextItemSet, check_items_order_callback, &check, &ex);
-    catch ();
+    int val = libvlc_event_attach(em, libvlc_MediaListPlayerNextItemSet,
+                                  check_items_order_callback, &check);
+    assert(val == 0);
 
     libvlc_media_list_player_play(mlp, &ex);
     catch ();
@@ -171,14 +172,14 @@ static void test_media_list_player_previous(const char** argv, int argc)
     log ("Testing media player previous()\n");
 
     libvlc_exception_init (&ex);
-    vlc = libvlc_new (argc, argv, &ex);
-    catch ();
+    vlc = libvlc_new (argc, argv);
+    assert (vlc != NULL);
 
     md = libvlc_media_new (vlc, file, &ex);
     catch ();
 
-    ml = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml = libvlc_media_list_new (vlc);
+    assert (ml != NULL);
 
     mlp = libvlc_media_list_player_new (vlc, &ex);
     catch ();
@@ -248,14 +249,14 @@ static void test_media_list_player_next(const char** argv, int argc)
     log ("Testing media player next()\n");
 
     libvlc_exception_init (&ex);
-    vlc = libvlc_new (argc, argv, &ex);
-    catch ();
+    vlc = libvlc_new (argc, argv);
+    assert (vlc != NULL);
 
     md = libvlc_media_new (vlc, file, &ex);
     catch ();
 
-    ml = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml = libvlc_media_list_new (vlc);
+    assert (ml != NULL);
 
     mlp = libvlc_media_list_player_new (vlc, &ex);
     catch ();
@@ -324,14 +325,14 @@ static void test_media_list_player_pause_stop(const char** argv, int argc)
     log ("Testing play and pause of %s using the media list.\n", file);
 
     libvlc_exception_init (&ex);
-    vlc = libvlc_new (argc, argv, &ex);
-    catch ();
+    vlc = libvlc_new (argc, argv);
+    assert (vlc != NULL);
 
     md = libvlc_media_new (vlc, file, &ex);
     catch ();
 
-    ml = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml = libvlc_media_list_new (vlc);
+    assert (ml != NULL);
 
     mlp = libvlc_media_list_player_new (vlc, &ex);
 
@@ -372,13 +373,13 @@ static void test_media_list_player_play_item_at_index(const char** argv, int arg
 
     libvlc_exception_init (&ex);
     vlc = libvlc_new (argc, argv, &ex);
-    catch ();
+    assert (vlc != NULL);
 
     md = libvlc_media_new (vlc, file, &ex);
     catch ();
 
-    ml = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml = libvlc_media_list_new (vlc);
+    assert (ml != NULL);
 
     mlp = libvlc_media_list_player_new (vlc, &ex);
 
@@ -427,8 +428,8 @@ static void test_media_list_player_playback_options (const char** argv, int argc
     log ("Testing media player playback options()\n");
 
     libvlc_exception_init (&ex);
-    vlc = libvlc_new (argc, argv, &ex);
-    catch ();
+    vlc = libvlc_new (argc, argv);
+    assert (vlc != NULL);
 
     /*
      *   Create the following media tree:
@@ -457,23 +458,23 @@ static void test_media_list_player_playback_options (const char** argv, int argc
     md5 = libvlc_media_new (vlc, file, &ex);
     catch ();
 
-    ml = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml = libvlc_media_list_new (vlc);
+    assert (ml != NULL);
 
-    ml2 = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml2 = libvlc_media_list_new (vlc);
+    assert (ml2 != NULL);
 
-    ml3 = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml3 = libvlc_media_list_new (vlc);
+    assert (ml3 != NULL);
 
-    ml4 = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml4 = libvlc_media_list_new (vlc);
+    assert (ml4 != NULL);
 
-    ml5 = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml5 = libvlc_media_list_new (vlc);
+    assert (ml5 != NULL);
 
-    ml6 = libvlc_media_list_new (vlc, &ex);
-    catch ();
+    ml6 = libvlc_media_list_new (vlc);
+    assert (ml6 != NULL);
 
     media_list_add_file_path (vlc, ml2, file);
     media_list_add_file_path (vlc, ml2, file);