# HG changeset patch # User renatofilho # Date 1203948869 0 # Node ID 337aef39e86a83f48dc5bc36a0ea713d77f2b517 # Parent 04cd5e61dca3dd8842948153b856b33d10b3d7ac [svn r932] moved test dir to tests diff -r 04cd5e61dca3 -r 337aef39e86a gmyth-upnp/Makefile.am --- a/gmyth-upnp/Makefile.am Mon Feb 25 14:12:27 2008 +0000 +++ b/gmyth-upnp/Makefile.am Mon Feb 25 14:14:29 2008 +0000 @@ -1,4 +1,4 @@ -SUBDIRS= src test +SUBDIRS= src tests ### all of the standard pc files we need to generate pcfiles = gmyth-upnp.pc diff -r 04cd5e61dca3 -r 337aef39e86a gmyth-upnp/configure.ac --- a/gmyth-upnp/configure.ac Mon Feb 25 14:12:27 2008 +0000 +++ b/gmyth-upnp/configure.ac Mon Feb 25 14:14:29 2008 +0000 @@ -128,7 +128,7 @@ AC_OUTPUT([ Makefile src/Makefile -test/Makefile +tests/Makefile gmyth-upnp.pc]) if test "x$enable_debug" != "xno"; then diff -r 04cd5e61dca3 -r 337aef39e86a gmyth-upnp/test/Makefile.am --- a/gmyth-upnp/test/Makefile.am Mon Feb 25 14:12:27 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -LDADD = \ - $(GLIB_LIBS) \ - $(LIBUPNP_LIBS) \ - $(top_srcdir)/src/.libs/libgmythupnp.la - -INCLUDES = \ - -I$(top_srcdir)/src \ - $(GLIB_CFLAGS) \ - $(GOBJECT_CFLAGS) \ - $(LIBUPNP_CFLAGS) - -noinst_PROGRAMS = \ - gmyth-upnp-test - -gmyth_upnp_test_SOURCES = \ - main.c - -CLEANFILES = $(BUILT_SOURCES) diff -r 04cd5e61dca3 -r 337aef39e86a gmyth-upnp/test/main.c --- a/gmyth-upnp/test/main.c Mon Feb 25 14:12:27 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/** - * GMyth Library - * - * @file test/main.c - * - * @brief

GMythUPnP allows that a MythTV frontend discovers a - * MythTV backend, using the UPnP architecture. - * - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia. - * @author Rosfran Lins Borges - * @authon Renato Araujo Oliveira Filho - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - - -#include - -#include "gmyth_upnp.h" - -static void -_device_found_cb (GMythUPnP *upnp, - GMythBackendInfo *info, - gpointer data) -{ - g_debug ("BACKEND FOUND: %s", info->hostname); -} - -static void -_device_lost_cb (GMythUPnP *upnp, - GMythBackendInfo *info, - gpointer data) -{ - g_debug ("BACKEND LOST: %s", info->hostname); -} - - - -int main (int argc, char** argv) -{ - GMythUPnP *o; - GMainLoop *loop; - - g_type_init (); - g_thread_init (NULL); - - o = gmyth_upnp_get_instance (); - g_signal_connect (o, - "device-found", - G_CALLBACK (_device_found_cb), - NULL); - g_signal_connect (o, - "device-lost", - G_CALLBACK (_device_lost_cb), - NULL); - - - gmyth_upnp_search (o); - - loop = g_main_loop_new (NULL, FALSE); - g_main_loop_run (loop); - g_object_unref (o); - - return 0; -} diff -r 04cd5e61dca3 -r 337aef39e86a gmyth-upnp/tests/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-upnp/tests/Makefile.am Mon Feb 25 14:14:29 2008 +0000 @@ -0,0 +1,18 @@ +LDADD = \ + $(GLIB_LIBS) \ + $(LIBUPNP_LIBS) \ + $(top_srcdir)/src/.libs/libgmythupnp.la + +INCLUDES = \ + -I$(top_srcdir)/src \ + $(GLIB_CFLAGS) \ + $(GOBJECT_CFLAGS) \ + $(LIBUPNP_CFLAGS) + +noinst_PROGRAMS = \ + gmyth-upnp-test + +gmyth_upnp_test_SOURCES = \ + main.c + +CLEANFILES = $(BUILT_SOURCES) diff -r 04cd5e61dca3 -r 337aef39e86a gmyth-upnp/tests/main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-upnp/tests/main.c Mon Feb 25 14:14:29 2008 +0000 @@ -0,0 +1,78 @@ +/** + * GMyth Library + * + * @file test/main.c + * + * @brief

GMythUPnP allows that a MythTV frontend discovers a + * MythTV backend, using the UPnP architecture. + * + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia. + * @author Rosfran Lins Borges + * @authon Renato Araujo Oliveira Filho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#include + +#include "gmyth_upnp.h" + +static void +_device_found_cb (GMythUPnP *upnp, + GMythBackendInfo *info, + gpointer data) +{ + g_debug ("BACKEND FOUND: %s", info->hostname); +} + +static void +_device_lost_cb (GMythUPnP *upnp, + GMythBackendInfo *info, + gpointer data) +{ + g_debug ("BACKEND LOST: %s", info->hostname); +} + + + +int main (int argc, char** argv) +{ + GMythUPnP *o; + GMainLoop *loop; + + g_type_init (); + g_thread_init (NULL); + + o = gmyth_upnp_get_instance (); + g_signal_connect (o, + "device-found", + G_CALLBACK (_device_found_cb), + NULL); + g_signal_connect (o, + "device-lost", + G_CALLBACK (_device_lost_cb), + NULL); + + + gmyth_upnp_search (o); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + g_object_unref (o); + + return 0; +}