2 * meta.c - libvlc smoke test
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 **********************************************************************/
27 static void test_meta (const char ** argv, int argc)
29 libvlc_instance_t *vlc;
30 libvlc_media_t *media;
33 log ("Testing meta\n");
35 libvlc_exception_init (&ex);
36 vlc = libvlc_new (argc, argv, &ex);
39 media = libvlc_media_new (vlc, "samples/meta.sample", &ex);
42 /* Tell that we are interested in this precise meta data
43 * This is needed to trigger meta data reading
44 * (the first calls return NULL) */
45 artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex);
50 /* Wait for the meta */
51 while (!libvlc_media_is_preparsed (media, &ex))
57 artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex);
60 const char *expected_artist = "mike";
63 log ("+ got '%s' as Artist, expecting %s\n", artist, expected_artist);
65 int string_compare = strcmp (artist, expected_artist);
66 assert (!string_compare);
69 libvlc_media_release (media);
78 test_meta (test_defaults_args, test_defaults_nargs);