summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/test
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2011-12-22 17:27:16 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2011-12-23 01:36:59 +0100
commit4f74d6e303c58326fe75ee75e1c92cf9263f800d (patch)
treeda2c725f7cbad20e35169476b801066689a382a2 /AudioManagerDaemon/test
parent4618280b6d777ac7bf3bb5cf5b0ea3f0d9e4b2b7 (diff)
downloadaudiomanager-4f74d6e303c58326fe75ee75e1c92cf9263f800d.tar.gz
* rework of buildsystem
* now everything depends on a toplevel CMakefile * cleanup of makefiles and compiler options
Diffstat (limited to 'AudioManagerDaemon/test')
-rw-r--r--AudioManagerDaemon/test/CMakeLists.txt5
-rw-r--r--AudioManagerDaemon/test/controlInterface/CMakeLists.txt11
-rw-r--r--AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp5
-rw-r--r--AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h2
-rw-r--r--AudioManagerDaemon/test/database/CMakeLists.txt10
-rw-r--r--AudioManagerDaemon/test/routingInterface/CMakeLists.txt9
-rw-r--r--AudioManagerDaemon/test/sockethandler/CMakeLists.txt2
-rw-r--r--AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp8
-rw-r--r--AudioManagerDaemon/test/sockethandler/sockethandlerTest.h4
9 files changed, 20 insertions, 36 deletions
diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt
index 3ee415a..7f8c054 100644
--- a/AudioManagerDaemon/test/CMakeLists.txt
+++ b/AudioManagerDaemon/test/CMakeLists.txt
@@ -12,7 +12,10 @@
cmake_minimum_required(VERSION 2.6)
+set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH})
+FIND_PACKAGE(GTest REQUIRED)
+
add_subdirectory (database)
add_subdirectory (routingInterface)
add_subdirectory (controlInterface)
-#add_subdirectory (sockethandler) \ No newline at end of file
+#add_subdirectory (sockethandler)
diff --git a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt
index 8ac7cd1..6e0acad 100644
--- a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt
+++ b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt
@@ -25,16 +25,8 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(controlInterfacetest)
-#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-set(STD_INCLUDE_DIRS "/usr/include")
-set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces)
-set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes)
-set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes)
-set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include)
-set(EXECUTABLE_OUTPUT_PATH ../../../../test/)
-
FIND_PACKAGE(PkgConfig)
pkg_check_modules(SQLITE REQUIRED sqlite3)
pkg_check_modules(DLT REQUIRED automotive-dlt)
@@ -48,6 +40,7 @@ INCLUDE_DIRECTORIES(
${STD_INCLUDE_DIRS}
${DLT_INCLUDE_DIRS}
${DBUS_INCLUDE_DIR}
+ ${GTEST_INCLUDE_DIR}
${INCLUDES_FOLDER}
)
@@ -70,7 +63,7 @@ TARGET_LINK_LIBRARIES(controlInterfaceTest
${DLT_LIBRARIES}
${DBUS_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
- gtest
+ ${GTEST_LIBRARIES}
gmock
)
diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
index c59ac06..2efcc64 100644
--- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
@@ -34,7 +34,8 @@ using namespace testing;
DLT_DECLARE_CONTEXT(DLT_CONTEXT)
controlInterfaceTest::controlInterfaceTest()
- :plistCommandPluginDirs(),
+ :pDBusWrapper((DBusWrapper*)1), //to get rid of assert
+ plistCommandPluginDirs(),
plistRoutingPluginDirs(),
pDatabaseHandler(std::string(":memory:")),
pRoutingSender(plistRoutingPluginDirs),
@@ -47,7 +48,7 @@ controlInterfaceTest::controlInterfaceTest()
pControlInterfaceBackdoor(),
pDatabaseObserver(&pCommandSender,&pRoutingSender),
pControlReceiver(&pDatabaseHandler,&pRoutingSender,&pCommandSender),
- pRoutingReceiver(&pDatabaseHandler,&pRoutingSender,&pControlSender)
+ pRoutingReceiver(&pDatabaseHandler,&pRoutingSender,&pControlSender,pDBusWrapper)
{
pDatabaseHandler.registerObserver(&pDatabaseObserver);
pControlInterfaceBackdoor.replaceController(&pControlSender,&pMockControlInterface);
diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
index a3a2a50..5b1bd99 100644
--- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
+++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
@@ -27,6 +27,7 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
+#include <dbus/DBusWrapper.h>
#include <dlt/dlt.h>
#include "MockInterfaces.h"
#include "DatabaseHandler.h"
@@ -47,6 +48,7 @@ class controlInterfaceTest : public ::testing::Test{
public:
controlInterfaceTest();
~controlInterfaceTest();
+ DBusWrapper* pDBusWrapper;
std::vector<std::string> plistCommandPluginDirs;
std::vector<std::string> plistRoutingPluginDirs;
DatabaseHandler pDatabaseHandler;
diff --git a/AudioManagerDaemon/test/database/CMakeLists.txt b/AudioManagerDaemon/test/database/CMakeLists.txt
index 59c40e8..1f368aa 100644
--- a/AudioManagerDaemon/test/database/CMakeLists.txt
+++ b/AudioManagerDaemon/test/database/CMakeLists.txt
@@ -25,16 +25,8 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(datbaseTest)
-#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-set(STD_INCLUDE_DIRS "/usr/include")
-set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces)
-set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes)
-set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes)
-set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include)
-set(EXECUTABLE_OUTPUT_PATH ../../../../test/)
-
FIND_PACKAGE(PkgConfig)
pkg_check_modules(SQLITE REQUIRED sqlite3)
pkg_check_modules(DLT REQUIRED automotive-dlt)
@@ -68,6 +60,6 @@ TARGET_LINK_LIBRARIES( databasetest
${DLT_LIBRARIES}
${DBUS_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
- gtest
+ ${GTEST_LIBRARIES}
gmock
) \ No newline at end of file
diff --git a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt
index 654c726..292065b 100644
--- a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt
+++ b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt
@@ -28,13 +28,6 @@ PROJECT(routingInterfaceTest)
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
-set(STD_INCLUDE_DIRS "/usr/include")
-set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces)
-set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes)
-set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes)
-set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include)
-set(EXECUTABLE_OUTPUT_PATH ../../../../test/)
-
FIND_PACKAGE(PkgConfig)
pkg_check_modules(SQLITE REQUIRED sqlite3)
pkg_check_modules(DLT REQUIRED automotive-dlt)
@@ -68,7 +61,7 @@ TARGET_LINK_LIBRARIES(routinginterfacetest
${DLT_LIBRARIES}
${DBUS_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
- gtest
+ ${GTEST_LIBRARIES}
gmock
)
diff --git a/AudioManagerDaemon/test/sockethandler/CMakeLists.txt b/AudioManagerDaemon/test/sockethandler/CMakeLists.txt
index a7dd63d..787b120 100644
--- a/AudioManagerDaemon/test/sockethandler/CMakeLists.txt
+++ b/AudioManagerDaemon/test/sockethandler/CMakeLists.txt
@@ -33,7 +33,7 @@ set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces)
set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes)
set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes)
set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include)
-set(EXECUTABLE_OUTPUT_PATH ../../../../test/)
+
FIND_PACKAGE(PkgConfig)
pkg_check_modules(DLT REQUIRED automotive-dlt)
diff --git a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
index c9c17cb..bb72324 100644
--- a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
+++ b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp
@@ -25,13 +25,13 @@ sockethandlerTest::~sockethandlerTest()
{
}
-void fdCallBack::connectSocket(int fd, const short events,void * userData)
+void fdCallBack::connectSocket(int fd, const int16_t events,void * userData)
{
std::cout<<"Socket connection received and open"<<std::endl;
//accept the connection
mSocketConnection = accept(fd, NULL, NULL);
- short event = 0;
+ int16_t event = 0;
event |=POLLIN;
shPollCallBack* buf=&pSocketDataCallback;
@@ -52,7 +52,7 @@ fdCallBack::fdCallBack(SocketHandler *SocketHandler)
-void am::fdCallBack::handleSocketData(int fd, const short events, void* userdata)
+void am::fdCallBack::handleSocketData(int fd, const int16_t events, void* userdata)
{
char buffer[3000];
std::string msg;
@@ -148,7 +148,7 @@ void* playWithSocketServer(void* data)
listen(socketHandle, 3);
//prepare the event (we want POLLIN because we need to listen)
- short event = 0;
+ int16_t event = 0;
event |=POLLIN;
shPollCallBack* buf=&testCallback.pSocketConnectionCallback;
diff --git a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h
index 81ded2a..85e2dca 100644
--- a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h
+++ b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h
@@ -18,8 +18,8 @@ class fdCallBack
public:
fdCallBack(SocketHandler *SocketHandler);
virtual ~fdCallBack();
- void connectSocket(int fd,const short events,void * userData);
- void handleSocketData(int fd,const short events,void * userData);
+ void connectSocket(int fd,const int16_t events,void * userData);
+ void handleSocketData(int fd,const int16_t events,void * userData);
TSpecificPollCallback<fdCallBack> pSocketDataCallback;
TSpecificPollCallback<fdCallBack> pSocketConnectionCallback;
private: