2 * testapi.c - libvlc 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/libvlc.h>
33 static libvlc_exception_t ex;
35 static void catch (void)
37 if (libvlc_exception_raised (&ex))
39 fprintf (stderr, "Exception: %s\n",
40 libvlc_exception_get_message (&ex));
44 assert (libvlc_exception_get_message (&ex) == NULL);
45 libvlc_exception_clear (&ex);
48 int main (int argc, char *argv[])
50 libvlc_instance_t *vlc;
51 const char *args[argc + 3];
54 alarm (30); /* Make sure "make check" does not get stuck */
59 args[3] = "--plugin-path=../modules";
60 for (int i = 1; i < argc; i++)
61 args[i + 3] = argv[i];
63 libvlc_exception_init (&ex);
64 vlc = libvlc_new (sizeof (args) / sizeof (args[0]), args, &ex);
67 libvlc_playlist_clear (vlc, &ex);
70 id = libvlc_playlist_add_extended (vlc, "/dev/null", "Test", 0, NULL,
74 libvlc_playlist_clear (vlc, &ex);
78 libvlc_release (vlc, &ex);
80 libvlc_release (vlc, &ex);