ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domain2ID));
ASSERT_EQ(E_OK, pDatabaseHandler.getListDomains(listDomains));
ASSERT_EQ(domainID, domain2ID); // FAILS, ID is 2 instead of 1
- ASSERT_TRUE(listDomains[0].domainID==domainID);
+ bool containsDomainID = std::find_if(listDomains.begin(), listDomains.end(), [&](const am_Domain_s & ref) {
+ return ref.domainID==domainID;
+ })!=listDomains.end();
+ ASSERT_TRUE(containsDomainID);
}
TEST_F(CAmMapHandlerTest, connectionIDBoundary)
ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domain2ID));
ASSERT_EQ(E_OK, pDatabaseHandler.getListDomains(listDomains));
ASSERT_EQ(domainID, domain2ID); // FAILS, ID is 2 instead of 1
- ASSERT_TRUE(listDomains[0].domainID==domainID);
+ bool containsDomainID = std::find_if(listDomains.begin(), listDomains.end(), [&](const am_Domain_s & ref) {
+ return ref.domainID==domainID;
+ })!=listDomains.end();
+ ASSERT_TRUE(containsDomainID);
EXPECT_CALL(*MockDatabaseObserver::getMockObserverObject(), removeDomain(domainID)).Times(1);
ASSERT_EQ(E_OK,pDatabaseHandler.removeDomainDB(domainID))<< "ERROR: database error";
EXPECT_TRUE(Mock::VerifyAndClearExpectations(MockDatabaseObserver::getMockObserverObject()));
ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,source3ID));
ASSERT_EQ(E_OK, pDatabaseHandler.getListSources(listSources));
ASSERT_EQ(sourceID, source3ID);
- ASSERT_TRUE(listSources[0].sourceID==sourceID);
+ bool containsSourceID = std::find_if(listSources.begin(), listSources.end(), [&](const am_Source_s & ref) {
+ return ref.sourceID==sourceID;
+ })!=listSources.end();
+ ASSERT_TRUE(containsSourceID);
std::vector<am_SoundProperty_s> listSoundProperties;
std::vector<am_ConnectionFormat_e> listConnectionFormats;
std::vector<am_MainSoundProperty_s> listMainSoundProperties;
ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sink3ID));
ASSERT_EQ(E_OK, pDatabaseHandler.getListSinks(listSinks));
ASSERT_EQ(sinkID, sink3ID);
- ASSERT_TRUE(listSinks[0].sinkID==sinkID);
+ bool containsSourceID = std::find_if(listSinks.begin(), listSinks.end(), [&](const am_Sink_s & ref) {
+ return ref.sinkID==sinkID;
+ })!=listSinks.end();
+ ASSERT_TRUE(containsSourceID);
std::vector<am_SoundProperty_s> listSoundProperties;
std::vector<am_ConnectionFormat_e> listConnectionFormats;
std::vector<am_MainSoundProperty_s> listMainSoundProperties;
ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
ASSERT_EQ(static_cast<uint>(2), listRoutes.size());
- ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
- ASSERT_TRUE(pCF.compareRoute(compareRoute1,listRoutes[1]));
+
+ bool containsRoute1 = std::find_if(listRoutes.begin(), listRoutes.end(), [&](const am_Route_s & ref) {
+ return pCF.compareRoute(compareRoute, ref);
+ })!=listRoutes.end();
+ bool containsRoute2 = std::find_if(listRoutes.begin(), listRoutes.end(), [&](const am_Route_s & ref) {
+ return pCF.compareRoute(compareRoute1, ref);
+ })!=listRoutes.end();
+ ASSERT_TRUE(containsRoute1);
+ ASSERT_TRUE(containsRoute2);
}
//test that checks 3 domains, one sink one source but the connectionformat of third domains do not fit.
}
else
{
+ ON_CALL(*env->mpCommandReceive, getListMainSources(_)).WillByDefault(Return(E_OK));
+ ON_CALL(*env->mpCommandReceive, getListMainSinks(_)).WillByDefault(Return(E_OK));
+ ON_CALL(*env->mpCommandReceive, getListMainSourceSoundProperties(_,_)).WillByDefault(Return(E_OK));
+
EXPECT_CALL(*env->mpCommandReceive,confirmCommandReady(10,_));
plugin.setCommandReady(10);
socketHandler.start_listenting();
void CAmCommandSenderCAPITest::SetUp()
{
::testing::GTEST_FLAG(throw_on_failure) = false;
+ ::testing::FLAGS_gmock_verbose = "error";
+// ::testing::DefaultValue<am_Error_e>::Set(am_Error_e(E_OK));
}
void CAmCommandSenderCAPITest::TearDown()
void CAmEnvironment::SetUp()
{
+ ::testing::GTEST_FLAG(throw_on_failure) = false;
logInfo("RoutingSendInterface Test started ");
std::vector<int> domainIDs;
domainIDs.push_back(0);
domainIDs.push_back(1);
-
+ EXPECT_TRUE(Mock::VerifyAndClearExpectations(&env->pReceiveInterface));
EXPECT_CALL(env->pReceiveInterface,getSocketHandler(_)).WillOnce(DoAll(SetArgReferee<0>(&env->pSocketHandler), Return(E_OK)));
EXPECT_CALL(env->pReceiveInterface,registerDomain(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleDomainRegister));
EXPECT_CALL(env->pReceiveInterface,registerSource(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleSourceRegister));
void CAmEnvironment::TearDown()
{
-
+ ::testing::GTEST_FLAG(throw_on_failure) = true;
}
CAmRoutingReceiverAsync::CAmRoutingReceiverAsync() :