diff options
author | christian mueller <christian.ei.mueller@bmw.de> | 2012-02-29 13:27:27 +0100 |
---|---|---|
committer | christian mueller <christian.ei.mueller@bmw.de> | 2012-02-29 13:27:27 +0100 |
commit | d3ccf97331935b181041394b80be20dca282ea71 (patch) | |
tree | f85e7b649c8a6d58c11e9728b2442cdcff53826d /AudioManagerDaemon/test/routing/routingTest.cpp | |
parent | aa93713377d28a8ce7821466ef828f79a18e982d (diff) | |
download | audiomanager-d3ccf97331935b181041394b80be20dca282ea71.tar.gz |
* [ performance] for classes that do not need to be derived from, removed virtual desctructor
* implemented confirmation of routing ready in RoutingReceiver
* [Sockethandler] automatically set gDispatchDone to 0 when starting mainloop
* fixed unit text to work with latest changes (expect Dbus command interface)
* [GAM-4] added way to do synchronous calling on interfaces with the help of CAmSerializer.h
* reworked AsyncRoutingPlugin to work with CAmSerializer.h
* reworked AsyncRoutingPlugin to register elemtes in thread using CAmSerializer.h
* reworked AsncPlugin Tests to work with remodelled Plugin
Diffstat (limited to 'AudioManagerDaemon/test/routing/routingTest.cpp')
-rw-r--r-- | AudioManagerDaemon/test/routing/routingTest.cpp | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/AudioManagerDaemon/test/routing/routingTest.cpp b/AudioManagerDaemon/test/routing/routingTest.cpp index 5b073d2..aa3f333 100644 --- a/AudioManagerDaemon/test/routing/routingTest.cpp +++ b/AudioManagerDaemon/test/routing/routingTest.cpp @@ -42,6 +42,7 @@ using namespace testing; routingTest::routingTest() : plistRoutingPluginDirs(), // plistCommandPluginDirs(), // + pSocketHandler(), // pDatabaseHandler(std::string(":memory:")), // pControlSender(std::string("")), // pRouter(&pDatabaseHandler, &pControlSender), // @@ -52,8 +53,8 @@ routingTest::routingTest() : pRoutingInterfaceBackdoor(), // pCommandInterfaceBackdoor(), // pControlInterfaceBackdoor(), // - pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender, &pRouter), // - pObserver(&pCommandSender, &pRoutingSender) + pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender,&pSocketHandler, &pRouter), // + pObserver(&pCommandSender, &pRoutingSender, &pSocketHandler) { pDatabaseHandler.registerObserver(&pObserver); pCommandInterfaceBackdoor.injectInterface(&pCommandSender, &pMockInterface); @@ -80,8 +81,6 @@ arg4=arg3; //test that checks just sinks and source in a domain but connectionformats do not match TEST_F(routingTest,simpleRoute2withDomainNoMatchFormats) { - 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 @@ -143,8 +142,6 @@ TEST_F(routingTest,simpleRoute2withDomainNoMatchFormats) //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 @@ -207,8 +204,8 @@ TEST_F(routingTest,simpleRoute2withDomain) //test that checks just 2 domains, one sink one source with only one connection format each TEST_F(routingTest,simpleRoute2DomainsOnlyFree) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); + + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -315,8 +312,8 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFree) //test that checks just 2 domains, one sink one source with only one connection format each TEST_F(routingTest,simpleRoute2DomainsOnlyFreeNotFree) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); + + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -439,8 +436,7 @@ TEST_F(routingTest,simpleRoute2DomainsOnlyFreeNotFree) //test that checks 3 domains, one sink one source, longer lists of connectionformats. TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_2) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -600,8 +596,6 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_2) //test that checks 3 domains, one sink one source, longer lists of connectionformats. TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_1) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -757,8 +751,6 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_1) //test that checks 3 domains, one sink one source, longer lists of connectionformats. TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -908,8 +900,6 @@ TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats) //test that checks 4 domains, one sink and one source but there are 2 routes because there are 2 gateways TEST_F(routingTest,simpleRoute4Domains2Routes) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(5); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(5); EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -1144,8 +1134,7 @@ TEST_F(routingTest,simpleRoute4Domains2Routes) //test that checks 3 domains, one sink one source but the connectionformat of third domains do not fit. TEST_F(routingTest,simpleRoute3DomainsNoConnection) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -1289,8 +1278,8 @@ TEST_F(routingTest,simpleRoute3DomainsNoConnection) //test that checks just 2 domains, one sink one source with only one connection format each TEST_F(routingTest,simpleRoute2Domains) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); + + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -1397,8 +1386,8 @@ TEST_F(routingTest,simpleRoute2Domains) //test that checks just 2 domains, one sink one source but the connectionformat of source TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2); + + EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -1503,8 +1492,6 @@ TEST_F(routingTest,simpleRoute2DomainsNoMatchConnectionFormats) //test that checks 3 domains, one sink one source. TEST_F(routingTest,simpleRoute3Domains) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3); EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains @@ -1650,8 +1637,6 @@ TEST_F(routingTest,simpleRoute3Domains) //test that checks 4 domains, one sink and one source. TEST_F(routingTest,simpleRoute4Domains) { - EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(4); - EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(4); EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK))); //initialize 2 domains |