summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-12 15:37:32 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-12 15:37:32 +0000
commit0a4e4a6f576fead8bc718a2d076911d8f5168cde (patch)
treec8956ae760f24584e9f2bb5edb3155e93bb38546 /tests
parent692946fe470eae3f3e9fa9453dec7d1f62cff7f2 (diff)
Revert "Rename commit_one() to commit()"
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/dbus-account-plugin.c73
-rw-r--r--tests/twisted/mcp-account-diversion.c5
2 files changed, 39 insertions, 39 deletions
diff --git a/tests/twisted/dbus-account-plugin.c b/tests/twisted/dbus-account-plugin.c
index d1c0bf14..063b886d 100644
--- a/tests/twisted/dbus-account-plugin.c
+++ b/tests/twisted/dbus-account-plugin.c
@@ -1194,6 +1194,36 @@ test_dbus_account_plugin_set_parameter (McpAccountStorage *storage,
return TRUE;
}
+static gboolean
+test_dbus_account_plugin_commit (const McpAccountStorage *storage,
+ const McpAccountManager *am)
+{
+ TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage);
+ GHashTableIter iter;
+ gpointer k;
+
+ DEBUG ("called");
+
+ if (!self->active)
+ return FALSE;
+
+ g_dbus_connection_emit_signal (self->bus, NULL,
+ TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE,
+ "CommittingAll", NULL, NULL);
+
+ g_hash_table_iter_init (&iter, self->accounts);
+
+ while (g_hash_table_iter_next (&iter, &k, NULL))
+ {
+ if (!mcp_account_storage_commit_one (storage, am, k))
+ {
+ g_warning ("declined to commit account %s", (const gchar *) k);
+ }
+ }
+
+ return TRUE;
+}
+
static void
delete_account_cb (GObject *source_object,
GAsyncResult *res,
@@ -1325,9 +1355,11 @@ update_parameters_cb (GObject *source_object,
}
static gboolean
-commit_one (TestDBusAccountPlugin *self,
+test_dbus_account_plugin_commit_one (const McpAccountStorage *storage,
+ const McpAccountManager *am,
const gchar *account_name)
{
+ TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage);
Account *account = lookup_account (self, account_name);
GHashTableIter iter;
gpointer k;
@@ -1338,6 +1370,9 @@ commit_one (TestDBusAccountPlugin *self,
DEBUG ("%s", account_name);
+ if (account_name == NULL)
+ return test_dbus_account_plugin_commit (storage, am);
+
if (!self->active || account == NULL)
return FALSE;
@@ -1489,40 +1524,6 @@ commit_one (TestDBusAccountPlugin *self,
return TRUE;
}
-static gboolean
-test_dbus_account_plugin_commit (const McpAccountStorage *storage,
- const McpAccountManager *am,
- const gchar *account_name)
-{
- TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage);
- GHashTableIter iter;
- gpointer k;
-
- DEBUG ("called");
-
- if (!self->active)
- return FALSE;
-
- if (account_name != NULL)
- return commit_one (self, account_name);
-
- g_dbus_connection_emit_signal (self->bus, NULL,
- TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE,
- "CommittingAll", NULL, NULL);
-
- g_hash_table_iter_init (&iter, self->accounts);
-
- while (g_hash_table_iter_next (&iter, &k, NULL))
- {
- if (!commit_one (self, k))
- {
- g_warning ("declined to commit account %s", (const gchar *) k);
- }
- }
-
- return TRUE;
-}
-
static void
test_dbus_account_plugin_get_identifier (const McpAccountStorage *storage,
const gchar *account_name,
@@ -1593,7 +1594,7 @@ account_storage_iface_init (McpAccountStorageIface *iface)
iface->list = test_dbus_account_plugin_list;
iface->ready = test_dbus_account_plugin_ready;
iface->delete = test_dbus_account_plugin_delete;
- iface->commit = test_dbus_account_plugin_commit;
+ iface->commit_one = test_dbus_account_plugin_commit_one;
iface->get_identifier = test_dbus_account_plugin_get_identifier;
iface->get_additional_info = test_dbus_account_plugin_get_additional_info;
iface->get_restrictions = test_dbus_account_plugin_get_restrictions;
diff --git a/tests/twisted/mcp-account-diversion.c b/tests/twisted/mcp-account-diversion.c
index c3fa55a0..9e8bb867 100644
--- a/tests/twisted/mcp-account-diversion.c
+++ b/tests/twisted/mcp-account-diversion.c
@@ -206,7 +206,7 @@ _delete (const McpAccountStorage *self,
static gboolean
-_commit (const McpAccountStorage *self,
+_commit_one (const McpAccountStorage *self,
const McpAccountManager *am,
const gchar *account_name)
{
@@ -221,7 +221,6 @@ _commit (const McpAccountStorage *self,
if (!_have_config ())
_create_config ();
- /* In this naïve implementation, we always commit all accounts together */
data = g_key_file_to_data (adp->keyfile, &n, NULL);
rval = g_file_set_contents (_conf_filename (), data, n, NULL);
adp->save = !rval;
@@ -268,7 +267,7 @@ account_storage_iface_init (McpAccountStorageIface *iface,
iface->get = _get;
iface->set = _set;
iface->delete = _delete;
- iface->commit = _commit;
+ iface->commit_one = _commit_one;
iface->list = _list;
}