From 9c0acd5dc485e422a4a0e329e77ab31af721efeb Mon Sep 17 00:00:00 2001 From: christian mueller Date: Thu, 29 Mar 2012 17:40:07 +0200 Subject: * [GAM-49] worked in comments to last patches * changed dlt threadsafeness * changes on timers in CAmSockethandler * adopted test of Sockethandler to changes * add versioning scheme to documentation * added forgotten #include on CamDbusWrapper and CAmRoutingSenderAsync * adopted RoutingReceiverAsyncTests to new timers Signed-off-by: christian mueller --- .../AmSocketHandlerTest/CAmSocketHandlerTest.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'AudioManagerDaemon/test') diff --git a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp index 19e4772..d6aec07 100644 --- a/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp +++ b/AudioManagerDaemon/test/AmSocketHandlerTest/CAmSocketHandlerTest.cpp @@ -68,18 +68,18 @@ void am::CAmTimerCb::timer1Callback(sh_timerHandle_t handle, void* userData) timespec timeout; timeout.tv_nsec = 0; timeout.tv_sec = 1; - mSocketHandler->restartTimer(handle,timeout); + mSocketHandler->updateTimer(handle,timeout); } void am::CAmTimerCb::timer2Callback(sh_timerHandle_t handle, void* userData) { (void) handle; (void) userData; - // std::cout << "callback2 called" << std::endl; + std::cout << "callback2 called" << std::endl; timespec timeout; timeout.tv_nsec = 011110000; - timeout.tv_sec = 0; - mSocketHandler->restartTimer(handle,timeout); + timeout.tv_sec = 1; + mSocketHandler->updateTimer(handle,timeout); } void am::CAmTimerCb::timer3Callback(sh_timerHandle_t, void* userData) @@ -117,7 +117,6 @@ void* playWithUnixSocketServer(void* data) TEST(CAmSocketHandlerTest,playWithTimers) { - gDispatchDone = 0; CAmSocketHandler myHandler; CAmTimerCb testCallback(&myHandler); timespec timeoutTime, timeout2, timeout3, timeout4; @@ -129,15 +128,11 @@ TEST(CAmSocketHandlerTest,playWithTimers) timeout3.tv_sec = 3; timeout4.tv_nsec = 0; timeout4.tv_sec = 20; - IAmShTimerCallBack* buf = &testCallback.pTimer1Callback; - IAmShTimerCallBack* buf2 = &testCallback.pTimer2Callback; - IAmShTimerCallBack* buf3 = &testCallback.pTimer3Callback; - IAmShTimerCallBack* buf4 = &testCallback.pTimer4Callback; sh_timerHandle_t handle; - myHandler.addTimer(timeoutTime, buf, handle, NULL); - myHandler.addTimer(timeout2, buf2, handle, NULL); - myHandler.addTimer(timeout3, buf3, handle, NULL); - myHandler.addTimer(timeout4, buf4, handle, NULL); + myHandler.addTimer(timeoutTime, &testCallback.pTimer1Callback, handle, NULL); + myHandler.addTimer(timeout2, &testCallback.pTimer2Callback, handle, NULL); + myHandler.addTimer(timeout3, &testCallback.pTimer3Callback, handle, NULL); + myHandler.addTimer(timeout4, &testCallback.pTimer4Callback, handle, NULL); myHandler.start_listenting(); } -- cgit v1.2.1