diff -r a179b74831c9 -r c1f20ce4abcf kerneltest/e32test/active/t_ctimer.cpp --- a/kerneltest/e32test/active/t_ctimer.cpp Thu Aug 19 11:14:22 2010 +0300 +++ b/kerneltest/e32test/active/t_ctimer.cpp Tue Aug 31 16:34:26 2010 +0300 @@ -28,6 +28,7 @@ // and check for panic. // - Call absolute timer's At function without adding it to the active scheduler and // check for panic. +// - Call 1s inactivity timer // - Check if heap has been corrupted by the tests. // Platforms/Drives/Compatibility: // All. @@ -77,6 +78,15 @@ static TInt iTotalCount; }; +// for inactivity test +class myInactTimer : public CTimer + { +public: + myInactTimer(const TInt aPriority):CTimer(aPriority){;} + void RunL(void); + void Start(void); + }; + TInt myTimer::iTotalCount; TInt myTimer::iNum; @@ -108,6 +118,23 @@ CActiveScheduler::Add(this); } +void myInactTimer::RunL(void) +// +// Timer has completed +// + { + CActiveScheduler::Stop(); + } + +void myInactTimer::Start(void) +// +// Start a timer going. +// + { + ConstructL(); + CActiveScheduler::Add(this); + } + LOCAL_D TInt ThreadEntry(TAny* aDirective) // // Test thread @@ -197,12 +224,22 @@ CActiveScheduler::Start(); test(A[0]==ID1 && pTimer1->iStatus==KErrNone); // - + test.Next(_L("Inactivity 1s")); + User::ResetInactivityTime(); + myInactTimer* pInactTimer=new myInactTimer(0); + pInactTimer->Start(); + test.Printf(_L("inactivity...")); + pInactTimer->Inactivity(1); + CActiveScheduler::Start(); + test.Printf(_L("...back")); + test(pInactTimer->iStatus==KErrNone); +// test.Next(_L("Destroy objects")); delete pTimer1; delete pTimer2; delete pTimer3; delete pRepeater; + delete pInactTimer; // test.End(); }