X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=test%2Flibvlc%2Fmeta.c;h=f2e5963d9291a18eaac06ebd64d4a0f098227bd7;hb=d11fd0d1e5433a5299fbf0f0150178178ebd3f83;hp=7bff22ee457d43ec3b8bd0e4cb985b447b752e80;hpb=62333c7c1ef803c55f125cab1b193a26d11c55e0;p=vlc diff --git a/test/libvlc/meta.c b/test/libvlc/meta.c index 7bff22ee45..f2e5963d92 100644 --- a/test/libvlc/meta.c +++ b/test/libvlc/meta.c @@ -5,6 +5,7 @@ */ /********************************************************************** + * Copyright (C) 2007 Rémi Denis-Courmont. * * Copyright (C) 2008 Pierre d'Herbemont. * * This program is free software; you can redistribute and/or modify * * it under the terms of the GNU General Public License as published * @@ -36,20 +37,33 @@ static void test_meta (const char ** argv, int argc) catch (); media = libvlc_media_new (vlc, "samples/meta.sample", &ex); + catch (); - /* Tell that we are interested in this precise meta data */ + /* Tell that we are interested in this precise meta data + * This is needed to trigger meta data reading + * (the first calls return NULL) */ artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex); catch (); free (artist); /* Wait for the meta */ - while (!libvlc_media_is_preparsed (media, &ex)) { catch (); msleep (10000); } + while (!libvlc_media_is_preparsed (media, &ex)) + { + catch (); + msleep (10000); + } artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex); catch (); - assert (artist && *artist); + const char *expected_artist = "mike"; + + assert (artist); + log ("+ got '%s' as Artist, expecting %s\n", artist, expected_artist); + + int string_compare = strcmp (artist, expected_artist); + assert (!string_compare); free (artist); libvlc_media_release (media);