]> git.sesse.net Git - vlc/blob - test/libvlc/meta.c
Revert the DVD LPCM header description changes; will be added back later.
[vlc] / test / libvlc / meta.c
1 /*
2  * meta.c - libvlc smoke test
3  *
4  * $Id$
5  */
6
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.                                   *
14  *                                                                    *
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.              *
19  *                                                                    *
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  **********************************************************************/
24
25 #include <string.h>
26
27 #include "test.h"
28
29 static void test_meta (const char ** argv, int argc)
30 {
31     libvlc_instance_t *vlc;
32     libvlc_media_t *media;
33     char * artist;
34
35     log ("Testing meta\n");
36
37     vlc = libvlc_new (argc, argv);
38     assert (vlc != NULL);
39
40     media = libvlc_media_new_path (vlc, "samples/meta.sample");
41     assert( media );
42
43     libvlc_media_parse (media);
44
45     artist = libvlc_media_get_meta (media, libvlc_meta_Artist);
46
47     const char *expected_artist = "mike";
48
49     assert (artist);
50     log ("+ got '%s' as Artist, expecting %s\n", artist, expected_artist);
51
52     int string_compare = strcmp (artist, expected_artist);
53     assert (!string_compare);
54
55     free (artist);
56     libvlc_media_release (media);
57     libvlc_release (vlc);
58 }
59
60
61 int main (void)
62 {
63     test_init();
64
65     test_meta (test_defaults_args, test_defaults_nargs);
66
67     return 0;
68 }