aboutsummaryrefslogtreecommitdiff
path: root/tests/accounts-service-mock.h
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-11-06 09:48:22 -0600
committerTed Gould <ted@gould.cx>2014-11-06 09:48:22 -0600
commit36f7456285da6f55126396e004776b4da3290443 (patch)
tree8aaefbc4a32b514b97988c7c999b317685620b60 /tests/accounts-service-mock.h
parentf4e23c3e41558406a2b9bb724dc533bb217410da (diff)
downloadayatana-indicator-sound-36f7456285da6f55126396e004776b4da3290443.tar.gz
ayatana-indicator-sound-36f7456285da6f55126396e004776b4da3290443.tar.bz2
ayatana-indicator-sound-36f7456285da6f55126396e004776b4da3290443.zip
Adding in an accounts services mock
Diffstat (limited to 'tests/accounts-service-mock.h')
-rw-r--r--tests/accounts-service-mock.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/accounts-service-mock.h b/tests/accounts-service-mock.h
index d4dae7e..9507c5f 100644
--- a/tests/accounts-service-mock.h
+++ b/tests/accounts-service-mock.h
@@ -17,6 +17,7 @@
* Ted Gould <ted@canonical.com>
*/
+#include <memory>
#include <libdbustest/dbus-test.h>
class AccountsServiceMock
@@ -87,6 +88,12 @@ class AccountsServiceMock
g_clear_object(&mock);
}
+ operator std::shared_ptr<DbusTestTask> () {
+ return std::shared_ptr<DbusTestTask>(
+ DBUS_TEST_TASK(g_object_ref(mock)),
+ [](DbusTestTask * task) { g_clear_object(&task); });
+ }
+
operator DbusTestTask* () {
return DBUS_TEST_TASK(mock);
}