summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/test/AmDatabaseHandlerTest
diff options
context:
space:
mode:
authorAlexandar Donchev <Aleksander.Donchev@partner.bmw.de>2015-03-11 19:10:54 +0100
committerAlexandar Donchev <Aleksander.Donchev@partner.bmw.de>2015-03-11 19:10:54 +0100
commitc628fa5304171cd827f56aa475668d99d26ad28a (patch)
treefda6587626ce2ebfaed367ce767eddc6f3f6d3de /AudioManagerDaemon/test/AmDatabaseHandlerTest
parent3ff140d47796839b0d733d2ec83a638bb5d06bb1 (diff)
downloadaudiomanager-c628fa5304171cd827f56aa475668d99d26ad28a.tar.gz
* Sound property lookup enhancement throught caching . Tests for cached sound properties.
Signed-off-by: Christian Linke <christian.linke@bmw.de> Signed-off-by: Alexandar Donchev <Aleksander.Donchev@partner.bmw.de>>
Diffstat (limited to 'AudioManagerDaemon/test/AmDatabaseHandlerTest')
-rw-r--r--AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
index d95a391..85a4c44 100644
--- a/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
+++ b/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
@@ -1120,6 +1120,13 @@ TEST_F(CAmDatabaseHandlerTest, changeSourceMainSoundProperty)
ASSERT_EQ(listIterator->value, property.value);
}
}
+ int16_t value;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getMainSourceSoundPropertyValue(sourceID, property.type, value));
+ ASSERT_EQ(value, property.value);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeMainSourceSoundPropertyDB({property.type, 34},sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getMainSourceSoundPropertyValue(sourceID, property.type, value));
+ ASSERT_EQ(value, 34);
}
TEST_F(CAmDatabaseHandlerTest, changeSinkMuteState)
@@ -1160,6 +1167,75 @@ TEST_F(CAmDatabaseHandlerTest, changeSinkMainSoundProperty)
ASSERT_EQ(listIterator->value, property.value);
}
}
+
+ int16_t value;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getMainSinkSoundPropertyValue(sinkID, property.type, value));
+ ASSERT_EQ(value, property.value);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeMainSinkSoundPropertyDB({property.type, 34},sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getMainSinkSoundPropertyValue(sinkID, property.type, value));
+ ASSERT_EQ(value, 34);
+}
+
+TEST_F(CAmDatabaseHandlerTest, changeSourceSoundProperty)
+{
+ std::vector<am_Source_s> listSources;
+ am_Source_s source;
+ am_sourceID_t sourceID;
+ pCF.createSource(source);
+ am_SoundProperty_s property;
+ property.type = SP_GENIVI_MID;
+ property.value = 33;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeSourceSoundPropertyDB(property,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListSources(listSources));
+
+ std::vector<am_SoundProperty_s>::iterator listIterator = listSources[0].listSoundProperties.begin();
+ for (; listIterator < listSources[0].listSoundProperties.end(); ++listIterator)
+ {
+ if (listIterator->type == property.type)
+ ASSERT_EQ(listIterator->value, property.value);
+ }
+ int16_t value;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getSourceSoundPropertyValue(sourceID, property.type, value));
+ ASSERT_EQ(value, property.value);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeSourceSoundPropertyDB({property.type, 34},sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getSourceSoundPropertyValue(sourceID, property.type, value));
+ ASSERT_EQ(value, 34);
+}
+
+TEST_F(CAmDatabaseHandlerTest, changeSinkSoundProperty)
+{
+ std::vector<am_Sink_s> listSinks;
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ pCF.createSink(sink);
+ am_SoundProperty_s property;
+ property.type = SP_GENIVI_MID;
+ property.value = 33;
+
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeSinkSoundPropertyDB(property,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListSinks(listSinks));
+ std::vector<am_SoundProperty_s>::iterator listIterator = listSinks[0].listSoundProperties.begin();
+ for (; listIterator < listSinks[0].listSoundProperties.end(); ++listIterator)
+ {
+ if (listIterator->type == property.type)
+ ASSERT_EQ(listIterator->value, property.value);
+ }
+
+ int16_t value;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getSinkSoundPropertyValue(sinkID, property.type, value));
+ ASSERT_EQ(value, property.value);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeSinkSoundPropertyDB({property.type, 34},sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getSinkSoundPropertyValue(sinkID, property.type, value));
+ ASSERT_EQ(value, 34);
}
TEST_F(CAmDatabaseHandlerTest, peekDomain)