diff options
author | Jürgen Gehring <juergen.gehring@bmw.de> | 2015-06-01 07:57:07 -0700 |
---|---|---|
committer | Jürgen Gehring <juergen.gehring@bmw.de> | 2015-06-01 07:57:07 -0700 |
commit | 54982071a99484488207ad3bd5e9391a15bffe02 (patch) | |
tree | 479c178ee629947cf0df65fc0e38f986f6ccdbc9 /src/test/DBusRuntimeTest.cpp | |
parent | 45a6f65628a142bb8d37a3b72cb210b1f8c24a5f (diff) | |
download | genivi-common-api-dbus-runtime-54982071a99484488207ad3bd5e9391a15bffe02.tar.gz |
CommonAPI-D-Bus 3.1.13.1.1
Diffstat (limited to 'src/test/DBusRuntimeTest.cpp')
-rw-r--r-- | src/test/DBusRuntimeTest.cpp | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/src/test/DBusRuntimeTest.cpp b/src/test/DBusRuntimeTest.cpp index f2ea9b7..bcc99a6 100644 --- a/src/test/DBusRuntimeTest.cpp +++ b/src/test/DBusRuntimeTest.cpp @@ -1,16 +1,15 @@ -/* Copyright (C) 2013 BMW Group - * Author: Manfred Bathelt (manfred.bathelt@bmw.de) - * Author: Juergen Gehring (juergen.gehring@bmw.de) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// Copyright (C) 2013-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + #include <gtest/gtest.h> #include <cstring> -#include <CommonAPI/DBus/DBusRuntime.h> -#include <CommonAPI/DBus/DBusFactory.h> -#include <CommonAPI/DBus/DBusServicePublisher.h> +#include <CommonAPI/CommonAPI.hpp> + +//#include <CommonAPI/DBus/DBusFactory.hpp> class DBusRuntimeTest: public ::testing::Test { protected: @@ -23,49 +22,43 @@ class DBusRuntimeTest: public ::testing::Test { TEST_F(DBusRuntimeTest, LoadsDefaultStaticallyLinkedDBusLibrary) { - std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load(); + std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::get(); ASSERT_TRUE((bool)runtime); - CommonAPI::DBus::DBusRuntime* dbusRuntime = dynamic_cast<CommonAPI::DBus::DBusRuntime*>(&(*runtime)); - ASSERT_TRUE(dbusRuntime != NULL); } -TEST_F(DBusRuntimeTest, LoadsSpecifiedStaticallyLinkedDBusLibrary) { +/*TEST_F(DBusRuntimeTest, LoadsSpecifiedStaticallyLinkedDBusLibrary) { std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load("DBus"); ASSERT_TRUE((bool)runtime); - CommonAPI::DBus::DBusRuntime* dbusRuntime = dynamic_cast<CommonAPI::DBus::DBusRuntime*>(&(*runtime)); - ASSERT_TRUE(dbusRuntime != NULL); -} +}*/ -TEST_F(DBusRuntimeTest, LoadsDBusLibraryAsSingleton) { -#ifdef WIN32 +/*TEST_F(DBusRuntimeTest, LoadsDBusLibraryAsSingleton) { +#ifdef WIN32*/ /* access the middlewareInfo in order to get a call to DBusRuntime. This forces the windows linker not to remove DBusRuntime from resulting binary */ - ASSERT_TRUE(CommonAPI::DBus::DBusRuntime::middlewareInfo_.middlewareName_); +/* ASSERT_TRUE(CommonAPI::DBus::DBusRuntime::middlewareInfo_.middlewareName_); #endif - std::shared_ptr<CommonAPI::Runtime> runtime1 = CommonAPI::Runtime::load("DBus"); - std::shared_ptr<CommonAPI::Runtime> runtime2 = CommonAPI::Runtime::load("DBus"); + std::shared_ptr<CommonAPI::Runtime> runtime1 = CommonAPI::Runtime::get(); + std::shared_ptr<CommonAPI::Runtime> runtime2 = CommonAPI::Runtime::get(); ASSERT_TRUE((bool)runtime1); ASSERT_TRUE((bool)runtime2); - CommonAPI::DBus::DBusRuntime* dbusRuntime1 = dynamic_cast<CommonAPI::DBus::DBusRuntime*>(&(*runtime1)); - CommonAPI::DBus::DBusRuntime* dbusRuntime2 = dynamic_cast<CommonAPI::DBus::DBusRuntime*>(&(*runtime2)); ASSERT_TRUE(dbusRuntime1 != NULL); ASSERT_TRUE(dbusRuntime2 != NULL); ASSERT_TRUE(dbusRuntime1 == dbusRuntime2); -} +}*/ -TEST_F(DBusRuntimeTest, ReturnsEmptyPointerOnRequestForUnknownMiddleware) { +/*TEST_F(DBusRuntimeTest, ReturnsEmptyPointerOnRequestForUnknownMiddleware) { std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load("UnknownMiddlewareId"); ASSERT_FALSE((bool)runtime); -} +}*/ -TEST_F(DBusRuntimeTest, DBusRuntimeLoadsDBusFactory) { +/*TEST_F(DBusRuntimeTest, DBusRuntimeLoadsDBusFactory) { std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load("DBus"); ASSERT_TRUE((bool)runtime); CommonAPI::DBus::DBusRuntime* dbusRuntime = dynamic_cast<CommonAPI::DBus::DBusRuntime*>(&(*runtime)); @@ -75,10 +68,10 @@ TEST_F(DBusRuntimeTest, DBusRuntimeLoadsDBusFactory) { ASSERT_TRUE((bool)proxyFactory); CommonAPI::DBus::DBusFactory* dbusProxyFactory = dynamic_cast<CommonAPI::DBus::DBusFactory*>(&(*proxyFactory)); ASSERT_TRUE(dbusProxyFactory != NULL); -} +}*/ -TEST_F(DBusRuntimeTest, DBusRuntimeLoadsDBusServicePublisher) { +/*TEST_F(DBusRuntimeTest, DBusRuntimeLoadsDBusServicePublisher) { std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load("DBus"); ASSERT_TRUE((bool)runtime); CommonAPI::DBus::DBusRuntime* dbusRuntime = dynamic_cast<CommonAPI::DBus::DBusRuntime*>(&(*runtime)); @@ -88,9 +81,9 @@ TEST_F(DBusRuntimeTest, DBusRuntimeLoadsDBusServicePublisher) { ASSERT_TRUE((bool)servicePublisher); CommonAPI::DBus::DBusServicePublisher* dbusServicePublisher = dynamic_cast<CommonAPI::DBus::DBusServicePublisher*>(&(*servicePublisher)); ASSERT_TRUE(dbusServicePublisher != NULL); -} +}*/ -#ifndef WIN32 +#ifndef __NO_MAIN__ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); |