2 * testapi.c - libvlc-control smoke test
7 /**********************************************************************
8 * Copyright (C) 2007 RĂ©mi Denis-Courmont. *
9 * This program is free software; you can redistribute and/or modify *
10 * it under the terms of the GNU General Public License as published *
11 * by the Free Software Foundation; version 2 of the license, or (at *
12 * your option) any later version. *
14 * This program is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
17 * See the GNU General Public License for more details. *
19 * You should have received a copy of the GNU General Public License *
20 * along with this program; if not, you can get it from: *
21 * http://www.gnu.org/copyleft/gpl.html *
22 **********************************************************************/
24 #include <vlc/mediacontrol.h>
29 int main (int argc, char *argv[])
31 mediacontrol_Exception ex;
32 mediacontrol_Instance *mc, *mc2;
33 libvlc_instance_t *vlc;
35 mediacontrol_exception_init (&ex);
36 mc = mediacontrol_new (argc, argv, &ex);
39 mediacontrol_exception_cleanup (&ex);
41 /* Duplication test */
42 vlc = mediacontrol_get_libvlc_instance (mc);
46 mediacontrol_exception_init (&ex);
47 mc2 = mediacontrol_new_from_instance (vlc, &ex);
50 mediacontrol_exception_cleanup (&ex);
52 //mediacontrol_exit (mc2);
55 mediacontrol_exception_init (&ex);
56 mediacontrol_resume (mc, NULL, &ex);
57 assert (ex.code); /* should fail: we have no input */
58 mediacontrol_exception_cleanup (&ex);
60 mediacontrol_exception_init (&ex);
61 mediacontrol_pause (mc, NULL, &ex);
62 assert (ex.code); /* should fail: we have no input */
63 mediacontrol_exception_cleanup (&ex);
65 mediacontrol_exception_init (&ex);
66 mediacontrol_stop (mc, NULL, &ex);
67 mediacontrol_exception_cleanup (&ex);
70 mediacontrol_exception_init (&ex);
71 mediacontrol_playlist_clear (mc, &ex);
73 mediacontrol_exception_cleanup (&ex);
75 mediacontrol_exception_init (&ex);
76 mediacontrol_playlist_add_item (mc, "/dev/null", &ex);
77 mediacontrol_exception_cleanup (&ex);
79 mediacontrol_exception_init (&ex);
80 mediacontrol_playlist_clear (mc, &ex);
82 mediacontrol_exception_cleanup (&ex);
84 mediacontrol_exit (mc);