diff options
author | Zeeshan Ali <zeenix@gmail.com> | 2008-06-06 13:35:56 +0000 |
---|---|---|
committer | Zeeshan Ali <zeenix@gmail.com> | 2008-06-06 13:35:56 +0000 |
commit | a1c415f346bc39ce022e80bc7e6763d71ef75227 (patch) | |
tree | a9f0cdda7640f180bf41577ccc228ad3a04632a3 /tests | |
parent | c9b2073c93b64789f5b7628a704cd2c8bc239e04 (diff) | |
download | gupnp-vala-a1c415f346bc39ce022e80bc7e6763d71ef75227.tar.gz |
Remove redundant namespace specifications.
This also makes everything fit in 80 columns, finally :)
git-svn-id: https://svn.o-hand.com/repos/gupnp/trunk/bindings/gupnp-vala@1036 d8cb91d7-bff9-0310-92b9-80b65e4482b2
Diffstat (limited to 'tests')
-rw-r--r-- | tests/browsing-test.vala | 54 | ||||
-rw-r--r-- | tests/device-view-test.vala | 6 | ||||
-rw-r--r-- | tests/introspection-test.vala | 25 | ||||
-rw-r--r-- | tests/proxy-test.vala | 60 | ||||
-rw-r--r-- | tests/server-test.vala | 32 | ||||
-rw-r--r-- | tests/test-publisher.vala | 2 |
6 files changed, 90 insertions, 89 deletions
diff --git a/tests/browsing-test.vala b/tests/browsing-test.vala index aa250f6..ef5dd2f 100644 --- a/tests/browsing-test.vala +++ b/tests/browsing-test.vala @@ -7,58 +7,58 @@ using GUPnP; * * SIGTERM handler? */ -public class Test.BrowsingTest : GLib.Object { +public class Test.BrowsingTest : Object { public static int main (string[] args) { - GUPnP.Context ctxt; + Context ctxt; try { - GLib.Thread.init (null); + Thread.init (null); ctxt = new Context (null, null, 0); - } catch (GLib.Error err) { - GLib.critical (err.message); + } catch (Error err) { + critical (err.message); return 1; } /* We're interested in everything */ - GUPnP.ControlPoint cp = new ControlPoint (ctxt, "ssdp:all"); + ControlPoint cp = new ControlPoint (ctxt, "ssdp:all"); cp.device_proxy_available += on_device_proxy_available; cp.device_proxy_unavailable += on_device_proxy_unavailable; cp.service_proxy_available += on_service_proxy_available; cp.service_proxy_unavailable += on_service_proxy_unavailable; cp.active = true; - GLib.MainLoop loop = new MainLoop (null, false); + MainLoop loop = new MainLoop (null, false); loop.run(); return 0; } - private static void on_service_proxy_available (GUPnP.ControlPoint cp, - GUPnP.ServiceProxy proxy) { - GLib.print ("Service available:\n"); - GLib.print ("\ttype: %s\n", proxy.service_type); - GLib.print ("\tlocation: %s\n", proxy.location); + private static void on_service_proxy_available (ControlPoint cp, + ServiceProxy proxy) { + print ("Service available:\n"); + print ("\ttype: %s\n", proxy.service_type); + print ("\tlocation: %s\n", proxy.location); } - private static void on_service_proxy_unavailable (GUPnP.ControlPoint cp, - GUPnP.ServiceProxy proxy) { - GLib.print ("Service unavailable:\n"); - GLib.print ("\ttype: %s\n", proxy.service_type); - GLib.print ("\tlocation: %s\n", proxy.location); + private static void on_service_proxy_unavailable (ControlPoint cp, + ServiceProxy proxy) { + print ("Service unavailable:\n"); + print ("\ttype: %s\n", proxy.service_type); + print ("\tlocation: %s\n", proxy.location); } - private static void on_device_proxy_available (GUPnP.ControlPoint cp, - GUPnP.DeviceProxy proxy) { - GLib.print ("Device available:\n"); - GLib.print ("\ttype: %s\n", proxy.device_type); - GLib.print ("\tlocation: %s\n", proxy.location); + private static void on_device_proxy_available (ControlPoint cp, + DeviceProxy proxy) { + print ("Device available:\n"); + print ("\ttype: %s\n", proxy.device_type); + print ("\tlocation: %s\n", proxy.location); } - private static void on_device_proxy_unavailable (GUPnP.ControlPoint cp, - GUPnP.DeviceProxy proxy) { - GLib.print ("Device unavailable:\n"); - GLib.print ("\ttype: %s\n", proxy.device_type); - GLib.print ("\tlocation: %s\n", proxy.location); + private static void on_device_proxy_unavailable (ControlPoint cp, + DeviceProxy proxy) { + print ("Device unavailable:\n"); + print ("\ttype: %s\n", proxy.device_type); + print ("\tlocation: %s\n", proxy.location); } } diff --git a/tests/device-view-test.vala b/tests/device-view-test.vala index 7aba209..2bd4607 100644 --- a/tests/device-view-test.vala +++ b/tests/device-view-test.vala @@ -12,10 +12,10 @@ public class Test.DeviceViewTest : Window { /* Init GUPnP stuff */ Context ctxt; try { - GLib.Thread.init (null); + Thread.init (null); ctxt = new Context (null, null, 0); - } catch (GLib.Error err) { - GLib.critical (err.message); + } catch (Error err) { + critical (err.message); Gtk.main_quit (); } diff --git a/tests/introspection-test.vala b/tests/introspection-test.vala index 18b4c42..f3e81cf 100644 --- a/tests/introspection-test.vala +++ b/tests/introspection-test.vala @@ -27,7 +27,7 @@ public class Test.IntrospectionTest : Object { } private int run (string[] args) { - GUPnP.Context ctxt; + Context ctxt; /* handle command line options */ try { @@ -49,18 +49,18 @@ public class Test.IntrospectionTest : Object { } /* We're interested in everything */ - GUPnP.ControlPoint cp = new ControlPoint (ctxt, "ssdp:all"); + ControlPoint cp = new ControlPoint (ctxt, "ssdp:all"); cp.service_proxy_available += on_service_proxy_available; cp.active = true; - GLib.MainLoop loop = new MainLoop (null, false); + MainLoop loop = new MainLoop (null, false); loop.run(); return 0; } - private void on_service_proxy_available (GUPnP.ControlPoint cp, - GUPnP.ServiceProxy proxy) { + private void on_service_proxy_available (ControlPoint cp, + ServiceProxy proxy) { if (async) { /* this will result in C compiler warning because * there's no way to make the callback signature have @@ -71,7 +71,7 @@ public class Test.IntrospectionTest : Object { print ("service: %s\nlocation: %s\n", proxy.udn, proxy.location); - GUPnP.ServiceIntrospection introspection = + ServiceIntrospection introspection = proxy.get_introspection (); print_state_variables (introspection); print_actions (introspection); @@ -82,9 +82,9 @@ public class Test.IntrospectionTest : Object { } } - private void on_get_introspection (GUPnP.ServiceInfo info, - GUPnP.ServiceIntrospection introspection, - Error err) { + private void on_get_introspection (ServiceInfo info, + ServiceIntrospection introspection, + Error err) { print ("service: %s\nlocation: %s\n", info.udn, info.location); @@ -97,7 +97,7 @@ public class Test.IntrospectionTest : Object { } } - private void print_state_variables (GUPnP.ServiceIntrospection introspection) { + private void print_state_variables (ServiceIntrospection introspection) { /* this will result in C compiler warning since the return value is actually "_const_ GList*", and Vala can't express that. */ weak List<ServiceStateVariableInfo> variables = @@ -155,7 +155,7 @@ public class Test.IntrospectionTest : Object { } } - private void print_actions (GUPnP.ServiceIntrospection introspection) { + private void print_actions (ServiceIntrospection introspection) { /* this will result in C compiler warning since the return value is actually "_const_ GList*", and Vala can't express that. */ weak List<ServiceActionInfo> actions = introspection.list_actions (); @@ -173,7 +173,8 @@ public class Test.IntrospectionTest : Object { "\t\t\tdirection: %s\n" + "\t\t\trelated state variable: %s\n\n", arg_info.name, - (arg_info.direction == ServiceActionArgDirection.IN) ? "in":"out", + (arg_info.direction == ServiceActionArgDirection.IN) ? + "in":"out", arg_info.related_state_variable); } } diff --git a/tests/proxy-test.vala b/tests/proxy-test.vala index 78d0481..2a26c94 100644 --- a/tests/proxy-test.vala +++ b/tests/proxy-test.vala @@ -7,35 +7,35 @@ using GUPnP; * * SIGTERM handler? */ -public class Test.ProxyTest : GLib.Object { +public class Test.ProxyTest : Object { public static int main (string[] args) { - GUPnP.Context ctxt; + Context ctxt; try { - GLib.Thread.init (null); + Thread.init (null); ctxt = new Context (null, null, 0); - } catch (GLib.Error err) { - GLib.critical (err.message); + } catch (Error err) { + critical (err.message); return 1; } - GUPnP.ControlPoint cp = new ControlPoint - (ctxt, "urn:schemas-upnp-org:service:ContentDirectory:1"); + ControlPoint cp = new ControlPoint + (ctxt, "urn:schemas-upnp-org:service:ContentDirectory:1"); cp.service_proxy_available += on_service_proxy_available; cp.service_proxy_unavailable += on_service_proxy_unavailable; cp.active = true; - GLib.MainLoop loop = new MainLoop (null, false); + MainLoop loop = new MainLoop (null, false); loop.run(); return 0; } - private static void on_service_proxy_available (GUPnP.ControlPoint cp, - GUPnP.ServiceProxy proxy) { - GLib.print ("ContentDirectory available:\n"); - GLib.print ("\tlocation: %s\n", proxy.location); + private static void on_service_proxy_available (ControlPoint cp, + ServiceProxy proxy) { + print ("ContentDirectory available:\n"); + print ("\tlocation: %s\n", proxy.location); /* We want to be notified whenever SystemUpdateID changes */ proxy.add_notify ("SystemUpdateID", typeof (uint), on_notify); @@ -64,32 +64,32 @@ public class Test.ProxyTest : GLib.Object { "NumberReturned", typeof (uint), out count, "TotalMatches", typeof (uint), out total, null); - GLib.print ("Browse returned:\n"); - GLib.print ("\tResult: %s\n", result); - GLib.print ("\tNumberReturned: %u\n", count); - GLib.print ("\tTotalMatches: %u\n", total); - } catch (GLib.Error err) { - GLib.printerr ("Error: %s\n", err.message); + print ("Browse returned:\n"); + print ("\tResult: %s\n", result); + print ("\tNumberReturned: %u\n", count); + print ("\tTotalMatches: %u\n", total); + } catch (Error err) { + printerr ("Error: %s\n", err.message); } } - private static void on_service_proxy_unavailable (GUPnP.ControlPoint cp, - GUPnP.ServiceProxy proxy) { - GLib.print ("ContentDirectory unavailable:\n"); - GLib.print ("\tlocation: %s\n", proxy.location); + private static void on_service_proxy_unavailable (ControlPoint cp, + ServiceProxy proxy) { + print ("ContentDirectory unavailable:\n"); + print ("\tlocation: %s\n", proxy.location); } - private static void on_notify (GUPnP.ServiceProxy proxy, - string variable, - GLib.Value value) { - GLib.print ("Received a notification for variable '%s':\n", + private static void on_notify (ServiceProxy proxy, + string variable, + Value value) { + print ("Received a notification for variable '%s':\n", variable); - GLib.print ("\tvalue: %d\n", value.get_uint); + print ("\tvalue: %d\n", value.get_uint); } - private static void on_subscription_lost (GUPnP.ServiceProxy proxy, - GLib.Error reason) { - GLib.print ("Lost subscription: %s\n", reason.message); + private static void on_subscription_lost (ServiceProxy proxy, + Error reason) { + print ("Lost subscription: %s\n", reason.message); } } diff --git a/tests/server-test.vala b/tests/server-test.vala index 40fe55f..867def9 100644 --- a/tests/server-test.vala +++ b/tests/server-test.vala @@ -9,8 +9,8 @@ using GUPnP; * * SIGTERM handler? */ -public class Test.ServerTest : GLib.Object { - GUPnP.Service content_dir; +public class Test.ServerTest : Object { + Service content_dir; public static int main (string[] args) { Test.ServerTest test = new ServerTest (); @@ -18,17 +18,17 @@ public class Test.ServerTest : GLib.Object { } private int run (string[] args) { - GUPnP.Context ctxt; + Context ctxt; try { - GLib.Thread.init (null); + Thread.init (null); ctxt = new Context (null, null, 0); - } catch (GLib.Error err) { - GLib.critical (err.message); + } catch (Error err) { + critical (err.message); return 1; } - GLib.print ("Running on port %d\n", ctxt.port); + print ("Running on port %d\n", ctxt.port); /* Host current directory */ ctxt.host_path (".", ""); @@ -37,15 +37,15 @@ public class Test.ServerTest : GLib.Object { Xml.Doc *doc = Xml.Parser.parse_file ("description.xml"); /* Create root device. Needs description.xml in working directory */ - GUPnP.RootDevice dev = new RootDevice (ctxt, "/description.xml"); + RootDevice dev = new RootDevice (ctxt, "/description.xml"); if (dev == null) { - GLib.critical ("Creating root device failed"); + critical ("Creating root device failed"); return 1; } /* Implement Browse action on ContentDirectory if available */ content_dir = - (GUPnP.Service) dev.get_service ( + (Service) dev.get_service ( "urn:schemas-upnp-org:service:ContentDirectory"); if (content_dir != null) { @@ -53,21 +53,21 @@ public class Test.ServerTest : GLib.Object { /* TODO: connect service signal handlers */ content_dir.notify_failed += on_notify_failed; - GLib.Timeout.add (5000, timeout); + Timeout.add (5000, timeout); } dev.available = true; - GLib.MainLoop loop = new MainLoop (null, false); + MainLoop loop = new MainLoop (null, false); loop.run(); return 0; } - private void on_notify_failed (GUPnP.Service service, - GLib.List callback_url, - GLib.Error reason) { - GLib.print ("NOTIFY failed: %s\n", reason.message); + private void on_notify_failed (Service service, + List callback_url, + Error reason) { + print ("NOTIFY failed: %s\n", reason.message); } private bool timeout () { diff --git a/tests/test-publisher.vala b/tests/test-publisher.vala index eee21e4..01aa94c 100644 --- a/tests/test-publisher.vala +++ b/tests/test-publisher.vala @@ -25,7 +25,7 @@ public class TestPublisher : ResourceGroup { publisher.available = true; - GLib.MainLoop loop = new MainLoop (null, false); + MainLoop loop = new MainLoop (null, false); loop.run(); return 0; |