Fix compilation.
[vlc/asuraparaju-public.git] / test / libvlc / meta.c
blobaa29c98406f8444de7a3c6d3a59b621fd9e4ed1a
1 /*
2 * meta.c - libvlc smoke test
4 * $Id$
5 */
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 **********************************************************************/
25 #include <string.h>
27 #include "test.h"
29 static void test_meta (const char ** argv, int argc)
31 libvlc_instance_t *vlc;
32 libvlc_media_t *media;
33 char * artist;
35 log ("Testing meta\n");
37 vlc = libvlc_new (argc, argv);
38 assert (vlc != NULL);
40 media = libvlc_media_new_path (vlc, "samples/meta.sample");
41 assert( media );
43 libvlc_media_parse (media);
45 artist = libvlc_media_get_meta (media, libvlc_meta_Artist);
47 const char *expected_artist = "mike";
49 assert (artist);
50 log ("+ got '%s' as Artist, expecting %s\n", artist, expected_artist);
52 int string_compare = strcmp (artist, expected_artist);
53 assert (!string_compare);
55 free (artist);
56 libvlc_media_release (media);
57 libvlc_release (vlc);
61 int main (void)
63 test_init();
65 test_meta (test_defaults_args, test_defaults_nargs);
67 return 0;