2 * core.c - libvlc smoke test
6 /**********************************************************************
7 * Copyright (C) 2007 RĂ©mi Denis-Courmont. *
8 * This program is free software; you can redistribute and/or modify *
9 * it under the terms of the GNU General Public License as published *
10 * by the Free Software Foundation; version 2 of the license, or (at *
11 * your option) any later version. *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
16 * See the GNU General Public License for more details. *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, you can get it from: *
20 * http://www.gnu.org/copyleft/gpl.html *
21 **********************************************************************/
27 static void test_core (const char ** argv
, int argc
)
29 libvlc_instance_t
*vlc
;
31 test_log ("Testing core\n");
33 vlc
= libvlc_new (argc
, argv
);
41 static void test_moduledescriptionlist (libvlc_module_description_t
*list
)
43 libvlc_module_description_t
*module
= list
;
45 assert (strlen (module
->psz_name
) );
46 assert (strlen (module
->psz_shortname
) );
47 assert (module
->psz_longname
== NULL
|| strlen (module
->psz_longname
));
48 assert (module
->psz_help
== NULL
|| strlen (module
->psz_help
));
49 module
= module
->p_next
;
52 libvlc_module_description_list_release (list
);
55 static void test_audiovideofilterlists (const char ** argv
, int argc
)
57 libvlc_instance_t
*vlc
;
59 test_log ("Testing libvlc_(audio|video)_filter_list_get()\n");
61 vlc
= libvlc_new (argc
, argv
);
64 test_moduledescriptionlist (libvlc_audio_filter_list_get (vlc
));
65 test_moduledescriptionlist (libvlc_video_filter_list_get (vlc
));
70 static void test_audio_output (void)
72 libvlc_instance_t
*vlc
= libvlc_new (0, NULL
);
75 libvlc_audio_output_t
*mods
= libvlc_audio_output_list_get (vlc
);
76 assert (mods
!= NULL
);
78 puts ("Audio outputs:");
79 for (const libvlc_audio_output_t
*o
= mods
; o
!= NULL
; o
= o
->p_next
)
81 libvlc_audio_output_device_t
*devs
;
83 printf(" %s: %s\n", o
->psz_name
, o
->psz_description
);
85 devs
= libvlc_audio_output_device_list_get (vlc
, o
->psz_name
);
88 for (const libvlc_audio_output_device_t
*d
= devs
;
91 printf(" %s: %s\n", d
->psz_device
, d
->psz_description
);
93 libvlc_audio_output_device_list_release (devs
);
95 libvlc_audio_output_list_release (mods
);
103 test_core (test_defaults_args
, test_defaults_nargs
);
104 test_audiovideofilterlists (test_defaults_args
, test_defaults_nargs
);
105 test_audio_output ();