summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2005-01-18 20:42:15 +0000
committerHavoc Pennington <hp@redhat.com>2005-01-18 20:42:15 +0000
commit8873c90f99303f9cc308f15f8d03e637911f5b9e (patch)
tree03e459881912388cc6c3759d91fb0cf75739a5a7 /test
parent4fce285052c143296cd9e08a48de0175b5207853 (diff)
2005-01-18 Havoc Pennington <hp@redhat.com>
* Throughout, grand renaming to strip out the use of "service", just say "name" instead (or "bus name" when ambiguous). Did not change the internal code of the message bus itself, only the programmer-facing API and messages. * doc/dbus-specification.xml: further update the message bus section * bus/config-parser.c (all_are_equiv): fix bug using freed string in error case
Diffstat (limited to 'test')
-rw-r--r--test/data/equiv-config-files/basic/basic-1.conf6
-rw-r--r--test/data/valid-config-files/basic.conf6
-rw-r--r--test/data/valid-config-files/many-rules.conf6
-rw-r--r--test/glib/test-dbus-glib.c52
-rw-r--r--test/glib/test-profile.c20
-rw-r--r--test/glib/test-service-glib.c2
-rw-r--r--test/test-service.c6
7 files changed, 49 insertions, 49 deletions
diff --git a/test/data/equiv-config-files/basic/basic-1.conf b/test/data/equiv-config-files/basic/basic-1.conf
index 4500ad70..99f41e80 100644
--- a/test/data/equiv-config-files/basic/basic-1.conf
+++ b/test/data/equiv-config-files/basic/basic-1.conf
@@ -14,12 +14,12 @@
<limit name="max_incoming_bytes">5000</limit>
<limit name="max_outgoing_bytes">5000</limit>
<limit name="max_message_size">300</limit>
- <limit name="activation_timeout">5000</limit>
+ <limit name="service_start_timeout">5000</limit>
<limit name="auth_timeout">6000</limit>
<limit name="max_completed_connections">50</limit>
<limit name="max_incomplete_connections">80</limit>
<limit name="max_connections_per_user">64</limit>
- <limit name="max_pending_activations">64</limit>
- <limit name="max_services_per_connection">256</limit>
+ <limit name="max_pending_service_starts">64</limit>
+ <limit name="max_names_per_connection">256</limit>
</busconfig>
diff --git a/test/data/valid-config-files/basic.conf b/test/data/valid-config-files/basic.conf
index 73bd02ac..5297097d 100644
--- a/test/data/valid-config-files/basic.conf
+++ b/test/data/valid-config-files/basic.conf
@@ -14,13 +14,13 @@
<limit name="max_incoming_bytes">5000</limit>
<limit name="max_outgoing_bytes">5000</limit>
<limit name="max_message_size">300</limit>
- <limit name="activation_timeout">5000</limit>
+ <limit name="service_start_timeout">5000</limit>
<limit name="auth_timeout">6000</limit>
<limit name="max_completed_connections">50</limit>
<limit name="max_incomplete_connections">80</limit>
<limit name="max_connections_per_user">64</limit>
- <limit name="max_pending_activations">64</limit>
- <limit name="max_services_per_connection">256</limit>
+ <limit name="max_pending_service_starts">64</limit>
+ <limit name="max_names_per_connection">256</limit>
<selinux>
<associate own="org.freedesktop.FrobationaryMeasures"
diff --git a/test/data/valid-config-files/many-rules.conf b/test/data/valid-config-files/many-rules.conf
index 0c675828..ab05909f 100644
--- a/test/data/valid-config-files/many-rules.conf
+++ b/test/data/valid-config-files/many-rules.conf
@@ -46,13 +46,13 @@
<limit name="max_incoming_bytes">5000</limit>
<limit name="max_outgoing_bytes">5000</limit>
<limit name="max_message_size">300</limit>
- <limit name="activation_timeout">5000</limit>
+ <limit name="service_start_timeout">5000</limit>
<limit name="auth_timeout">6000</limit>
<limit name="max_completed_connections">50</limit>
<limit name="max_incomplete_connections">80</limit>
<limit name="max_connections_per_user">64</limit>
- <limit name="max_pending_activations">64</limit>
- <limit name="max_services_per_connection">256</limit>
+ <limit name="max_pending_service_starts">64</limit>
+ <limit name="max_names_per_connection">256</limit>
<limit name="max_match_rules_per_connection">512</limit>
</busconfig>
diff --git a/test/glib/test-dbus-glib.c b/test/glib/test-dbus-glib.c
index 5ebf3b9d..f217cf5e 100644
--- a/test/glib/test-dbus-glib.c
+++ b/test/glib/test-dbus-glib.c
@@ -58,8 +58,8 @@ main (int argc, char **argv)
DBusGProxy *driver;
DBusGProxy *proxy;
DBusGPendingCall *call;
- char **service_list;
- int service_list_len;
+ char **name_list;
+ int name_list_len;
int i;
guint32 result;
const char *v_STRING;
@@ -82,38 +82,38 @@ main (int argc, char **argv)
/* Create a proxy object for the "bus driver" */
- driver = dbus_g_proxy_new_for_service (connection,
- DBUS_SERVICE_ORG_FREEDESKTOP_DBUS,
- DBUS_PATH_ORG_FREEDESKTOP_DBUS,
- DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS);
+ driver = dbus_g_proxy_new_for_name (connection,
+ DBUS_SERVICE_ORG_FREEDESKTOP_DBUS,
+ DBUS_PATH_ORG_FREEDESKTOP_DBUS,
+ DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS);
- /* Call ListServices method */
+ /* Call ListNames method */
- call = dbus_g_proxy_begin_call (driver, "ListServices", DBUS_TYPE_INVALID);
+ call = dbus_g_proxy_begin_call (driver, "ListNames", DBUS_TYPE_INVALID);
error = NULL;
if (!dbus_g_proxy_end_call (driver, call, &error,
DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &service_list, &service_list_len,
+ &name_list, &name_list_len,
DBUS_TYPE_INVALID))
{
- g_printerr ("Failed to complete ListServices call: %s\n",
+ g_printerr ("Failed to complete ListNames call: %s\n",
error->message);
g_error_free (error);
exit (1);
}
- g_print ("Services on the message bus:\n");
+ g_print ("Names on the message bus:\n");
i = 0;
- while (i < service_list_len)
+ while (i < name_list_len)
{
- g_assert (service_list[i] != NULL);
- g_print (" %s\n", service_list[i]);
+ g_assert (name_list[i] != NULL);
+ g_print (" %s\n", name_list[i]);
++i;
}
- g_assert (service_list[i] == NULL);
+ g_assert (name_list[i] == NULL);
- g_strfreev (service_list);
+ g_strfreev (name_list);
/* Test handling of unknown method */
v_STRING = "blah blah blah blah blah";
@@ -140,7 +140,7 @@ main (int argc, char **argv)
/* Activate a service */
v_STRING = "org.freedesktop.DBus.TestSuiteEchoService";
v_UINT32 = 0;
- call = dbus_g_proxy_begin_call (driver, "ActivateService",
+ call = dbus_g_proxy_begin_call (driver, "StartServiceByName",
DBUS_TYPE_STRING,
&v_STRING,
DBUS_TYPE_UINT32,
@@ -158,12 +158,12 @@ main (int argc, char **argv)
exit (1);
}
- g_print ("Activation of echo service = 0x%x\n", result);
+ g_print ("Starting echo service result = 0x%x\n", result);
/* Activate a service again */
v_STRING = "org.freedesktop.DBus.TestSuiteEchoService";
v_UINT32 = 0;
- call = dbus_g_proxy_begin_call (driver, "ActivateService",
+ call = dbus_g_proxy_begin_call (driver, "StartServiceByName",
DBUS_TYPE_STRING,
&v_STRING,
DBUS_TYPE_UINT32,
@@ -181,19 +181,19 @@ main (int argc, char **argv)
exit (1);
}
- g_print ("Duplicate activation of echo service = 0x%x\n", result);
+ g_print ("Duplicate start of echo service = 0x%x\n", result);
/* Talk to the new service */
- proxy = dbus_g_proxy_new_for_service_owner (connection,
- "org.freedesktop.DBus.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- &error);
+ proxy = dbus_g_proxy_new_for_name_owner (connection,
+ "org.freedesktop.DBus.TestSuiteEchoService",
+ "/org/freedesktop/TestSuite",
+ "org.freedesktop.TestSuite",
+ &error);
if (proxy == NULL)
{
- g_printerr ("Failed to create proxy for service owner: %s\n",
+ g_printerr ("Failed to create proxy for name owner: %s\n",
error->message);
g_error_free (error);
exit (1);
diff --git a/test/glib/test-profile.c b/test/glib/test-profile.c
index 77ce4369..6b4e9058 100644
--- a/test/glib/test-profile.c
+++ b/test/glib/test-profile.c
@@ -423,19 +423,19 @@ with_bus_server_filter (DBusConnection *connection,
DBUS_SERVICE_ORG_FREEDESKTOP_DBUS) &&
dbus_message_is_signal (message,
DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
- "ServiceOwnerChanged"))
+ "NameOwnerChanged"))
{
- const char *service_name, *old_owner, *new_owner;
+ const char *name, *old_owner, *new_owner;
DBusError error;
- service_name = NULL;
+ name = NULL;
old_owner = NULL;
new_owner = NULL;
dbus_error_init (&error);
if (!dbus_message_get_args (message,
&error,
- DBUS_TYPE_STRING, &service_name,
+ DBUS_TYPE_STRING, &name,
DBUS_TYPE_STRING, &old_owner,
DBUS_TYPE_STRING, &new_owner,
DBUS_TYPE_INVALID))
@@ -445,12 +445,12 @@ with_bus_server_filter (DBusConnection *connection,
}
if (g_hash_table_lookup (server->client_names,
- service_name) &&
+ name) &&
*old_owner != '\0' &&
*new_owner == '\0')
{
g_hash_table_remove (server->client_names,
- service_name);
+ name);
server->sd->n_clients -= 1;
if (server->sd->n_clients == 0)
g_main_loop_quit (server->sd->loop);
@@ -525,13 +525,13 @@ with_bus_init_server (ServerData *sd)
connection = dbus_g_connection_get_connection (gconnection);
- dbus_bus_acquire_service (connection,
- ECHO_SERVICE,
- 0, NULL); /* ignore errors because we suck */
+ dbus_bus_request_name (connection,
+ ECHO_SERVICE,
+ 0, NULL); /* ignore errors because we suck */
rule = g_strdup_printf ("type='signal',sender='%s',member='%s'",
DBUS_SERVICE_ORG_FREEDESKTOP_DBUS,
- "ServiceOwnerChanged");
+ "NameOwnerChanged");
/* ignore errors because we suck */
dbus_bus_add_match (connection, rule, NULL);
diff --git a/test/glib/test-service-glib.c b/test/glib/test-service-glib.c
index aa409aa3..cad6f168 100644
--- a/test/glib/test-service-glib.c
+++ b/test/glib/test-service-glib.c
@@ -17,7 +17,7 @@ main (int argc, char **argv)
loop = g_main_loop_new (NULL, FALSE);
error = NULL;
- connection = dbus_g_bus_get (DBUS_BUS_ACTIVATION,
+ connection = dbus_g_bus_get (DBUS_BUS_STARTER,
&error);
if (connection == NULL)
{
diff --git a/test/test-service.c b/test/test-service.c
index 3ba16bbf..588ef01f 100644
--- a/test/test-service.c
+++ b/test/test-service.c
@@ -165,7 +165,7 @@ main (int argc,
int result;
dbus_error_init (&error);
- connection = dbus_bus_get (DBUS_BUS_ACTIVATION, &error);
+ connection = dbus_bus_get (DBUS_BUS_STARTER, &error);
if (connection == NULL)
{
fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n",
@@ -191,8 +191,8 @@ main (int argc,
NULL))
die ("No memory");
- result = dbus_bus_acquire_service (connection, "org.freedesktop.DBus.TestSuiteEchoService",
- 0, &error);
+ result = dbus_bus_request_name (connection, "org.freedesktop.DBus.TestSuiteEchoService",
+ 0, &error);
if (dbus_error_is_set (&error))
{
fprintf (stderr, "Error %s\n", error.message);