void TimerTickSignal();
void TimerCopyConstructor();
void TimerDowncast();
+void TimerSetGetIntervalWithRestart();
+void TimerPauseResume();
namespace
{
enum TEST_CASES_LIST_TIMER
{
TIMER_SET_GET_INTERVAL,
+ TIMER_SET_GET_INTERVAL_WITH_RESTART,
TIMER_START_STOP_ISRUNNING,
+ TIMER_PAUSE_RESUME,
TIMER_ASSIGNMENT_OPERATOR,
TIMER_TICK_SIGNAL,
TIMER_COPY_CONSTRUCTOR,
case TIMER_SET_GET_INTERVAL:
TimerSetGetInterval();
break;
+ case TIMER_SET_GET_INTERVAL_WITH_RESTART:
+ TimerSetGetIntervalWithRestart();
+ break;
case TIMER_START_STOP_ISRUNNING:
TimerStartStopIsRunning();
break;
+ case TIMER_PAUSE_RESUME:
+ TimerPauseResume();
+ break;
case TIMER_ASSIGNMENT_OPERATOR:
TimerAssignmentOperator();
break;
DALI_CHECK_FAIL(g_uTimerGetTimeInMilliSec != g_uTimerSetTimeInMilliSec, "GetIntervaland SetInterval value mismatched.");
timer.Reset();
+
g_uTimerGetTimeInMilliSec = DEFAULT_TIME_INTERVAL_IN_MILLISEC;
g_uTimerSetTimeInMilliSec = DEFAULT_TIME_INTERVAL_IN_MILLISEC;
DaliLog::PrintPass();
}
+void TimerSetGetIntervalWithRestart()
+{
+ bool bIsRunning = true;
+ g_uTimerSetTimeInMilliSec = 5000u;
+ unsigned int g_uTimerGetTimeInMilliSec = DEFAULT_TIME_INTERVAL_IN_MILLISEC;
+ bool bRestartFlag;
+
+ Timer timer = TimerInit();
+ DALI_CHECK_INSTANCE(timer,"Timer object is not created");
+
+ g_uTimerGetTimeInMilliSec= timer.GetInterval();
+ DALI_CHECK_FAIL(g_uTimerGetTimeInMilliSec != PERIODIC_TICK_INTERVAL, "Failed to Get the default GetInterval.");
+
+ bRestartFlag = false;
+ timer.SetInterval(g_uTimerSetTimeInMilliSec, bRestartFlag);
+
+ g_uTimerGetTimeInMilliSec= timer.GetInterval();
+ DALI_CHECK_FAIL(g_uTimerGetTimeInMilliSec != g_uTimerSetTimeInMilliSec, "GetInterval and SetInterval value mismatched.");
+
+ bIsRunning = timer.IsRunning();
+ DALI_CHECK_FAIL(bIsRunning, "Timer should be stopped after SetInterval(interval, false).");
+
+ timer.Reset();
+
+ bIsRunning = false;
+
+ timer = TimerInit();
+ DALI_CHECK_INSTANCE(timer,"Timer object is not created");
+
+ g_uTimerGetTimeInMilliSec= timer.GetInterval();
+ DALI_CHECK_FAIL(g_uTimerGetTimeInMilliSec != PERIODIC_TICK_INTERVAL, "Failed to Get the default GetInterval.");
+
+ bRestartFlag = true;
+ timer.SetInterval(g_uTimerSetTimeInMilliSec, bRestartFlag);
+
+ g_uTimerGetTimeInMilliSec= timer.GetInterval();
+ DALI_CHECK_FAIL(g_uTimerGetTimeInMilliSec != g_uTimerSetTimeInMilliSec, "GetInterval and SetInterval value mismatched.");
+
+ bIsRunning = timer.IsRunning();
+ DALI_CHECK_FAIL(!bIsRunning, "Timer should be still running after SetInterval(interval, true).");
+
+ timer.Reset();
+
+ DaliLog::PrintPass();
+}
+
void TimerStartStopIsRunning()
{
bIsRunning = timer.IsRunning();
DALI_CHECK_FAIL(bIsRunning, "Default value of IsRunning is Failed .");
-
+
timer.Start();
-
+
bIsRunning = timer.IsRunning();
DALI_CHECK_FAIL(!bIsRunning, "IsRunning returning false after Start timer.");
bIsRunning = timer.IsRunning();
DALI_CHECK_FAIL(bIsRunning, "IsRunning returning true after stop timer.");
-
+
timer.Reset();
-
+
+ DaliLog::PrintPass();
+}
+
+void TimerPauseResume()
+{
+ Timer timer = TimerInit();
+ DALI_CHECK_INSTANCE(timer,"timer object is not created");
+
+ bool bIsRunning = false;
+ bIsRunning = timer.IsRunning();
+ DALI_CHECK_FAIL(bIsRunning, "Default value of IsRunning is Failed.");
+
+ timer.Start();
+
+ bIsRunning = timer.IsRunning();
+ DALI_CHECK_FAIL(!bIsRunning, "IsRunning returning false after Start timer.");
+
+ timer.Pause();
+ timer.Resume();
+
+ timer.Stop();
+
+ bIsRunning = timer.IsRunning();
+ DALI_CHECK_FAIL(bIsRunning, "IsRunning returning true after stop timer.");
+
+ timer.Reset();
+
DaliLog::PrintPass();
}
+
void TimerAssignmentOperator()
{
Application application = Application::New( &gArgc, &gArgv );
CHECK_OPEN_GL(SUITE_NAME,__LINE__)
Timer_TestApp testApp( application, TIMER_SET_GET_INTERVAL);
- application.MainLoop();
+ application.MainLoop();
return test_return_value;
}
//& purpose: To Check Start and Stop and IsRunning api is working properly or not.
application.MainLoop();
return test_return_value;
}
+//& purpose: To Check Start, Pause, Resume, Stop and IsRunning api is working properly or not.
+//& type: auto
+/**
+* @testcase ITcTimerPauseResume
+* @since_tizen 5.0
+* @type Positive
+* @description To Check Start, Pause, Resume, Stop and IsRunning api is working properly or not.
+* @scenario Creates a Timer object.\n
+* Check the Default value of IsRunning\n
+* Start the Timer \n
+* Gets the Timer Condition\n
+* Stop the Timer\n
+* Check the IsRunning Condition \n
+* @apicovered Stop,Start,Pause,Resume,Timer::New,IsRunning
+* @passcase If Start, Pause, Resume, Stop and IsRunning is Working Properly
+* @failcase If Fail to work Start, Pause, Resume, Stop and IsRunning Properly
+* @precondition NA
+* @postcondition NA
+*/
+int ITcTimerPauseResume(void)
+{
+ DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__);
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Timer_TestApp testApp( application, TIMER_PAUSE_RESUME);
+ application.MainLoop();
+ return test_return_value;
+}
+
//& purpose: Check whether the assigned object is matched with real object after using assignmentoperator.
//& type: auto
/**
application.MainLoop();
return test_return_value;
}
+//& purpose: Sets a new interval on the timer with a flag to restart the timer.
+//& type: auto
+/**
+* @testcase ITcTimerSetIntervalWithRestart
+* @since_tizen 5.0
+* @type Positive
+* @description Sets a new interval on the timer with option to restart the timer.
+* @scenario Creates a Timer object. \n
+* Sets the Timer Interval \n
+* @apicovered SetInterval,IsRunning
+* @passcase If SetInterval works properly with the flag to restart
+* @failcase If Fail to work SetInterval with the flag to restart
+* @precondition NA
+* @postcondition NA
+*/
+int ITcTimerSetGetIntervalWithRestart(void)
+{
+ DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__);
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Timer_TestApp testApp( application, TIMER_SET_GET_INTERVAL_WITH_RESTART);
+ application.MainLoop();
+ return test_return_value;
+}
/** @} */ // end of itc-timer-testcases
/** @} */ // end of itc-timer
/** @} */ // end of itc-dali-adaptor