summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rauwolf <rauwolf@itestra.de>2013-02-28 16:50:29 +0100
committerPhilip Rauwolf <rauwolf@itestra.de>2013-02-28 16:50:29 +0100
commitb554b2fa3cf080cee9dd4a80430a582f0253722f (patch)
tree1af3f533d41f5d3a3b4180af967a435cf22a8e52
parent9f8c113a0747eac072a45751ef962de0616bd450 (diff)
downloadgenivi-common-api-dbus-runtime-b554b2fa3cf080cee9dd4a80430a582f0253722f.tar.gz
Small adaptions in test-cases for new dependency-structure around
DBusConnection.
-rw-r--r--src/test/DBusDaemonProxyTest.cpp12
-rw-r--r--src/test/DBusProxyTest.cpp26
2 files changed, 12 insertions, 26 deletions
diff --git a/src/test/DBusDaemonProxyTest.cpp b/src/test/DBusDaemonProxyTest.cpp
index 7b115c9..c25098e 100644
--- a/src/test/DBusDaemonProxyTest.cpp
+++ b/src/test/DBusDaemonProxyTest.cpp
@@ -15,34 +15,22 @@
namespace {
-void dispatch(std::shared_ptr<CommonAPI::DBus::DBusConnection> dbusConnection) {
- while (dbusConnection->readWriteDispatch(10)) {}
-}
-
class DBusDaemonProxyTest: public ::testing::Test {
protected:
- std::thread* thread;
-
virtual void SetUp() {
dbusConnection_ = CommonAPI::DBus::DBusConnection::getSessionBus();
ASSERT_TRUE(dbusConnection_->connect());
- thread = new std::thread(dispatch, dbusConnection_);
- thread->detach();
dbusDaemonProxy_ = std::make_shared<CommonAPI::DBus::DBusDaemonProxy>(dbusConnection_);
- //readWriteDispatchCount_ = 0;
}
virtual void TearDown() {
- delete thread;
if (dbusConnection_ && dbusConnection_->isConnected()) {
- //dbusConnection_->disconnect();
}
}
std::shared_ptr<CommonAPI::DBus::DBusConnection> dbusConnection_;
std::shared_ptr<CommonAPI::DBus::DBusDaemonProxy> dbusDaemonProxy_;
- //size_t readWriteDispatchCount_;
};
TEST_F(DBusDaemonProxyTest, ListNames) {
diff --git a/src/test/DBusProxyTest.cpp b/src/test/DBusProxyTest.cpp
index 7a5f817..8386a52 100644
--- a/src/test/DBusProxyTest.cpp
+++ b/src/test/DBusProxyTest.cpp
@@ -39,9 +39,19 @@ static const std::string objectPath = "/CommonAPI/DBus/tests/DBusProxyTestServic
class ProxyTest: public ::testing::Test {
protected:
- virtual void TearDown() {
- proxyDBusConnection_->disconnect();
+ void SetUp() {
+ proxyDBusConnection_ = CommonAPI::DBus::DBusConnection::getSessionBus();
+ ASSERT_TRUE(proxyDBusConnection_->connect());
+ proxy_ = std::make_shared<commonapi::tests::TestInterfaceDBusProxy>(
+ commonApiAddress,
+ interfaceName,
+ busName,
+ objectPath,
+ proxyDBusConnection_);
+ }
+
+ virtual void TearDown() {
stubAdapter_.reset();
if (stubDBusConnection_) {
@@ -54,18 +64,6 @@ protected:
}
}
- void SetUp() {
- proxyDBusConnection_ = CommonAPI::DBus::DBusConnection::getSessionBus();
- ASSERT_TRUE(proxyDBusConnection_->connect());
-
- proxy_ = std::make_shared<commonapi::tests::TestInterfaceDBusProxy>(
- commonApiAddress,
- interfaceName,
- busName,
- objectPath,
- proxyDBusConnection_);
- }
-
void registerTestStub() {
stubDBusConnection_ = CommonAPI::DBus::DBusConnection::getSessionBus();
ASSERT_TRUE(stubDBusConnection_->connect());