equal
deleted
inserted
replaced
26 // - Repeated timer is cancelled as expected. |
26 // - Repeated timer is cancelled as expected. |
27 // - Call relative timer's After function without adding it to the active scheduler |
27 // - Call relative timer's After function without adding it to the active scheduler |
28 // and check for panic. |
28 // and check for panic. |
29 // - Call absolute timer's At function without adding it to the active scheduler and |
29 // - Call absolute timer's At function without adding it to the active scheduler and |
30 // check for panic. |
30 // check for panic. |
31 // - Call 1s inactivity timer |
|
32 // - Check if heap has been corrupted by the tests. |
31 // - Check if heap has been corrupted by the tests. |
33 // Platforms/Drives/Compatibility: |
32 // Platforms/Drives/Compatibility: |
34 // All. |
33 // All. |
35 // Assumptions/Requirement/Pre-requisites: |
34 // Assumptions/Requirement/Pre-requisites: |
36 // Failures and causes: |
35 // Failures and causes: |
76 TInt iCount; |
75 TInt iCount; |
77 static TInt iNum; |
76 static TInt iNum; |
78 static TInt iTotalCount; |
77 static TInt iTotalCount; |
79 }; |
78 }; |
80 |
79 |
81 // for inactivity test |
|
82 class myInactTimer : public CTimer |
|
83 { |
|
84 public: |
|
85 myInactTimer(const TInt aPriority):CTimer(aPriority){;} |
|
86 void RunL(void); |
|
87 void Start(void); |
|
88 }; |
|
89 |
|
90 TInt myTimer::iTotalCount; |
80 TInt myTimer::iTotalCount; |
91 TInt myTimer::iNum; |
81 TInt myTimer::iNum; |
92 |
82 |
93 void myTimer::RunL(void) |
83 void myTimer::RunL(void) |
94 // |
84 // |
112 // |
102 // |
113 // Start a timer going. |
103 // Start a timer going. |
114 // |
104 // |
115 { |
105 { |
116 |
106 |
117 ConstructL(); |
|
118 CActiveScheduler::Add(this); |
|
119 } |
|
120 |
|
121 void myInactTimer::RunL(void) |
|
122 // |
|
123 // Timer has completed |
|
124 // |
|
125 { |
|
126 CActiveScheduler::Stop(); |
|
127 } |
|
128 |
|
129 void myInactTimer::Start(void) |
|
130 // |
|
131 // Start a timer going. |
|
132 // |
|
133 { |
|
134 ConstructL(); |
107 ConstructL(); |
135 CActiveScheduler::Add(this); |
108 CActiveScheduler::Add(this); |
136 } |
109 } |
137 |
110 |
138 LOCAL_D TInt ThreadEntry(TAny* aDirective) |
111 LOCAL_D TInt ThreadEntry(TAny* aDirective) |
222 myTimer::SetNum(1); |
195 myTimer::SetNum(1); |
223 pTimer1->HighRes(1000000); |
196 pTimer1->HighRes(1000000); |
224 CActiveScheduler::Start(); |
197 CActiveScheduler::Start(); |
225 test(A[0]==ID1 && pTimer1->iStatus==KErrNone); |
198 test(A[0]==ID1 && pTimer1->iStatus==KErrNone); |
226 // |
199 // |
227 test.Next(_L("Inactivity 1s")); |
200 |
228 User::ResetInactivityTime(); |
|
229 myInactTimer* pInactTimer=new myInactTimer(0); |
|
230 pInactTimer->Start(); |
|
231 test.Printf(_L("inactivity...")); |
|
232 pInactTimer->Inactivity(1); |
|
233 CActiveScheduler::Start(); |
|
234 test.Printf(_L("...back")); |
|
235 test(pInactTimer->iStatus==KErrNone); |
|
236 // |
|
237 test.Next(_L("Destroy objects")); |
201 test.Next(_L("Destroy objects")); |
238 delete pTimer1; |
202 delete pTimer1; |
239 delete pTimer2; |
203 delete pTimer2; |
240 delete pTimer3; |
204 delete pTimer3; |
241 delete pRepeater; |
205 delete pRepeater; |
242 delete pInactTimer; |
|
243 // |
206 // |
244 test.End(); |
207 test.End(); |
245 } |
208 } |
246 |
209 |
247 void TestCTimer::Test2() |
210 void TestCTimer::Test2() |