From ad7b1f5816c6a3bdf2590d52a383f7aa0c52f275 Mon Sep 17 00:00:00 2001 From: christian mueller Date: Mon, 20 Feb 2012 16:20:34 +0100 Subject: * [GT-1835] Resolve issues identified by code screening process: added missing headers, added text version of LGPL v2.1 --- AudioManagerDaemon/test/CMakeLists.txt | 32 +++++++++++++++------- .../test/sockethandler/sockethandlerTest.cpp | 26 +++++++++++++++--- .../test/sockethandler/sockethandlerTest.h | 26 +++++++++++++++--- 3 files changed, 66 insertions(+), 18 deletions(-) (limited to 'AudioManagerDaemon/test') diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt index 372423c..9401318 100644 --- a/AudioManagerDaemon/test/CMakeLists.txt +++ b/AudioManagerDaemon/test/CMakeLists.txt @@ -1,13 +1,25 @@ - # - # Copyright (C) 2011, BMW AG - # - # AudioManagerDeamon Test - # - # @file CMakeLists.txt - # - # @date: 20.05.2011 - # @author: Christian Müller (christian.ei.mueller@bmw.de) - # +#GENIVI AUDIOMANAGER +# +#Copyright (C) 2011, BMW AG +# +#Datum 20.2.2012 +#author Christian Mueller (christian.ei.mueller@bmw.de) +# +#*********************************************************************************************************** +#LICENSE +#*********************************************************************************************************** +# +#GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause) +#Copyright (C) 2011, BMW AG – Christian Mueller Christian.ei.mueller@bmw.de +# +#This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation. +#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details. +#You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see . +#Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense. +#Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception. +#As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned. +#Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. +# cmake_minimum_required(VERSION 2.6) diff --git a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp index 1f1abea..91eee2c 100644 --- a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp +++ b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp @@ -1,8 +1,26 @@ -/* - * sockethandlerTest.cpp +/** + * Copyright (C) 2011, BMW AG * - * Created on: Dec 19, 2011 - * Author: christian + * GeniviAudioMananger AudioManagerDaemon + * + * \file sockethandlerTest.cpp + * + * \date 20-Oct-2011 3:42:04 PM + * \author Christian Mueller (christian.ei.mueller@bmw.de) + * + * \section License + * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause) + * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation. + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details. + * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see . + * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense. + * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception. + * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned. + * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. + * + * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN */ #include "sockethandlerTest.h" diff --git a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h index faf604b..d2d1bc6 100644 --- a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h +++ b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.h @@ -1,8 +1,26 @@ -/* - * sockethandlerTest.h +/** + * Copyright (C) 2011, BMW AG * - * Created on: Dec 19, 2011 - * Author: christian + * GeniviAudioMananger AudioManagerDaemon + * + * \file sockethandlerTest.h + * + * \date 20-Oct-2011 3:42:04 PM + * \author Christian Mueller (christian.ei.mueller@bmw.de) + * + * \section License + * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause) + * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation. + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details. + * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see . + * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense. + * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception. + * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned. + * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. + * + * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN */ #ifndef SOCKETHANDLERTEST_H_ -- cgit v1.2.1 From 906f202f7663e6c372c192d3bd7015d32a0fbc34 Mon Sep 17 00:00:00 2001 From: christian mueller Date: Tue, 21 Feb 2012 10:46:12 +0100 Subject: * [GAM-12] Change project types as discussed in the F2F: changed in all tests, updated audiomanagertypes.h and projecttypes.h * change towards the versioning scheme of the audiomanager in CMakelists.txt --- AudioManagerDaemon/test/CommonFunctions.cpp | 18 +-- .../test/controlInterface/controlInterfaceTest.cpp | 34 ++--- AudioManagerDaemon/test/database/databaseTest.cpp | 66 ++++----- AudioManagerDaemon/test/routing/routingTest.cpp | 164 ++++++++++----------- .../test/routingInterface/routingInterfaceTest.cpp | 28 ++-- 5 files changed, 155 insertions(+), 155 deletions(-) (limited to 'AudioManagerDaemon/test') diff --git a/AudioManagerDaemon/test/CommonFunctions.cpp b/AudioManagerDaemon/test/CommonFunctions.cpp index 10245d7..101548c 100644 --- a/AudioManagerDaemon/test/CommonFunctions.cpp +++ b/AudioManagerDaemon/test/CommonFunctions.cpp @@ -199,8 +199,8 @@ bool CommonFunctions::compareRoute(am_Route_s a, am_Route_s b) std::vector CommonFunctions::getStandardConnectionFormatList() { std::vector list; - list.push_back(CF_ANALOG); - list.push_back(CF_STEREO); + list.push_back(CF_GENIVI_ANALOG); + list.push_back(CF_GENIVI_STEREO); return list; } @@ -208,10 +208,10 @@ std::vector CommonFunctions::getStandardSoundPropertyList() { std::vector soundPropertyList; am_SoundProperty_s soundProperty; - soundProperty.type = SP_BASS; + soundProperty.type = SP_EXAMPLE_BASS; soundProperty.value = 23; soundPropertyList.push_back(soundProperty); - soundProperty.type = SP_MID; + soundProperty.type = SP_EXAMPLE_MID; soundProperty.value = 2; soundPropertyList.push_back(soundProperty); return soundPropertyList; @@ -221,10 +221,10 @@ std::vector CommonFunctions::getStandardMainSoundPropert { std::vector mainSoundPropertyList; am_MainSoundProperty_s mainSoundProperty; - mainSoundProperty.type = MSP_NAVIGATION_OFFSET; + mainSoundProperty.type = MSP_UNKNOWN; mainSoundProperty.value = 23; mainSoundPropertyList.push_back(mainSoundProperty); - mainSoundProperty.type = MSP_TEST; + mainSoundProperty.type = MSP_UNKNOWN; mainSoundProperty.value = 3; mainSoundPropertyList.push_back(mainSoundProperty); return mainSoundPropertyList; @@ -235,7 +235,7 @@ void CommonFunctions::createSink(am_Sink_s& sink) const sink.name = "AnySink"; sink.domainID = 4; sink.available.availability = A_AVAILABLE; - sink.available.availabilityReason = AR_NEWMEDIA; + sink.available.availabilityReason = AR_GENIVI_NEWMEDIA; sink.sinkClassID = 1; sink.listConnectionFormats = getStandardConnectionFormatList(); sink.listSoundProperties = getStandardSoundPropertyList(); @@ -252,7 +252,7 @@ void CommonFunctions::createSource(am_Source_s& source) const source.name = "AnySource"; source.domainID = 4; source.available.availability = A_AVAILABLE; - source.available.availabilityReason = AR_NEWMEDIA; + source.available.availabilityReason = AR_GENIVI_NEWMEDIA; source.sourceClassID = 1; source.listConnectionFormats = getStandardConnectionFormatList(); source.listSoundProperties = getStandardSoundPropertyList(); @@ -297,7 +297,7 @@ void CommonFunctions::createConnection(am_Connection_s & connection) const connection.sinkID = 1; connection.sourceID = 2; connection.delay = -1; - connection.connectionFormat = CF_ANALOG; + connection.connectionFormat = CF_GENIVI_ANALOG; } std::vector CommonFunctions::getStandardConvertionMatrix() diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp index 599d15f..c479004 100644 --- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp +++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp @@ -176,8 +176,8 @@ TEST_F(controlInterfaceTest,ackConnect) ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); //when asyncConnect is called, we expect a call on the routingInterface - EXPECT_CALL(pMockRoutingInterface,asyncConnect(_,1,2,2,CF_STEREO)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_STEREO,2,2)); + EXPECT_CALL(pMockRoutingInterface,asyncConnect(_,1,2,2,CF_GENIVI_STEREO)).WillOnce(Return(E_OK)); + ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_STEREO,2,2)); //The handle should have the correct type ASSERT_EQ(handle.handleType, H_CONNECT); @@ -206,7 +206,7 @@ TEST_F(controlInterfaceTest,ackConnect) ASSERT_TRUE(!connectionList.empty()); //no we try the same, but do expect a no_change answer directly and no call because connection already exists - ASSERT_EQ(E_ALREADY_EXISTS, pControlReceiver.connect(handle,connectionID,CF_STEREO,2,2)); + ASSERT_EQ(E_ALREADY_EXISTS, pControlReceiver.connect(handle,connectionID,CF_GENIVI_STEREO,2,2)); } TEST_F(controlInterfaceTest,ackDisconnect) @@ -231,8 +231,8 @@ TEST_F(controlInterfaceTest,ackDisconnect) ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); //now we first need to connect, we expect a call on the routing interface - EXPECT_CALL(pMockRoutingInterface,asyncConnect(_,1,2,2,CF_STEREO)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_STEREO,2,2)); + EXPECT_CALL(pMockRoutingInterface,asyncConnect(_,1,2,2,CF_GENIVI_STEREO)).WillOnce(Return(E_OK)); + ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_STEREO,2,2)); //answer with an ack to insert the connection in the database EXPECT_CALL(pMockControlInterface,cbAckConnect(_,E_OK)).Times(1); @@ -334,8 +334,8 @@ TEST_F(controlInterfaceTest,SetSinkVolumeChange) ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); //set the volume and expect a call on the routing interface - EXPECT_CALL(pMockRoutingInterface,asyncSetSinkVolume(_,2,11,RAMP_DIRECT,23)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.setSinkVolume(handle,sinkID,11,RAMP_DIRECT,23)); + EXPECT_CALL(pMockRoutingInterface,asyncSetSinkVolume(_,2,11,RAMP_GENIVI_DIRECT,23)).WillOnce(Return(E_OK)); + ASSERT_EQ(E_OK, pControlReceiver.setSinkVolume(handle,sinkID,11,RAMP_GENIVI_DIRECT,23)); //check the list of handles. The handle must be in there and have the right type ASSERT_EQ(E_OK, pControlReceiver.getListHandles(handlesList)); @@ -359,7 +359,7 @@ TEST_F(controlInterfaceTest,SetSinkVolumeChange) ASSERT_TRUE(handlesList.empty()); //Now we try again, but the value is unchanged - ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSinkVolume(handle,sinkID,11,RAMP_DIRECT,23)); + ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSinkVolume(handle,sinkID,11,RAMP_GENIVI_DIRECT,23)); } TEST_F(controlInterfaceTest,ackSetSourceVolumeChange) @@ -384,8 +384,8 @@ TEST_F(controlInterfaceTest,ackSetSourceVolumeChange) ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); //change the sinkVolume, expect a call on the routingInterface - EXPECT_CALL(pMockRoutingInterface,asyncSetSourceVolume(_,2,11,RAMP_DIRECT,23)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.setSourceVolume(handle,source.sourceID,11,RAMP_DIRECT,23)); + EXPECT_CALL(pMockRoutingInterface,asyncSetSourceVolume(_,2,11,RAMP_GENIVI_DIRECT,23)).WillOnce(Return(E_OK)); + ASSERT_EQ(E_OK, pControlReceiver.setSourceVolume(handle,source.sourceID,11,RAMP_GENIVI_DIRECT,23)); //check the list of handles. The handle must be in there and have the right type ASSERT_EQ(E_OK, pControlReceiver.getListHandles(handlesList)); @@ -409,7 +409,7 @@ TEST_F(controlInterfaceTest,ackSetSourceVolumeChange) ASSERT_TRUE(handlesList.empty()); //Now we try again, but the value is unchanged - ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSourceVolume(handle,source.sourceID,11,RAMP_DIRECT,23)); + ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSourceVolume(handle,source.sourceID,11,RAMP_GENIVI_DIRECT,23)); } TEST_F(controlInterfaceTest,ackSetSinkSoundProperty) @@ -428,7 +428,7 @@ TEST_F(controlInterfaceTest,ackSetSinkSoundProperty) domain.busname = "mock"; sink.sinkID = 2; sink.domainID = 1; - soundProperty.type = SP_BASS; + soundProperty.type = SP_EXAMPLE_BASS; soundProperty.value = 244; //setup environment, we need a domain and a sink @@ -445,7 +445,7 @@ TEST_F(controlInterfaceTest,ackSetSinkSoundProperty) ASSERT_EQ(handlesList[0].handleType, H_SETSINKSOUNDPROPERTY); //read out this property. There is no change, because the ack did not arrive yet. - ASSERT_EQ(E_OK, pDatabaseHandler.getSinkSoundPropertyValue(2,SP_BASS,oldvalue)); + ASSERT_EQ(E_OK, pDatabaseHandler.getSinkSoundPropertyValue(2,SP_EXAMPLE_BASS,oldvalue)); ASSERT_EQ(sink.listSoundProperties[0].value, oldvalue); //lets send the answer and expect a call on the controlInterface @@ -453,7 +453,7 @@ TEST_F(controlInterfaceTest,ackSetSinkSoundProperty) pRoutingReceiver.ackSetSinkSoundProperty(handle, E_OK); //finally, the new value must be in the database - ASSERT_EQ(E_OK, pDatabaseHandler.getSinkSoundPropertyValue(sinkID,SP_BASS,oldvalue)); + ASSERT_EQ(E_OK, pDatabaseHandler.getSinkSoundPropertyValue(sinkID,SP_EXAMPLE_BASS,oldvalue)); ASSERT_EQ(soundProperty.value, oldvalue); //and the handle must be destroyed @@ -480,7 +480,7 @@ TEST_F(controlInterfaceTest,ackSetSourceSoundProperty) domain.busname = "mock"; source.sourceID = 2; source.domainID = 1; - soundProperty.type = SP_BASS; + soundProperty.type = SP_EXAMPLE_BASS; soundProperty.value = 244; //prepare the scene @@ -497,7 +497,7 @@ TEST_F(controlInterfaceTest,ackSetSourceSoundProperty) ASSERT_EQ(handlesList[0].handleType, H_SETSOURCESOUNDPROPERTY); //read out this property. There is no change, because the ack did not arrive yet. - ASSERT_EQ(E_OK, pDatabaseHandler.getSourceSoundPropertyValue(2,SP_BASS,oldvalue)); + ASSERT_EQ(E_OK, pDatabaseHandler.getSourceSoundPropertyValue(2,SP_EXAMPLE_BASS,oldvalue)); ASSERT_EQ(source.listSoundProperties[0].value, oldvalue); //lets send the answer and expect a call on the controlInterface @@ -505,7 +505,7 @@ TEST_F(controlInterfaceTest,ackSetSourceSoundProperty) pRoutingReceiver.ackSetSourceSoundProperty(handle, E_OK); //finally, the new value must be in the database - ASSERT_EQ(E_OK, pDatabaseHandler.getSourceSoundPropertyValue(sourceID,SP_BASS,oldvalue)); + ASSERT_EQ(E_OK, pDatabaseHandler.getSourceSoundPropertyValue(sourceID,SP_EXAMPLE_BASS,oldvalue)); ASSERT_EQ(soundProperty.value, oldvalue); //and the handle must be destroyed diff --git a/AudioManagerDaemon/test/database/databaseTest.cpp b/AudioManagerDaemon/test/database/databaseTest.cpp index caaac76..b31fd48 100644 --- a/AudioManagerDaemon/test/database/databaseTest.cpp +++ b/AudioManagerDaemon/test/database/databaseTest.cpp @@ -96,7 +96,7 @@ void databasetest::createMainConnectionSetup() connection.sinkID = i; connection.sourceID = i; connection.delay = -1; - connection.connectionFormat = CF_ANALOG; + connection.connectionFormat = CF_GENIVI_ANALOG; connection.connectionID = 0; ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink)); @@ -176,7 +176,7 @@ TEST_F(databasetest,getMainConnectionInfo) connection.sinkID = i; connection.sourceID = i; connection.delay = -1; - connection.connectionFormat = CF_ANALOG; + connection.connectionFormat = CF_GENIVI_ANALOG; connection.connectionID = 0; ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink)); @@ -356,7 +356,7 @@ TEST_F(databasetest, peekSourceID) am_sourceClass_t sourceClassID, peekID; am_SourceClass_s sourceClass; am_ClassProperty_s classProperty; - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 13; sourceClass.name = sourceName; sourceClass.sourceClassID = 0; @@ -380,7 +380,7 @@ TEST_F(databasetest, peekSinkID) am_sinkClass_t sinkClassID, peekID; am_SinkClass_s sinkClass; am_ClassProperty_s classProperty; - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 13; sinkClass.name = sinkName; sinkClass.sinkClassID = 0; @@ -423,7 +423,7 @@ TEST_F(databasetest,crossfaders) crossfader.sinkID_B = sinkBID; crossfader.sourceID = sourceID; crossfader.name = "Crossfader"; - crossfader.hotSink = HS_MIN; + crossfader.hotSink = HS_UNKNOWN; std::vector listCrossfaders; @@ -470,7 +470,7 @@ TEST_F(databasetest,crossfadersGetFromDomain) crossfader.sinkID_B = sinkBID; crossfader.sourceID = sourceID; crossfader.name = "Crossfader"; - crossfader.hotSink = HS_MIN; + crossfader.hotSink = HS_UNKNOWN; std::vector listCrossfaders; @@ -712,10 +712,10 @@ TEST_F(databasetest,getSinkClassOfSink) am_sinkClass_t sinkClassID; am_Sink_s sink; am_sinkID_t sinkID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sinkClass.name = "test"; @@ -750,10 +750,10 @@ TEST_F(databasetest,getSourceClassOfSource) am_sourceClass_t sourceClassID; am_Source_s source; am_sourceID_t sourceID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sourceClass.name = "test"; @@ -782,10 +782,10 @@ TEST_F(databasetest,removeSourceClass) am_SourceClass_s sourceClass; am_ClassProperty_s classProperty; am_sourceClass_t sourceClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sourceClass.name = "test"; @@ -810,10 +810,10 @@ TEST_F(databasetest,updateSourceClass) am_SourceClass_s sourceClass, changedClass; am_ClassProperty_s classProperty; am_sourceClass_t sourceClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sourceClass.name = "test"; @@ -843,10 +843,10 @@ TEST_F(databasetest,enterSourceClass) am_SourceClass_s sourceClass; am_ClassProperty_s classProperty; am_sourceClass_t sourceClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sourceClass.name = "test"; @@ -868,10 +868,10 @@ TEST_F(databasetest,enterSourceClassStatic) am_SourceClass_s sourceClass; am_ClassProperty_s classProperty; am_sourceClass_t sourceClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sourceClass.name = "test"; @@ -893,10 +893,10 @@ TEST_F(databasetest,removeSinkClass) am_SinkClass_s sinkClass; am_ClassProperty_s classProperty; am_sinkClass_t sinkClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sinkClass.name = "test"; @@ -921,10 +921,10 @@ TEST_F(databasetest,updateSinkClass) am_SinkClass_s sinkClass, changedClass; am_ClassProperty_s classProperty; am_sinkClass_t sinkClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sinkClass.name = "test"; @@ -954,10 +954,10 @@ TEST_F(databasetest,enterSinkClass) am_SinkClass_s sinkClass; am_ClassProperty_s classProperty; am_sinkClass_t sinkClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sinkClass.name = "test"; @@ -979,10 +979,10 @@ TEST_F(databasetest,enterSinkClassStatic) am_SinkClass_s sinkClass; am_ClassProperty_s classProperty; am_sinkClass_t sinkClassID; - classProperty.classProperty = CP_SINK_TYPE; + classProperty.classProperty = CP_GENIVI_SINK_TYPE; classProperty.value = 1; classPropertyList.push_back(classProperty); - classProperty.classProperty = CP_SOURCE_TYPE; + classProperty.classProperty = CP_GENIVI_SOURCE_TYPE; classProperty.value = 4; classPropertyList.push_back(classProperty); sinkClass.name = "test"; @@ -1002,7 +1002,7 @@ TEST_F(databasetest, changeSystemProperty) std::vector listSystemProperties, listReturn; am_SystemProperty_s systemProperty; - systemProperty.type = SYP_TEST; + systemProperty.type = SYP_UNKNOWN; systemProperty.value = 33; listSystemProperties.push_back(systemProperty); EXPECT_CALL(pMockInterface,cbSystemPropertyChanged(_)).Times(1); //todo: check the exact value here @@ -1019,7 +1019,7 @@ TEST_F(databasetest, systemProperties) std::vector listSystemProperties, listReturn; am_SystemProperty_s systemProperty; - systemProperty.type = SYP_TEST; + systemProperty.type = SYP_UNKNOWN; systemProperty.value = 33; listSystemProperties.push_back(systemProperty); @@ -1096,7 +1096,7 @@ TEST_F(databasetest, changeSourceMainSoundProperty) am_sourceID_t sourceID; pCF.createSource(source); am_MainSoundProperty_s property; - property.type = MSP_NAVIGATION_OFFSET; + property.type = MSP_UNKNOWN; property.value = 33; EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(1); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); @@ -1137,7 +1137,7 @@ TEST_F(databasetest, changeSinkMainSoundProperty) am_sinkID_t sinkID; pCF.createSink(sink); am_MainSoundProperty_s property; - property.type = MSP_NAVIGATION_OFFSET; + property.type = MSP_UNKNOWN; property.value = 33; EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(1); @@ -1220,7 +1220,7 @@ TEST_F(databasetest, changeSinkAvailability) pCF.createSink(sink); am_Availability_s availability; availability.availability = A_UNKNOWN; - availability.availabilityReason = AR_TEMPERATURE; + availability.availabilityReason = AR_GENIVI_TEMPERATURE; EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(1); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); @@ -1238,7 +1238,7 @@ TEST_F(databasetest, changeSourceAvailability) pCF.createSource(source); am_Availability_s availability; availability.availability = A_UNKNOWN; - availability.availabilityReason = AR_TEMPERATURE; + availability.availabilityReason = AR_GENIVI_TEMPERATURE; source.visible = true; EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(1); @@ -1271,7 +1271,7 @@ TEST_F(databasetest,changeMainConnectionRoute) connection.sinkID = i + 20; connection.sourceID = i + 20; connection.delay = -1; - connection.connectionFormat = CF_ANALOG; + connection.connectionFormat = CF_GENIVI_ANALOG; connection.connectionID = 0; pCF.createSink(sink); diff --git a/AudioManagerDaemon/test/routing/routingTest.cpp b/AudioManagerDaemon/test/routing/routingTest.cpp index 9158064..02733a1 100644 --- a/AudioManagerDaemon/test/routing/routingTest.cpp +++ b/AudioManagerDaemon/test/routing/routingTest.cpp @@ -103,7 +103,7 @@ TEST_F(routingTest,simpleRoute2withDomainNoMatchFormats) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); @@ -115,7 +115,7 @@ TEST_F(routingTest,simpleRoute2withDomainNoMatchFormats) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_ANALOG); + sink.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); @@ -166,7 +166,7 @@ TEST_F(routingTest,simpleRoute2withDomain) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_ANALOG); + source.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); @@ -178,7 +178,7 @@ TEST_F(routingTest,simpleRoute2withDomain) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_ANALOG); + sink.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); @@ -235,14 +235,14 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFree) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_ANALOG); + source.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_MONO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -255,14 +255,14 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFree) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_ANALOG); + gwSink.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -343,14 +343,14 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFreeNotFree) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_ANALOG); + source.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_MONO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -363,14 +363,14 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFreeNotFree) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_ANALOG); + gwSink.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -418,11 +418,11 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFreeNotFree) am_connectionID_t id1,id2; connection.sourceID=sourceID; connection.sinkID=gwSinkID; - connection.connectionFormat=CF_ANALOG; + connection.connectionFormat=CF_GENIVI_ANALOG; connection.connectionID=0; connection1.sourceID=gwSourceID; connection1.sinkID=sinkID; - connection1.connectionFormat=CF_ANALOG; + connection1.connectionFormat=CF_GENIVI_ANALOG; connection1.connectionID=0; ASSERT_EQ(E_OK,pDatabaseHandler.enterConnectionDB(connection,id1)); @@ -472,25 +472,25 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_2) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_STEREO); - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_STEREO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_MONO); - gwSource.listConnectionFormats.push_back(CF_STEREO); - gwSource.listConnectionFormats.push_back(CF_ANALOG); + gwSource.listConnectionFormats.push_back(CF_GENIVI_MONO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_STEREO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource1.domainID = domainID3; gwSource1.name = "gwsource2"; gwSource1.sourceState = SS_ON; gwSource1.sourceID = 0; gwSource1.sourceClassID = 5; - gwSource1.listConnectionFormats.push_back(CF_STEREO); - gwSource1.listConnectionFormats.push_back(CF_MONO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_STEREO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -504,23 +504,23 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_2) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_STEREO); - gwSink.listConnectionFormats.push_back(CF_MONO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_STEREO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink1.domainID = domainID2; gwSink1.name = "gwSink1"; gwSink1.sinkID = 0; gwSink1.sinkClassID = 5; gwSink1.muteState = MS_MUTED; - gwSink1.listConnectionFormats.push_back(CF_ANALOG); - gwSink1.listConnectionFormats.push_back(CF_STEREO); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_ANALOG); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_STEREO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -633,24 +633,24 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_1) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_STEREO); - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_STEREO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_STEREO); - gwSource.listConnectionFormats.push_back(CF_MONO); - gwSource.listConnectionFormats.push_back(CF_ANALOG); + gwSource.listConnectionFormats.push_back(CF_GENIVI_STEREO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_MONO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource1.domainID = domainID3; gwSource1.name = "gwsource2"; gwSource1.sourceState = SS_ON; gwSource1.sourceID = 0; gwSource1.sourceClassID = 5; - gwSource1.listConnectionFormats.push_back(CF_MONO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -664,22 +664,22 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_1) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_STEREO); - gwSink.listConnectionFormats.push_back(CF_MONO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_STEREO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink1.domainID = domainID2; gwSink1.name = "gwSink1"; gwSink1.sinkID = 0; gwSink1.sinkClassID = 5; gwSink1.muteState = MS_MUTED; - gwSink1.listConnectionFormats.push_back(CF_ANALOG); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -790,22 +790,22 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_STEREO); - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_STEREO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_ANALOG); + gwSource.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource1.domainID = domainID3; gwSource1.name = "gwsource2"; gwSource1.sourceState = SS_ON; gwSource1.sourceID = 0; gwSource1.sourceClassID = 5; - gwSource1.listConnectionFormats.push_back(CF_MONO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -819,22 +819,22 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_STEREO); - gwSink.listConnectionFormats.push_back(CF_MONO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_STEREO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink1.domainID = domainID2; gwSink1.name = "gwSink1"; gwSink1.sinkID = 0; gwSink1.sinkClassID = 5; gwSink1.muteState = MS_MUTED; - gwSink1.listConnectionFormats.push_back(CF_ANALOG); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -946,35 +946,35 @@ TEST_F(routingTest,simpleRoute4Domains2Routes) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_ANALOG); + gwSource.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource1.domainID = domainID3; gwSource1.name = "gwsource2"; gwSource1.sourceState = SS_ON; gwSource1.sourceID = 0; gwSource1.sourceClassID = 5; - gwSource1.listConnectionFormats.push_back(CF_MONO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource2.domainID = domainID4; gwSource2.name = "gwsource3"; gwSource2.sourceState = SS_OFF; gwSource2.sourceID = 0; gwSource2.sourceClassID = 5; - gwSource2.listConnectionFormats.push_back(CF_STEREO); + gwSource2.listConnectionFormats.push_back(CF_GENIVI_STEREO); gwSource3.domainID = domainID3; gwSource3.name = "gwsource4"; gwSource3.sourceState = SS_OFF; gwSource3.sourceID = 0; gwSource3.sourceClassID = 5; - gwSource3.listConnectionFormats.push_back(CF_MONO); + gwSource3.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -990,35 +990,35 @@ TEST_F(routingTest,simpleRoute4Domains2Routes) gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_MONO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink1.domainID = domainID2; gwSink1.name = "gwSink1"; gwSink1.sinkID = 0; gwSink1.sinkClassID = 5; gwSink1.muteState = MS_MUTED; - gwSink1.listConnectionFormats.push_back(CF_ANALOG); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSink2.domainID = domainID3; gwSink2.name = "gwSink2"; gwSink2.sinkID = 0; gwSink2.sinkClassID = 5; gwSink2.muteState = MS_MUTED; - gwSink2.listConnectionFormats.push_back(CF_MONO); + gwSink2.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink3.domainID = domainID2; gwSink3.name = "gwSink3"; gwSink3.sinkID = 0; gwSink3.sinkClassID = 5; gwSink3.muteState = MS_MUTED; - gwSink3.listConnectionFormats.push_back(CF_ANALOG); + gwSink3.listConnectionFormats.push_back(CF_GENIVI_ANALOG); sink.domainID = domainID4; sink.name = "sink1"; sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_STEREO); + sink.listConnectionFormats.push_back(CF_GENIVI_STEREO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -1177,21 +1177,21 @@ TEST_F(routingTest,simpleRoute3DomainsNoConnection) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_ANALOG); + gwSource.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource1.domainID = domainID3; gwSource1.name = "gwsource2"; gwSource1.sourceState = SS_ON; gwSource1.sourceID = 0; gwSource1.sourceClassID = 5; - gwSource1.listConnectionFormats.push_back(CF_MONO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -1205,21 +1205,21 @@ TEST_F(routingTest,simpleRoute3DomainsNoConnection) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_STEREO); + sink.listConnectionFormats.push_back(CF_GENIVI_STEREO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_MONO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink1.domainID = domainID2; gwSink1.name = "gwSink1"; gwSink1.sinkID = 0; gwSink1.sinkClassID = 5; gwSink1.muteState = MS_MUTED; - gwSink1.listConnectionFormats.push_back(CF_ANALOG); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -1317,14 +1317,14 @@ TEST_F(routingTest,simpleRoute2Domains) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_ANALOG); + source.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_MONO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -1337,14 +1337,14 @@ TEST_F(routingTest,simpleRoute2Domains) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_ANALOG); + gwSink.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -1425,14 +1425,14 @@ TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_STEREO); + source.listConnectionFormats.push_back(CF_GENIVI_STEREO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_MONO); + gwSource.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -1445,14 +1445,14 @@ TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_ANALOG); + gwSink.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -1536,21 +1536,21 @@ TEST_F(routingTest,simpleRoute3Domains) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_ANALOG); + gwSource.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource1.domainID = domainID3; gwSource1.name = "gwsource2"; gwSource1.sourceState = SS_ON; gwSource1.sourceID = 0; gwSource1.sourceClassID = 5; - gwSource1.listConnectionFormats.push_back(CF_MONO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_MONO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -1564,21 +1564,21 @@ TEST_F(routingTest,simpleRoute3Domains) sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_MONO); + sink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink.domainID = domainID1; gwSink.name = "gwSink"; gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_MONO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink1.domainID = domainID2; gwSink1.name = "gwSink1"; gwSink1.sinkID = 0; gwSink1.sinkClassID = 5; gwSink1.muteState = MS_MUTED; - gwSink1.listConnectionFormats.push_back(CF_ANALOG); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_ANALOG); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); @@ -1688,28 +1688,28 @@ TEST_F(routingTest,simpleRoute4Domains) source.sourceState = SS_ON; source.sourceID = 0; source.sourceClassID = 5; - source.listConnectionFormats.push_back(CF_MONO); + source.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource.domainID = domainID2; gwSource.name = "gwsource1"; gwSource.sourceState = SS_ON; gwSource.sourceID = 0; gwSource.sourceClassID = 5; - gwSource.listConnectionFormats.push_back(CF_ANALOG); + gwSource.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSource1.domainID = domainID3; gwSource1.name = "gwsource2"; gwSource1.sourceState = SS_ON; gwSource1.sourceID = 0; gwSource1.sourceClassID = 5; - gwSource1.listConnectionFormats.push_back(CF_MONO); + gwSource1.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSource2.domainID = domainID4; gwSource2.name = "gwsource3"; gwSource2.sourceState = SS_OFF; gwSource2.sourceID = 0; gwSource2.sourceClassID = 5; - gwSource2.listConnectionFormats.push_back(CF_STEREO); + gwSource2.listConnectionFormats.push_back(CF_GENIVI_STEREO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID)); @@ -1724,28 +1724,28 @@ TEST_F(routingTest,simpleRoute4Domains) gwSink.sinkID = 0; gwSink.sinkClassID = 5; gwSink.muteState = MS_MUTED; - gwSink.listConnectionFormats.push_back(CF_MONO); + gwSink.listConnectionFormats.push_back(CF_GENIVI_MONO); gwSink1.domainID = domainID2; gwSink1.name = "gwSink1"; gwSink1.sinkID = 0; gwSink1.sinkClassID = 5; gwSink1.muteState = MS_MUTED; - gwSink1.listConnectionFormats.push_back(CF_ANALOG); + gwSink1.listConnectionFormats.push_back(CF_GENIVI_ANALOG); gwSink2.domainID = domainID3; gwSink2.name = "gwSink2"; gwSink2.sinkID = 0; gwSink2.sinkClassID = 5; gwSink2.muteState = MS_MUTED; - gwSink2.listConnectionFormats.push_back(CF_MONO); + gwSink2.listConnectionFormats.push_back(CF_GENIVI_MONO); sink.domainID = domainID4; sink.name = "sink1"; sink.sinkID = 0; sink.sinkClassID = 5; sink.muteState = MS_MUTED; - sink.listConnectionFormats.push_back(CF_STEREO); + sink.listConnectionFormats.push_back(CF_GENIVI_STEREO); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID)); diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp index 61ca296..33aa7f6 100644 --- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp +++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp @@ -84,8 +84,8 @@ TEST_F(routingInterfaceTest,abort) ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); //start a connect, expect a call on the routingInterface - EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_ANALOG)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_ANALOG,1,2)); + EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK)); + ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2)); //check the correctness of the handle ASSERT_NE(handle.handle, 0); @@ -128,12 +128,12 @@ TEST_F(routingInterfaceTest,alreadyConnected) sink.domainID = 1; ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); - EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_ANALOG)).WillOnce(Return(E_OK)); + EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK)); am_Handle_s handle; am_connectionID_t connectionID; - ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_ANALOG,1,2)); + ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2)); ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID)); - ASSERT_EQ(E_ALREADY_EXISTS, pControlReceiver.connect(handle,connectionID,CF_ANALOG,1,2)); + ASSERT_EQ(E_ALREADY_EXISTS, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2)); ASSERT_NE(handle.handle, 0); ASSERT_EQ(handle.handleType, H_CONNECT); } @@ -146,7 +146,7 @@ TEST_F(routingInterfaceTest,setSinkSoundPropertyNoChange) am_domainID_t domainID; am_Handle_s handle; am_SoundProperty_s soundProperty; - soundProperty.type = SP_TREBLE; + soundProperty.type = SP_EXAMPLE_TREBLE; soundProperty.value = 23; std::vector listHandles; pCF.createSink(sink); @@ -244,7 +244,7 @@ TEST_F(routingInterfaceTest,setSourceVolumeNoChange) am_domainID_t domainID; am_Handle_s handle; am_volume_t volume = 34; - am_RampType_e rampType = RAMP_DIRECT; + am_RampType_e rampType = RAMP_GENIVI_DIRECT; am_time_t rampTime = 300; std::vector listHandles; pCF.createSource(source); @@ -270,7 +270,7 @@ TEST_F(routingInterfaceTest,setSourceVolume) am_domainID_t domainID; am_Handle_s handle; am_volume_t volume = 34; - am_RampType_e rampType = RAMP_DIRECT; + am_RampType_e rampType = RAMP_GENIVI_DIRECT; am_time_t rampTime = 300; std::vector listHandles; pCF.createSource(source); @@ -298,7 +298,7 @@ TEST_F(routingInterfaceTest,setSinkVolumeNoChange) am_domainID_t domainID; am_Handle_s handle; am_volume_t volume = 34; - am_RampType_e rampType = RAMP_DIRECT; + am_RampType_e rampType = RAMP_GENIVI_DIRECT; am_time_t rampTime = 300; std::vector listHandles; pCF.createSink(sink); @@ -324,7 +324,7 @@ TEST_F(routingInterfaceTest,setSinkVolume) am_domainID_t domainID; am_Handle_s handle; am_volume_t volume = 34; - am_RampType_e rampType = RAMP_DIRECT; + am_RampType_e rampType = RAMP_GENIVI_DIRECT; am_time_t rampTime = 300; std::vector listHandles; pCF.createSink(sink); @@ -361,8 +361,8 @@ TEST_F(routingInterfaceTest,connect) sink.domainID = 1; ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); - EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_ANALOG)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_ANALOG,1,2)); + EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK)); + ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2)); ASSERT_NE(handle.handle, 0); ASSERT_EQ(handle.handleType, H_CONNECT); ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles)); @@ -387,8 +387,8 @@ TEST_F(routingInterfaceTest,disconnect) sink.domainID = 1; ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID)); ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); - EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_ANALOG)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_ANALOG,1,2)); + EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK)); + ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2)); ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID)); EXPECT_CALL(pMockInterface,asyncDisconnect(_,connectionID)).WillOnce(Return(E_OK)); ASSERT_EQ(E_OK, pControlReceiver.disconnect(handle,connectionID)); -- cgit v1.2.1 From 2f60396684a5d8ed7b64aebf20cc9519f69c5600 Mon Sep 17 00:00:00 2001 From: christian mueller Date: Tue, 21 Feb 2012 18:23:05 +0100 Subject: * [ GAM-6 ] enhace routing algorithm: changed the way the routing algorithm gets information from controller --- .../test/controlInterface/MockInterfaces.h | 5 +- AudioManagerDaemon/test/routing/MockInterfaces.h | 179 ++++++++++----------- AudioManagerDaemon/test/routing/routingTest.cpp | 28 ++-- 3 files changed, 106 insertions(+), 106 deletions(-) (limited to 'AudioManagerDaemon/test') diff --git a/AudioManagerDaemon/test/controlInterface/MockInterfaces.h b/AudioManagerDaemon/test/controlInterface/MockInterfaces.h index 746d70e..b49cae6 100644 --- a/AudioManagerDaemon/test/controlInterface/MockInterfaces.h +++ b/AudioManagerDaemon/test/controlInterface/MockInterfaces.h @@ -156,14 +156,15 @@ class MockControlSendInterface : public ControlSendInterface { void(const am_Handle_s handle, const am_Error_e error)); MOCK_METHOD2(cbAckSetSinkSoundProperty, void(const am_Handle_s handle, const am_Error_e error)); - MOCK_METHOD4(getConnectionFormatChoice, - am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const std::vector listPossibleConnectionFormats, std::vector& listPrioConnectionFormats)); + MOCK_METHOD5(getConnectionFormatChoice, + am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector listPossibleConnectionFormats, std::vector& listPrioConnectionFormats)); MOCK_CONST_METHOD0(getInterfaceVersion, uint16_t()); }; + } // namespace am diff --git a/AudioManagerDaemon/test/routing/MockInterfaces.h b/AudioManagerDaemon/test/routing/MockInterfaces.h index ac7b839..207fadd 100644 --- a/AudioManagerDaemon/test/routing/MockInterfaces.h +++ b/AudioManagerDaemon/test/routing/MockInterfaces.h @@ -77,98 +77,97 @@ class MockCommandSendInterface : public CommandSendInterface { }; -class MockControlSendInterface: public ControlSendInterface -{ -public: - MOCK_METHOD1(startupController, - am_Error_e(ControlReceiveInterface* controlreceiveinterface)); - MOCK_METHOD0(stopController, - am_Error_e()); - MOCK_METHOD0(hookAllPluginsLoaded, - void()); - MOCK_METHOD3(hookUserConnectionRequest, - am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID)); - MOCK_METHOD1(hookUserDisconnectionRequest, - am_Error_e(const am_mainConnectionID_t connectionID)); - MOCK_METHOD2(hookUserSetMainSinkSoundProperty, - am_Error_e(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty)); - MOCK_METHOD2(hookUserSetMainSourceSoundProperty, - am_Error_e(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty)); - MOCK_METHOD1(hookUserSetSystemProperty, - am_Error_e(const am_SystemProperty_s& property)); - MOCK_METHOD2(hookUserVolumeChange, - am_Error_e(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)); - MOCK_METHOD2(hookUserVolumeStep, - am_Error_e(const am_sinkID_t SinkID, const int16_t increment)); - MOCK_METHOD2(hookUserSetSinkMuteState, - am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState)); - MOCK_METHOD2(hookSystemRegisterDomain, - am_Error_e(const am_Domain_s& domainData, am_domainID_t& domainID)); - MOCK_METHOD1(hookSystemDeregisterDomain, - am_Error_e(const am_domainID_t domainID)); - MOCK_METHOD1(hookSystemDomainRegistrationComplete, - void(const am_domainID_t domainID)); - MOCK_METHOD2(hookSystemRegisterSink, - am_Error_e(const am_Sink_s& sinkData, am_sinkID_t& sinkID)); - MOCK_METHOD1(hookSystemDeregisterSink, - am_Error_e(const am_sinkID_t sinkID)); - MOCK_METHOD2(hookSystemRegisterSource, - am_Error_e(const am_Source_s& sourceData, am_sourceID_t& sourceID)); - MOCK_METHOD1(hookSystemDeregisterSource, - am_Error_e(const am_sourceID_t sourceID)); - MOCK_METHOD2(hookSystemRegisterGateway, - am_Error_e(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID)); - MOCK_METHOD1(hookSystemDeregisterGateway, - am_Error_e(const am_gatewayID_t gatewayID)); - MOCK_METHOD2(hookSystemRegisterCrossfader, - am_Error_e(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID)); - MOCK_METHOD1(hookSystemDeregisterCrossfader, - am_Error_e(const am_crossfaderID_t crossfaderID)); - MOCK_METHOD3(hookSystemSinkVolumeTick, - void(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)); - MOCK_METHOD3(hookSystemSourceVolumeTick, - void(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)); - MOCK_METHOD2(hookSystemInterruptStateChange, - void(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)); - MOCK_METHOD2(hookSystemSinkAvailablityStateChange, - void(const am_sinkID_t sinkID, const am_Availability_s& availability)); - MOCK_METHOD2(hookSystemSourceAvailablityStateChange, - void(const am_sourceID_t sourceID, const am_Availability_s& availability)); - MOCK_METHOD2(hookSystemDomainStateChange, - void(const am_domainID_t domainID, const am_DomainState_e state)); - MOCK_METHOD1(hookSystemReceiveEarlyData, - void(const std::vector& data)); - MOCK_METHOD1(hookSystemSpeedChange, - void(const am_speed_t speed)); - MOCK_METHOD2(hookSystemTimingInformationChanged, - void(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)); - MOCK_METHOD2(cbAckConnect, - void(const am_Handle_s handle, const am_Error_e errorID)); - MOCK_METHOD2(cbAckDisconnect, - void(const am_Handle_s handle, const am_Error_e errorID)); - MOCK_METHOD3(cbAckCrossFade, - void(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)); - MOCK_METHOD3(cbAckSetSinkVolumeChange, - void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)); - MOCK_METHOD3(cbAckSetSourceVolumeChange, - void(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)); - MOCK_METHOD2(cbAckSetSourceState, - void(const am_Handle_s handle, const am_Error_e error)); - MOCK_METHOD2(cbAckSetSourceSoundProperties, - void(const am_Handle_s handle, const am_Error_e error)); - MOCK_METHOD2(cbAckSetSourceSoundProperty, - void(const am_Handle_s handle, const am_Error_e error)); - MOCK_METHOD2(cbAckSetSinkSoundProperties, - void(const am_Handle_s handle, const am_Error_e error)); - MOCK_METHOD2(cbAckSetSinkSoundProperty, - void(const am_Handle_s handle, const am_Error_e error)); - MOCK_METHOD4(getConnectionFormatChoice, - am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const std::vector listPossibleConnectionFormats, std::vector& listPrioConnectionFormats)); - MOCK_CONST_METHOD0(getInterfaceVersion, - uint16_t()); - +class MockControlSendInterface : public ControlSendInterface { + public: + MOCK_METHOD1(startupController, + am_Error_e(ControlReceiveInterface* controlreceiveinterface)); + MOCK_METHOD0(stopController, + am_Error_e()); + MOCK_METHOD0(hookAllPluginsLoaded, + void()); + MOCK_METHOD3(hookUserConnectionRequest, + am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID)); + MOCK_METHOD1(hookUserDisconnectionRequest, + am_Error_e(const am_mainConnectionID_t connectionID)); + MOCK_METHOD2(hookUserSetMainSinkSoundProperty, + am_Error_e(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty)); + MOCK_METHOD2(hookUserSetMainSourceSoundProperty, + am_Error_e(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty)); + MOCK_METHOD1(hookUserSetSystemProperty, + am_Error_e(const am_SystemProperty_s& property)); + MOCK_METHOD2(hookUserVolumeChange, + am_Error_e(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)); + MOCK_METHOD2(hookUserVolumeStep, + am_Error_e(const am_sinkID_t SinkID, const int16_t increment)); + MOCK_METHOD2(hookUserSetSinkMuteState, + am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState)); + MOCK_METHOD2(hookSystemRegisterDomain, + am_Error_e(const am_Domain_s& domainData, am_domainID_t& domainID)); + MOCK_METHOD1(hookSystemDeregisterDomain, + am_Error_e(const am_domainID_t domainID)); + MOCK_METHOD1(hookSystemDomainRegistrationComplete, + void(const am_domainID_t domainID)); + MOCK_METHOD2(hookSystemRegisterSink, + am_Error_e(const am_Sink_s& sinkData, am_sinkID_t& sinkID)); + MOCK_METHOD1(hookSystemDeregisterSink, + am_Error_e(const am_sinkID_t sinkID)); + MOCK_METHOD2(hookSystemRegisterSource, + am_Error_e(const am_Source_s& sourceData, am_sourceID_t& sourceID)); + MOCK_METHOD1(hookSystemDeregisterSource, + am_Error_e(const am_sourceID_t sourceID)); + MOCK_METHOD2(hookSystemRegisterGateway, + am_Error_e(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID)); + MOCK_METHOD1(hookSystemDeregisterGateway, + am_Error_e(const am_gatewayID_t gatewayID)); + MOCK_METHOD2(hookSystemRegisterCrossfader, + am_Error_e(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID)); + MOCK_METHOD1(hookSystemDeregisterCrossfader, + am_Error_e(const am_crossfaderID_t crossfaderID)); + MOCK_METHOD3(hookSystemSinkVolumeTick, + void(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)); + MOCK_METHOD3(hookSystemSourceVolumeTick, + void(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)); + MOCK_METHOD2(hookSystemInterruptStateChange, + void(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)); + MOCK_METHOD2(hookSystemSinkAvailablityStateChange, + void(const am_sinkID_t sinkID, const am_Availability_s& availability)); + MOCK_METHOD2(hookSystemSourceAvailablityStateChange, + void(const am_sourceID_t sourceID, const am_Availability_s& availability)); + MOCK_METHOD2(hookSystemDomainStateChange, + void(const am_domainID_t domainID, const am_DomainState_e state)); + MOCK_METHOD1(hookSystemReceiveEarlyData, + void(const std::vector& data)); + MOCK_METHOD1(hookSystemSpeedChange, + void(const am_speed_t speed)); + MOCK_METHOD2(hookSystemTimingInformationChanged, + void(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)); + MOCK_METHOD2(cbAckConnect, + void(const am_Handle_s handle, const am_Error_e errorID)); + MOCK_METHOD2(cbAckDisconnect, + void(const am_Handle_s handle, const am_Error_e errorID)); + MOCK_METHOD3(cbAckCrossFade, + void(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)); + MOCK_METHOD3(cbAckSetSinkVolumeChange, + void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)); + MOCK_METHOD3(cbAckSetSourceVolumeChange, + void(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)); + MOCK_METHOD2(cbAckSetSourceState, + void(const am_Handle_s handle, const am_Error_e error)); + MOCK_METHOD2(cbAckSetSourceSoundProperties, + void(const am_Handle_s handle, const am_Error_e error)); + MOCK_METHOD2(cbAckSetSourceSoundProperty, + void(const am_Handle_s handle, const am_Error_e error)); + MOCK_METHOD2(cbAckSetSinkSoundProperties, + void(const am_Handle_s handle, const am_Error_e error)); + MOCK_METHOD2(cbAckSetSinkSoundProperty, + void(const am_Handle_s handle, const am_Error_e error)); + MOCK_METHOD5(getConnectionFormatChoice, + am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector listPossibleConnectionFormats, std::vector& listPrioConnectionFormats)); + MOCK_CONST_METHOD0(getInterfaceVersion, + uint16_t()); }; + } // namespace am #endif /* MOCKROUTINGINTERFACE_H_ */ diff --git a/AudioManagerDaemon/test/routing/routingTest.cpp b/AudioManagerDaemon/test/routing/routingTest.cpp index 02733a1..5b073d2 100644 --- a/AudioManagerDaemon/test/routing/routingTest.cpp +++ b/AudioManagerDaemon/test/routing/routingTest.cpp @@ -74,7 +74,7 @@ void routingTest::TearDown() } ACTION(returnConnectionFormat){ -arg3=arg2; +arg4=arg3; } //test that checks just sinks and source in a domain but connectionformats do not match @@ -82,7 +82,7 @@ TEST_F(routingTest,simpleRoute2withDomainNoMatchFormats) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(1); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(1); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1; @@ -145,7 +145,7 @@ TEST_F(routingTest,simpleRoute2withDomain) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(1); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(1); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1; @@ -209,7 +209,7 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFree) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2; @@ -317,7 +317,7 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFreeNotFree) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2; @@ -441,7 +441,7 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_2) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2, domain3; @@ -602,7 +602,7 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_1) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2, domain3; @@ -759,7 +759,7 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2, domain3; @@ -910,7 +910,7 @@ TEST_F(routingTest,simpleRoute4Domains2Routes) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(5); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(5); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2, domain3, domain4; @@ -1146,7 +1146,7 @@ TEST_F(routingTest,simpleRoute3DomainsNoConnection) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2, domain3; @@ -1291,7 +1291,7 @@ TEST_F(routingTest,simpleRoute2Domains) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2; @@ -1399,7 +1399,7 @@ TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2; @@ -1505,7 +1505,7 @@ TEST_F(routingTest,simpleRoute3Domains) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2, domain3; @@ -1652,7 +1652,7 @@ TEST_F(routingTest,simpleRoute4Domains) { EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(4); EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(4); - EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains am_Domain_s domain1, domain2, domain3, domain4; -- cgit v1.2.1