summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/test
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-02-07 15:59:38 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-02-07 15:59:38 +0100
commitf00468f45b72e2693b79af30665f683967deb5a7 (patch)
treee60b273fd55e2c450b4321ebed2701dbd226a43a /AudioManagerDaemon/test
parente6b739cc7e901ca8637bf3f5a72f5956cd764249 (diff)
downloadaudiomanager-f00468f45b72e2693b79af30665f683967deb5a7.tar.gz
* restructered document generation. Now only the functions of the daemon are generated
* sockethandler: take [0] instead of .front. added todo to make sockethandler faster * added test for local routing
Diffstat (limited to 'AudioManagerDaemon/test')
-rw-r--r--AudioManagerDaemon/test/routing/routingTest.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/AudioManagerDaemon/test/routing/routingTest.cpp b/AudioManagerDaemon/test/routing/routingTest.cpp
index 463bbfd..d160e1a 100644
--- a/AudioManagerDaemon/test/routing/routingTest.cpp
+++ b/AudioManagerDaemon/test/routing/routingTest.cpp
@@ -77,6 +77,70 @@ ACTION(returnConnectionFormat){
arg3=arg2;
}
+//test that checks just sinks and source in a domain
+TEST_F(routingTest,simpleRoute2withDomain)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(1);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(1);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1;
+ am_domainID_t domainID1;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+
+ am_Source_s source;
+ am_sourceID_t sourceID;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_ANALOG);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+
+ sink.domainID = domainID1;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_ANALOG);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements;
+ am_RoutingElement_s hopp1;
+
+ hopp1.sinkID = sinkID;
+ hopp1.sourceID = sourceID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+
+ am_Route_s compareRoute;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(true,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+
+}
+
//test that checks just 2 domains, one sink one source with only one connection format each
TEST_F(routingTest,simpleRoute2DomainsOnlyFree)
{