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];
53 alarm (30); /* Make sure "make check" does not get stuck */
58 args[3] = "--plugin-path=..";
59 for (int i = 1; i < argc; i++)
60 args[i + 3] = argv[i];
62 libvlc_exception_init (&ex);
63 vlc = libvlc_new (sizeof (args) / sizeof (args[0]), args, &ex);
66 libvlc_destroy (vlc, &ex);