2 * test.h - libvlc smoke test common definitions
7 /**********************************************************************
8 * Copyright (C) 2007 RĂ©mi Denis-Courmont. *
9 * Copyright (C) 2008 Pierre d'Herbemont. *
10 * This program is free software; you can redistribute and/or modify *
11 * it under the terms of the GNU General Public License as published *
12 * by the Free Software Foundation; version 2 of the license, or (at *
13 * your option) any later version. *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
18 * See the GNU General Public License for more details. *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, you can get it from: *
22 * http://www.gnu.org/copyleft/gpl.html *
23 **********************************************************************/
28 /*********************************************************************
29 * Some useful common headers
46 /*********************************************************************
47 * Some useful global var
49 static libvlc_exception_t ex;
51 static const char * test_defaults_args[] = {
57 "--plugin-path=../modules",
62 static const int test_defaults_nargs =
63 sizeof (test_defaults_args) / sizeof (test_defaults_args[0]);
65 /*static const char test_default_sample[] = "samples/test.sample";*/
66 static const char test_default_sample[] = SRCDIR"/samples/empty.voc";
69 /*********************************************************************
70 * Some useful common functions
73 #define log( ... ) printf( "testapi: " __VA_ARGS__ );
75 /* test if we have exception */
76 static inline bool have_exception (void)
78 if (libvlc_exception_raised (&ex))
80 libvlc_exception_clear (&ex);
87 static inline void catch (void)
89 if (libvlc_exception_raised (&ex))
91 fprintf (stderr, "Exception: %s\n",
92 libvlc_exception_get_message (&ex));
96 assert (libvlc_exception_get_message (&ex) == NULL);
97 libvlc_exception_clear (&ex);
100 static inline void test_init (void)
102 (void)test_default_sample; /* This one may not be used */
103 alarm (50); /* Make sure "make check" does not get stuck */