[farsight2/master] Rename test to test-bare

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:24:34 PST 2008


---
 Makefile    |    6 ++--
 test-bare.c |   68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 test.c      |   69 -----------------------------------------------------------
 3 files changed, 71 insertions(+), 72 deletions(-)
 create mode 100644 test-bare.c
 delete mode 100644 test.c

diff --git a/Makefile b/Makefile
index 3efc5fe..4979f49 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
 
-all: test obj-test
+all: test-bare test
 
 CFLAGS = -Wextra -Wall -Wno-unused-parameter -Wno-missing-field-initializers `pkg-config --cflags gupnp-1.0`
 LDFLAGS =  `pkg-config --libs gupnp-1.0`
 
-test: test.o
+test-bare: test-bare.o
 
-obj-test: fs-upnp-simple-igd.o
+test: fs-upnp-simple-igd.o
diff --git a/test-bare.c b/test-bare.c
new file mode 100644
index 0000000..becaf54
--- /dev/null
+++ b/test-bare.c
@@ -0,0 +1,68 @@
+
+#include <libgupnp/gupnp-control-point.h>
+#include <glib.h>
+
+
+static void
+service_proxy_avail (GUPnPControlPoint *control_point,
+    GUPnPServiceProxy *proxy,
+    gpointer           user_data)
+{
+  GError *error = NULL;
+  gchar *ip = NULL;
+
+  g_debug ("Serv type: %s",
+      gupnp_service_info_get_service_type (GUPNP_SERVICE_INFO (proxy)));
+
+  if (gupnp_service_proxy_send_action (proxy, "GetExternalIPAddress",
+          &error,
+          NULL,
+          "NewExternalIPAddress", G_TYPE_STRING, &ip, NULL))
+  {
+    g_debug ("Got ip %s", ip);
+  }
+  else
+  {
+    g_warning ("got Error: %s", error->message);
+  }
+  g_clear_error (&error);
+}
+
+int
+main (int argc, char **argv)
+{
+  GError *error = NULL;
+  GUPnPContext *context;
+  GUPnPControlPoint *cp;
+  GMainLoop *loop;
+
+  g_type_init ();
+  g_thread_init (NULL);
+
+  loop = g_main_loop_new (NULL, FALSE);
+
+  context = gupnp_context_new (NULL, NULL, 0, &error);
+  if (error) {
+    g_critical (error->message);
+    g_error_free (error);
+
+    return 1;
+  }
+
+  cp = gupnp_control_point_new (context, "urn:schemas-upnp-org:service:WANIPConnection:1");
+
+
+ g_signal_connect (cp, "service-proxy-available",
+     G_CALLBACK (service_proxy_avail), NULL);
+
+ gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE);
+
+ g_main_loop_run (loop);
+
+
+ g_object_unref (cp);
+ g_object_unref (context);
+ g_object_unref (loop);
+
+ return 0;
+}
diff --git a/test.c b/test.c
deleted file mode 100644
index ebdb14a..0000000
--- a/test.c
+++ /dev/null
@@ -1,69 +0,0 @@
-
-#include <libgupnp/gupnp-control-point.h>
-#include <glib.h>
-
-
-static void
-service_proxy_avail (GUPnPControlPoint *control_point,
-    GUPnPServiceProxy *proxy,
-    gpointer           user_data)
-{
-  GError *error = NULL;
-  gchar *ip = NULL;
-
-  g_debug ("Serv type: %s",
-      gupnp_service_info_get_service_type (GUPNP_SERVICE_INFO (proxy)));
-
-  if (gupnp_service_proxy_send_action (proxy, "GetExternalIPAddress",
-          &error,
-          NULL,
-          "NewExternalIPAddress", G_TYPE_STRING, &ip, NULL))
-  {
-    g_debug ("Got ip %s", ip);
-  }
-  else
-  {
-    g_warning ("got Error: %s", error->message);
-  }
-  g_clear_error (&error);
-}
-
-int
-main (int argc, char **argv)
-{
-  GError *error = NULL;
-  GUPnPContext *context;
-  GUPnPControlPoint *cp;
-  GMainLoop *loop;
-  const GList *item;
-
-  g_type_init ();
-  g_thread_init (NULL);
-
-  loop = g_main_loop_new (NULL, FALSE);
-
-  context = gupnp_context_new (NULL, NULL, 0, &error);
-  if (error) {
-    g_critical (error->message);
-    g_error_free (error);
-
-    return 1;
-  }
-
-  cp = gupnp_control_point_new (context, "urn:schemas-upnp-org:service:WANIPConnection:1");
-
-
- g_signal_connect (cp, "service-proxy-available",
-     G_CALLBACK (service_proxy_avail), NULL);
-
- gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE);
-
- g_main_loop_run (loop);
-
-
- g_object_unref (cp);
- g_object_unref (context);
- g_object_unref (loop);
-
- return 0;
-}
-- 
1.5.6.5




More information about the farsight-commits mailing list