summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Herchet <frank.fh.herchet@bmw.de>2012-04-24 09:37:37 +0200
committerchristian mueller <christian.ei.mueller@bmw.de>2012-05-24 13:40:22 +0200
commit2ebf13acbec713154637ab9a47a20315fa706013 (patch)
tree1e1a55d5c9726002a72c670e5eba4bdc4bf5ad76
parentb2c7d55427df5d31b6a63917f27264a676314d10 (diff)
downloadaudiomanager-2ebf13acbec713154637ab9a47a20315fa706013.tar.gz
*[GAM-71]: move connectNoMoreThreads test
*[GAM-71]: change timeout to 1.5s *[GAM-71]: fix connectAbortTooLate test * fix issue in CAmEnvironment::TearDown Signed-off-by: Christian Mueller <christian.ei.mueller@bmw.de>
-rw-r--r--AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp2
-rw-r--r--PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp51
2 files changed, 27 insertions, 26 deletions
diff --git a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
index c907c76..ebc3705 100644
--- a/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
+++ b/AudioManagerDaemon/test/AmTelnetServerTest/CAmTelnetServerTest.cpp
@@ -89,7 +89,7 @@ void CAmEnvironment::SetUp()
void CAmEnvironment::TearDown()
{
-
+ pthread_cancel(mSocketHandlerThread);
}
void CAmEnvironment::setSocketHandler(CAmSocketHandler* pSocketHandler)
diff --git a/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp b/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp
index 13c9806..399fc03 100644
--- a/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp
+++ b/PluginRoutingInterfaceAsync/test/CAmRoutingReceiverAsync.cpp
@@ -78,7 +78,7 @@ void CAmEnvironment::SetUp()
pRouter->setRoutingReady(10);
timespec t;
- t.tv_nsec = 0;
+ t.tv_nsec = 500000000;
t.tv_sec = 1;
sh_timerHandle_t handle;
@@ -371,29 +371,6 @@ TEST_F(CAmRoutingReceiverAsync,disconnect)
pSocketHandler.start_listenting();
}
-TEST_F(CAmRoutingReceiverAsync,connectNoMoreThreads)
-{
-
- am_Handle_s handle;
- handle.handle = 1;
- handle.handleType = H_CONNECT;
-
- am_connectionID_t connectionID = 1;
- am_sourceID_t sourceID = 2;
- am_sinkID_t sinkID = 1;
- am_ConnectionFormat_e format = CF_GENIVI_ANALOG;
-
- EXPECT_CALL(pReceiveInterface,ackConnect(_,_,E_OK)).Times(10);
- for (int i = 0; i < 10; i++)
- {
- handle.handle++;
- connectionID++;
- ASSERT_EQ(E_OK, pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- }
- ASSERT_EQ(E_NOT_POSSIBLE, pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
- pSocketHandler.start_listenting();
-}
-
TEST_F(CAmRoutingReceiverAsync,connectAbortTooLate)
{
@@ -406,7 +383,7 @@ TEST_F(CAmRoutingReceiverAsync,connectAbortTooLate)
am_sinkID_t sinkID = 1;
am_ConnectionFormat_e format = CF_GENIVI_ANALOG;
- EXPECT_CALL(pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(2);
+ EXPECT_CALL(pReceiveInterface,ackConnect(_,connectionID,E_OK)).Times(1);
ASSERT_EQ(E_OK, pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
sleep(3);
ASSERT_EQ(E_NON_EXISTENT, pRouter->asyncAbort(handle));
@@ -499,6 +476,30 @@ TEST_F(CAmRoutingReceiverAsync,connect)
pSocketHandler.start_listenting();
}
+TEST_F(CAmRoutingReceiverAsync,connectNoMoreThreads)
+{
+
+ am_Handle_s handle;
+ handle.handle = 1;
+ handle.handleType = H_CONNECT;
+
+ am_connectionID_t connectionID = 1;
+ am_sourceID_t sourceID = 2;
+ am_sinkID_t sinkID = 1;
+ am_ConnectionFormat_e format = CF_GENIVI_ANALOG;
+
+ EXPECT_CALL(pReceiveInterface,ackConnect(_,_,E_OK)).Times(10);
+ for (int i = 0; i < 10; i++)
+ {
+ handle.handle++;
+ connectionID++;
+ std::cout << "asyncConnect: " << connectionID << ", " << handle.handle << std::endl;
+ ASSERT_EQ(E_OK, pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
+ }
+ ASSERT_EQ(E_NOT_POSSIBLE, pRouter->asyncConnect(handle,connectionID,sourceID,sinkID,format));
+ pSocketHandler.start_listenting();
+}
+
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);