Add SdBus interface to proper namespace

This commit is contained in:
sangelovic
2019-03-20 18:52:05 +01:00
parent 41a10d644f
commit bb2bf5811b
7 changed files with 45 additions and 33 deletions
@@ -57,20 +57,20 @@ class AdaptorAndProxyFixture : public ::testing::Test
public:
static void SetUpTestCase()
{
m_connection.requestName(INTERFACE_NAME);
m_connection.enterProcessingLoopAsync();
s_connection->requestName(INTERFACE_NAME);
s_connection->enterProcessingLoopAsync();
}
static void TearDownTestCase()
{
m_connection.leaveProcessingLoop();
m_connection.releaseName(INTERFACE_NAME);
s_connection->leaveProcessingLoop();
s_connection->releaseName(INTERFACE_NAME);
}
private:
void SetUp() override
{
m_adaptor = std::make_unique<TestingAdaptor>(m_connection);
m_adaptor = std::make_unique<TestingAdaptor>(*s_connection);
m_proxy = std::make_unique<TestingProxy>(INTERFACE_NAME, OBJECT_PATH);
std::this_thread::sleep_for(50ms); // Give time for the proxy to start listening to signals
}
@@ -82,14 +82,13 @@ private:
}
public:
static sdbus::internal::Connection m_connection;
static std::unique_ptr<sdbus::IConnection> s_connection;
std::unique_ptr<TestingAdaptor> m_adaptor;
std::unique_ptr<TestingProxy> m_proxy;
};
sdbus::internal::Connection AdaptorAndProxyFixture::m_connection{sdbus::internal::Connection::BusType::eSystem,
std::make_unique<SdBus>()};
std::unique_ptr<sdbus::IConnection> AdaptorAndProxyFixture::s_connection = sdbus::createSystemBusConnection();
}