|
Revision 3e6a01941b7a2797fdf992f5e39d724ef2ee63af, 2.5 kB
(checked in by Pierre d'Herbemont <pdherbemont@videolan.org>, 5 months ago)
|
test: Remi's copyright in libvlc/meta.c as asked by jpsaman.
|
- Property mode set to
100644
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
#include "test.h" |
|---|
| 26 |
|
|---|
| 27 |
static void test_meta (const char ** argv, int argc) |
|---|
| 28 |
{ |
|---|
| 29 |
libvlc_instance_t *vlc; |
|---|
| 30 |
libvlc_media_t *media; |
|---|
| 31 |
char * artist; |
|---|
| 32 |
|
|---|
| 33 |
log ("Testing meta\n"); |
|---|
| 34 |
|
|---|
| 35 |
libvlc_exception_init (&ex); |
|---|
| 36 |
vlc = libvlc_new (argc, argv, &ex); |
|---|
| 37 |
catch (); |
|---|
| 38 |
|
|---|
| 39 |
media = libvlc_media_new (vlc, "samples/meta.sample", &ex); |
|---|
| 40 |
catch (); |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex); |
|---|
| 46 |
catch (); |
|---|
| 47 |
|
|---|
| 48 |
free (artist); |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
while (!libvlc_media_is_preparsed (media, &ex)) |
|---|
| 52 |
{ |
|---|
| 53 |
catch (); |
|---|
| 54 |
msleep (10000); |
|---|
| 55 |
} |
|---|
| 56 |
|
|---|
| 57 |
artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex); |
|---|
| 58 |
catch (); |
|---|
| 59 |
|
|---|
| 60 |
const char *expected_artist = "mike"; |
|---|
| 61 |
|
|---|
| 62 |
assert (artist); |
|---|
| 63 |
log ("+ got '%s' as Artist, expecting %s\n", artist, expected_artist); |
|---|
| 64 |
|
|---|
| 65 |
int string_compare = strcmp (artist, expected_artist); |
|---|
| 66 |
assert (!string_compare); |
|---|
| 67 |
|
|---|
| 68 |
free (artist); |
|---|
| 69 |
libvlc_media_release (media); |
|---|
| 70 |
libvlc_release (vlc); |
|---|
| 71 |
} |
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
int main (void) |
|---|
| 75 |
{ |
|---|
| 76 |
test_init(); |
|---|
| 77 |
|
|---|
| 78 |
test_meta (test_defaults_args, test_defaults_nargs); |
|---|
| 79 |
|
|---|
| 80 |
return 0; |
|---|
| 81 |
} |
|---|