diff options
author | Jens Lorenz <jlorenz@de.adit-jv.com> | 2016-11-25 15:29:14 +0100 |
---|---|---|
committer | Jens Lorenz <jlorenz@de.adit-jv.com> | 2016-11-25 15:29:14 +0100 |
commit | 30754a4100cf18b6d0b689bafbb23583d165f81b (patch) | |
tree | a2824e2e40e7c90d4f576a1dc57a7f4ba5d325be /AudioManagerCore/test | |
parent | 70f3263edf097b7990fcd2d27d4d47da34b6c0da (diff) | |
download | audiomanager-30754a4100cf18b6d0b689bafbb23583d165f81b.tar.gz |
AMCore: Fix deamon to update interrupt state of source.
Signed-off-by: Toshiaki Isogai <tisogai@jp.adit-jv.com>
Diffstat (limited to 'AudioManagerCore/test')
-rw-r--r-- | AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp | 17 | ||||
-rw-r--r-- | AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp | 20 |
2 files changed, 37 insertions, 0 deletions
diff --git a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp index 3e9e728..9c09deb 100644 --- a/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp +++ b/AudioManagerCore/test/AmControlInterfaceTest/CAmControlInterfaceTest.cpp @@ -165,6 +165,23 @@ TEST_F(CAmControlInterfaceTest,deregisterSource) ASSERT_EQ(E_OK, pRoutingReceiver.deregisterSource(sourceID)); } +TEST_F(CAmControlInterfaceTest,hookInterruptStatusChange) +{ + am_Source_s source; + am_sourceID_t sourceID; + pCF.createSource(source); + source.sourceID=12; + source.interruptState = IS_UNKNOWN; + sourceID = source.sourceID; + + //prepare the stage + ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); + + //When we run this test, we expect the call on the control interface + EXPECT_CALL(pMockControlInterface,hookSystemInterruptStateChange(sourceID, IS_OFF)); + pRoutingReceiver.hookInterruptStatusChange(sourceID, IS_OFF); +} + TEST_F(CAmControlInterfaceTest,registerGateway) { am_Gateway_s gateway; diff --git a/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp b/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp index 4c91d2a..559764d 100644 --- a/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp +++ b/AudioManagerCore/test/AmMapHandlerTest/CAmMapHandlerTest.cpp @@ -480,6 +480,26 @@ TEST_F(CAmMapHandlerTest,sourceState) ASSERT_EQ(listSources[0].sourceState, SS_ON); } +TEST_F(CAmMapHandlerTest,sourceInterruptState) +{ + am_Source_s source; + am_sourceID_t sourceID; + std::vector<am_Source_s> listSources; + pCF.createSource(source); + source.interruptState = IS_OFF; + + //prepare the test + + ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID)); + + //change the source interrupt state + ASSERT_EQ(E_OK, pDatabaseHandler.changeSourceInterruptState(sourceID,IS_INTERRUPTED)); + + //read out the changed values + ASSERT_EQ(E_OK, pDatabaseHandler.getListSources(listSources)); + ASSERT_EQ(listSources[0].interruptState, IS_INTERRUPTED); +} + TEST_F(CAmMapHandlerTest,sinkVolumeChange) { am_Sink_s sink; |