diff options
| author | Ted Gould <ted@gould.cx> | 2016-07-20 17:55:32 +0200 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2016-07-20 17:55:32 +0200 |
| commit | d6450929f648572bec5dbfbb334f5325e64d3938 (patch) | |
| tree | 9810414b751e8173cdba39d8bb1bbd3f3e8ed487 /unity-shared | |
| parent | 0794e1e677ab54bd46c6e64cd6c2f34d11c74971 (diff) | |
Setup a test for the systemd wrapper
(bzr r4153.9.8)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/SystemdWrapper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/unity-shared/SystemdWrapper.cpp b/unity-shared/SystemdWrapper.cpp index 2daaf4881..c6622937c 100644 --- a/unity-shared/SystemdWrapper.cpp +++ b/unity-shared/SystemdWrapper.cpp @@ -31,7 +31,7 @@ namespace unity class SystemdWrapper::Impl { public: - Impl(); + Impl(bool test); void Start(std::string const& name); void Stop(std::string const& name); @@ -40,10 +40,10 @@ private: glib::DBusProxy::Ptr systemd_proxy_; }; -SystemdWrapper::Impl::Impl() +SystemdWrapper::Impl::Impl(bool test) { std::string busname = "org.freedesktop.systemd1"; - if (g_getenv("UNITY_TEST_SYSTEMD)")) { + if (test) { busname = "com.canonical.Unity.Test.Systemd"; } @@ -65,11 +65,11 @@ void SystemdWrapper::Impl::Stop(std::string const& name) // SystemdWrapper::SystemdWrapper() - : pimpl_(new Impl) + : pimpl_(new Impl(false)) {} SystemdWrapper::SystemdWrapper(SystemdWrapper::TestMode const& tm) - : pimpl_(new Impl) + : pimpl_(new Impl(true)) {} SystemdWrapper::~SystemdWrapper() |
