test-service, test-shell-service: check what RequestName returned
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 14 Jul 2011 17:43:04 +0000 (18:43 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 5 Aug 2011 11:26:48 +0000 (12:26 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
test/test-service.c
test/test-shell-service.c

index 6627ea7..7181fa3 100644 (file)
@@ -477,7 +477,14 @@ main (int    argc,
       dbus_error_free (&error);
       exit (1);
     }
-  
+
+  if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
+    {
+      fprintf (stderr, "Unable to acquire service: code %d\n", result);
+      _dbus_verbose ("*** Failed to acquire service: %d\n", result);
+      exit (1);
+    }
+
   _dbus_verbose ("*** Test service entering main loop\n");
   _dbus_loop_run (loop);
   
index 57c1612..32a8832 100644 (file)
@@ -176,6 +176,13 @@ main (int    argc,
       exit (1);
     }
 
+  if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
+    {
+      fprintf (stderr, "Unable to acquire service: code %d\n", result);
+      _dbus_verbose ("*** Failed to acquire service: %d\n", result);
+      exit (1);
+    }
+
   _dbus_verbose ("*** Test service entering main loop\n");
   _dbus_loop_run (loop);