summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AudioManagerDaemon/test/AmDatabaseHandlerTest/CAmDatabaseHandlerTest.cpp')
-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)