diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-15 17:34:58 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-01-29 19:28:33 +0000 |
commit | e7ba5a86df4e90ec334a4c8ff9a11f9305458e00 (patch) | |
tree | 418aa72ca1197432fcfdac1c09673b4328086a5e /tests | |
parent | 9624c084d46660721aa0173e23103cd25165a5a5 (diff) |
mcp_account_storage_commit: guarantee that we commit one at a time
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/dbus-account-plugin.c | 33 | ||||
-rw-r--r-- | tests/twisted/mcp-account-diversion.c | 4 |
2 files changed, 3 insertions, 34 deletions
diff --git a/tests/twisted/dbus-account-plugin.c b/tests/twisted/dbus-account-plugin.c index c7c5dbde..2e66179e 100644 --- a/tests/twisted/dbus-account-plugin.c +++ b/tests/twisted/dbus-account-plugin.c @@ -1151,36 +1151,6 @@ test_dbus_account_plugin_set_parameter (McpAccountStorage *storage, return MCP_ACCOUNT_STORAGE_SET_RESULT_CHANGED; } -static gboolean -test_dbus_account_plugin_commit_all (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 (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, @@ -1331,9 +1301,6 @@ test_dbus_account_plugin_commit (const McpAccountStorage *storage, DEBUG ("%s", account_name); - if (account_name == NULL) - return test_dbus_account_plugin_commit_all (storage, am); - account = lookup_account (self, account_name); g_return_val_if_fail (self->active, FALSE); diff --git a/tests/twisted/mcp-account-diversion.c b/tests/twisted/mcp-account-diversion.c index bcb8930c..02775b4c 100644 --- a/tests/twisted/mcp-account-diversion.c +++ b/tests/twisted/mcp-account-diversion.c @@ -302,7 +302,9 @@ _commit (const McpAccountStorage *self, gboolean rval = FALSE; /* This simple implementation ignores account_name and commits everything: - * we're writing out the whole keyfile anyway */ + * we're writing out the whole keyfile anyway. If MC is looping over + * accounts, the second and subsequent accounts will find that + * adp->save is false, so there's no write-amplification. */ if (!adp->save) return TRUE; |