diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-12 15:37:36 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-12 15:37:36 +0000 |
commit | dd01f79b20f160fcffe2fd7acd7dffd71c368797 (patch) | |
tree | d1d1a2bc16b0c999f49baf6dae91ea0a825cb20d /tests | |
parent | 0a4e4a6f576fead8bc718a2d076911d8f5168cde (diff) | |
download | telepathy-mission-control-dd01f79b20f160fcffe2fd7acd7dffd71c368797.tar.gz |
Revert "Simplify a bit storage API"
This reverts commit 2da0807f7a4b6be29b980c95b888452f5a6ddc9b.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/dbus-account-plugin.c | 23 | ||||
-rw-r--r-- | tests/twisted/mcp-account-diversion.c | 7 |
2 files changed, 24 insertions, 6 deletions
diff --git a/tests/twisted/dbus-account-plugin.c b/tests/twisted/dbus-account-plugin.c index 063b886d..3cf29ca1 100644 --- a/tests/twisted/dbus-account-plugin.c +++ b/tests/twisted/dbus-account-plugin.c @@ -1370,8 +1370,9 @@ test_dbus_account_plugin_commit_one (const McpAccountStorage *storage, DEBUG ("%s", account_name); - if (account_name == NULL) - return test_dbus_account_plugin_commit (storage, am); + /* MC does not call @commit_one with parameter %NULL (meaning "all accounts") + * if we also implement commit(), which, as it happens, we do */ + g_return_val_if_fail (account_name != NULL, FALSE); if (!self->active || account == NULL) return FALSE; @@ -1579,6 +1580,22 @@ test_dbus_account_plugin_get_restrictions (const McpAccountStorage *storage, return account->restrictions; } +static gboolean +test_dbus_account_plugin_owns (McpAccountStorage *storage, + McpAccountManager *am, + const gchar *account_name) +{ + TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); + Account *account = lookup_account (self, account_name); + + DEBUG ("%s", account_name); + + if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) + return FALSE; + + return TRUE; +} + static void account_storage_iface_init (McpAccountStorageIface *iface) { @@ -1594,9 +1611,11 @@ 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; iface->create = test_dbus_account_plugin_create; + iface->owns = test_dbus_account_plugin_owns; } diff --git a/tests/twisted/mcp-account-diversion.c b/tests/twisted/mcp-account-diversion.c index 9e8bb867..923f51b4 100644 --- a/tests/twisted/mcp-account-diversion.c +++ b/tests/twisted/mcp-account-diversion.c @@ -206,9 +206,8 @@ _delete (const McpAccountStorage *self, static gboolean -_commit_one (const McpAccountStorage *self, - const McpAccountManager *am, - const gchar *account_name) +_commit (const McpAccountStorage *self, + const McpAccountManager *am) { gsize n; gchar *data; @@ -267,7 +266,7 @@ account_storage_iface_init (McpAccountStorageIface *iface, iface->get = _get; iface->set = _set; iface->delete = _delete; - iface->commit_one = _commit_one; + iface->commit = _commit; iface->list = _list; } |