From 94158ff5c4d3643acc5b5930e155abaae6d6fb66 Mon Sep 17 00:00:00 2001 From: Christian Linke Date: Tue, 30 Aug 2016 10:40:41 -0700 Subject: some test fixes Change-Id: I22ea9682756dd36f6442241951ec6678f3c3f7ae --- AudioManagerCore/src/CAmRoutingSender.cpp | 2 +- .../CAmControlInterfaceTest.cpp | 64 ---------------------- 2 files changed, 1 insertion(+), 65 deletions(-) diff --git a/AudioManagerCore/src/CAmRoutingSender.cpp b/AudioManagerCore/src/CAmRoutingSender.cpp index 93d5894..06456f5 100644 --- a/AudioManagerCore/src/CAmRoutingSender.cpp +++ b/AudioManagerCore/src/CAmRoutingSender.cpp @@ -1142,7 +1142,7 @@ CAmRoutingSender::handleConnect::~handleConnect() CAmRoutingSender::handleDisconnect::~handleDisconnect() { - mRoutingSender->removeConnectionLookup(mConnectionID); + mpDatabaseHandler->removeConnection(mConnectionID); } } diff --git a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp index 5386192..3e9e728 100644 --- a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp +++ b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp @@ -305,70 +305,6 @@ TEST_F(CAmControlInterfaceTest,ackDisconnect) ASSERT_EQ(E_NON_EXISTENT, pControlReceiver.disconnect(handle,2)); } -TEST_F(CAmControlInterfaceTest,ackDisconnectFailAndRetry) -{ - logInfo("ackDisconnectFailAndRetry test started"); - am_connectionID_t connectionID; - am_Sink_s sink; - am_sinkID_t sinkID; - am_Domain_s domain; - am_domainID_t domainID; - am_Source_s source; - am_sourceID_t sourceID; - std::vector connectionList; - std::vector handlesList; - am_Handle_s handle; - pCF.createSink(sink); - pCF.createDomain(domain); - pCF.createSource(source); - domain.name = "mock"; - domain.busname = "mock"; - domain.domainID=0; - sink.sinkID = 2; - sink.domainID = DYNAMIC_ID_BOUNDARY; - source.sourceID=2; - - //prepare the stage - ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID)); - ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID)); - ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); - - //now we first need to connect, we expect a call on the routing interface - 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); - pRoutingReceiver.ackConnect(handle, connectionID, E_OK); - - //now we can start to disconnect and expect a call on the routing interface - EXPECT_CALL(pMockRoutingInterface,asyncDisconnect(_,1)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.disconnect(handle,1)); - - //during the disconnection, the connection is still in the list! - ASSERT_EQ(E_OK, pDatabaseHandler.getListConnections(connectionList)); - ASSERT_TRUE(!connectionList.empty()); - - //then we fire the ack and expect a call on the controlInterface - EXPECT_CALL(pMockControlInterface,cbAckDisconnect(_,E_NON_EXISTENT)).Times(1); - pRoutingReceiver.ackDisconnect(handle, connectionID+1, E_NON_EXISTENT); - - //make sure the handle is gone - ASSERT_EQ(E_OK, pControlReceiver.getListHandles(handlesList)); - ASSERT_TRUE(handlesList.empty()); - - //make sure the connection is still there - ASSERT_EQ(E_OK, pDatabaseHandler.getListConnections(connectionList)); - ASSERT_FALSE(connectionList.empty()); - - ASSERT_TRUE(pDatabaseHandler.existConnectionID(1)); - - //Now let's try to disconnect now - EXPECT_CALL(pMockRoutingInterface,asyncDisconnect(_,1)).WillOnce(Return(E_OK)); - ASSERT_EQ(E_OK, pControlReceiver.disconnect(handle,1)); - logInfo("ackDisconnectFailAndRetry test finished"); -} - TEST_F(CAmControlInterfaceTest,setSourceState) { -- cgit v1.2.1