Commit 6c0e4396 authored by Rafaël Carré's avatar Rafaël Carré

Meta test:

Precise a comment
Wrap a long line
Rework the assertions:
    Do it in the right order
    Do not put str*cmp-that-could-be-a-ugly-glibc-macro in assert()
parent 3181ed58
...@@ -38,21 +38,31 @@ static void test_meta (const char ** argv, int argc) ...@@ -38,21 +38,31 @@ static void test_meta (const char ** argv, int argc)
media = libvlc_media_new (vlc, "samples/meta.sample", &ex); media = libvlc_media_new (vlc, "samples/meta.sample", &ex);
catch (); 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); artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex);
catch (); catch ();
free (artist); free (artist);
/* Wait for the meta */ /* 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); artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex);
catch (); catch ();
assert (artist && !strncmp (artist, "mike", 4)); const char *expected_artist = "mike";
assert (artist);
log ("+ got '%s' as Artist, expecting %s\n", artist, expected_artist);
log ("+ got '%s' as Artist\n", artist); int string_compare = strcmp (artist, expected_artist);
assert (!string_compare);
free (artist); free (artist);
libvlc_media_release (media); libvlc_media_release (media);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment