Skip to content
Snippets Groups Projects
Commit 641f3d74 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

test: add back media_discoverer test

This doesn't test network services anymore.
parent 983caa91
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ check_PROGRAMS = \
test_libvlc_media \
test_libvlc_media_list \
test_libvlc_media_player \
test_libvlc_media_discoverer \
test_libvlc_slaves \
test_src_config_chain \
test_src_misc_variables \
......@@ -81,8 +82,8 @@ test_libvlc_media_list_SOURCES = libvlc/media_list.c
test_libvlc_media_list_LDADD = $(LIBVLC)
test_libvlc_media_player_SOURCES = libvlc/media_player.c
test_libvlc_media_player_LDADD = $(LIBVLC)
#test_libvlc_media_discoverer_SOURCES = libvlc/media_discoverer.c
#test_libvlc_media_discoverer_LDADD = $(LIBVLCCORE) $(LIBVLC)
test_libvlc_media_discoverer_SOURCES = libvlc/media_discoverer.c
test_libvlc_media_discoverer_LDADD = $(LIBVLC)
test_libvlc_slaves_SOURCES = libvlc/slaves.c
test_libvlc_slaves_LDADD = $(LIBVLCCORE) $(LIBVLC)
test_libvlc_meta_SOURCES = libvlc/meta.c
......
......@@ -20,8 +20,7 @@
#include "test.h"
#include <vlc_common.h>
#include <vlc_mtime.h> /* for msleep */
#include <string.h>
static void
ml_item_event(const struct libvlc_event_t *p_ev, const char *psz_event)
......@@ -29,7 +28,8 @@ ml_item_event(const struct libvlc_event_t *p_ev, const char *psz_event)
char *psz_mrl = libvlc_media_get_mrl(p_ev->u.media_list_item_added.item);
assert(psz_mrl);
log("item added(%d): '%s'\n", p_ev->u.media_list_item_added.index, psz_mrl);
log("item %s(%d): '%s'\n", psz_event, p_ev->u.media_list_item_added.index,
psz_mrl);
free(psz_mrl);
}
......@@ -50,6 +50,8 @@ ml_item_deleted(const struct libvlc_event_t *p_ev, void *p_data)
static void
test_discoverer(libvlc_instance_t *p_vlc, const char *psz_name)
{
log("creating and starting discoverer %s\n", psz_name);
libvlc_media_discoverer_t *p_md =
libvlc_media_discoverer_new(p_vlc, psz_name);
assert(p_md != NULL);
......@@ -75,7 +77,6 @@ test_discoverer(libvlc_instance_t *p_vlc, const char *psz_name)
else
{
assert(libvlc_media_discoverer_is_running(p_md));
msleep(20000);
libvlc_media_discoverer_stop(p_md);
}
......@@ -117,10 +118,11 @@ main (void)
libvlc_media_discoverer_description *p_service = pp_services[i];
assert(i_cat == p_service->i_cat);
log("= creating and start discoverer: name: '%s', longname: '%s' =\n",
log("= discoverer: name: '%s', longname: '%s' =\n",
p_service->psz_name, p_service->psz_longname);
if( !strncasecmp( p_service->psz_name, "podcast", 7 ) )
if (!strncasecmp(p_service->psz_name, "podcast", 7)
|| i_cat == libvlc_media_discoverer_lan)
{
/* see comment in libvlc_media_discoverer_new() */
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment