author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// Overview: |
|
15 |
// The test measures the duration of the user-side timer services. |
|
16 |
// API Information: |
|
17 |
// User::After(...) |
|
18 |
// User::At(...) |
|
19 |
// User::AfterHighRes(...) |
|
20 |
// Details: |
|
21 |
// - Calls time services a number of times with the same input arguments. |
|
22 |
// - Records and prints the minimum and maximum duration of each test case. |
|
23 |
// - Tests the duration of User::After and User::AfterHighRes on target. |
|
24 |
// Platforms/Drives/Compatibility: |
|
25 |
// Emulator and Hardware (Automatic). |
|
26 |
// Assumptions/Requirement/Pre-requisites: |
|
27 |
// Failures and causes: |
|
28 |
// The test can fail only on target. |
|
29 |
// - The duration of Timer::After(aTime) is not within the limits (from <aTime> to <aTime + 1000000/64+2*NanoKarnelTickPeriod>) |
|
30 |
// - The duration of Timer::AfterHighRes(aTime) is not within the limits (from <aTime> to <aTime+2*NanoKarnelTickPeriod>) |
|
31 |
// Base Port information: |
|
32 |
// |
|
33 |
// |
|
34 |
||
35 |
#include <e32std.h> |
|
36 |
#include <e32std_private.h> |
|
37 |
#include <e32test.h> |
|
38 |
#include <e32math.h> |
|
39 |
#include <e32svr.h> |
|
40 |
#include <hal.h> |
|
41 |
||
42 |
LOCAL_D RTest test(_L("T_TIMERDURATION")); |
|
43 |
||
44 |
// Max number of different time values measured |
|
45 |
const TInt KMaxTimeValues = 12; |
|
46 |
||
47 |
// number of times measurement taken to average |
|
48 |
const TInt KMaxTimeMeasurements = 20; |
|
49 |
TInt MaxTimeMeasurements; |
|
50 |
TInt TimeRawMS[KMaxTimeMeasurements];//Holds the ROW time in Kernel ticks |
|
51 |
||
52 |
TInt* TimeValue; |
|
53 |
TInt TimeMin[KMaxTimeValues]; |
|
54 |
TInt TimeMax[KMaxTimeValues]; |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
55 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
RTimer TheTimer; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
57 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
58 |
void After(TInt aTime) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
TRequestStatus s; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
TheTimer.HighRes(s, aTime); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
User::WaitForRequest(s); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
65 |
TInt Again(TInt aTime) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
66 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
67 |
TRequestStatus s; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
68 |
TheTimer.AgainHighRes(s, aTime); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
69 |
User::WaitForRequest(s); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
70 |
return s.Int(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
73 |
void WaitInSteps(TUint aWait, TUint aPeriod, TUint aSteps) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
74 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
75 |
TUint total_ticks = aWait / aPeriod; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
76 |
TUint remain = total_ticks; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
77 |
TUint steps = aSteps > remain ? remain : aSteps; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
TUint carry = 0; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
TUint step = 0; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
80 |
while (remain) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
81 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
82 |
TUint stepLength = remain / steps; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
carry += stepLength; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
TUint us = carry * aPeriod; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
TInt r = KErrNone; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
if (step==0) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
After(us); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
88 |
else |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
89 |
r = Again(us); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
90 |
if (r==KErrNone) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
91 |
carry = 0; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
92 |
++step; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
93 |
--steps; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
remain -= stepLength; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
95 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
96 |
} |
0 | 97 |
|
98 |
void calcStats(TInt i) |
|
99 |
{ |
|
100 |
TimeMin[i]=TimeRawMS[0]; |
|
101 |
TimeMax[i]=TimeRawMS[0]; |
|
102 |
for (TInt j=1; j<MaxTimeMeasurements; ++j) |
|
103 |
{ |
|
104 |
if (TimeMin[i]>TimeRawMS[j]) TimeMin[i]=TimeRawMS[j]; |
|
105 |
if (TimeMax[i]<TimeRawMS[j]) TimeMax[i]=TimeRawMS[j]; |
|
106 |
} |
|
107 |
} |
|
108 |
||
109 |
void printStats() |
|
110 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
111 |
test.Printf(_L(" Value Min Max\n")); |
0 | 112 |
for (TInt i=0;i<KMaxTimeValues;++i) |
113 |
{ |
|
114 |
if (TimeValue[i]<0) break; |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
115 |
test.Printf(_L("%8d %8d %8d\n"),TimeValue[i],TimeMin[i],TimeMax[i]); |
0 | 116 |
} |
117 |
} |
|
118 |
||
119 |
#define __BEFORE_WAIT__ \ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
120 |
test.Printf(_L("Measuring value(%d measurements at each value):\n"), MaxTimeMeasurements);\ |
0 | 121 |
for (i=0;i<KMaxTimeValues;++i)\ |
122 |
{\ |
|
123 |
if (TimeValue[i]<0) break;\ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
124 |
test.Printf(_L("%8d microseconds ...\n"),TimeValue[i]);\ |
0 | 125 |
value = TimeValue[i];\ |
126 |
for (j=0; j<MaxTimeMeasurements; ++j)\ |
|
127 |
{\ |
|
128 |
User::AfterHighRes((Math::Random()&0xf)*1000);\ |
|
129 |
||
130 |
#define __MEASURE1__ tick1 = User::NTickCount(); |
|
131 |
||
132 |
#define __MEASURE2__ tick2 = User::NTickCount(); |
|
133 |
||
134 |
#define __AFTER_WAIT__ \ |
|
135 |
TimeRawMS[j]=(tick2-tick1)*tickPeriod;\ |
|
136 |
}\ |
|
137 |
calcStats(i);\ |
|
138 |
}\ |
|
139 |
printStats();\ |
|
140 |
||
141 |
GLDEF_C TInt E32Main() |
|
142 |
{ |
|
143 |
TInt i,j; |
|
144 |
test.Title(); |
|
145 |
test.Start(_L("Timer resolution test")); |
|
146 |
test.SetLogged(ETrue); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
147 |
test(TheTimer.CreateLocal()==KErrNone); |
0 | 148 |
RThread This; |
149 |
This.SetPriority(EPriorityRealTime); |
|
150 |
TUint tick1,tick2; |
|
151 |
TInt value, tickPeriod; |
|
152 |
HAL::Get(HAL::ENanoTickPeriod, tickPeriod); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
153 |
test.Printf(_L("tickPeriod=%d\n"),tickPeriod); |
0 | 154 |
/////////////////////////////////////////// |
155 |
test.Next(_L("Calibrate")); |
|
156 |
MaxTimeMeasurements = KMaxTimeMeasurements; |
|
157 |
TInt TimeValues1[KMaxTimeValues]={0,-1}; |
|
158 |
TimeValue = &TimeValues1[0]; |
|
159 |
__BEFORE_WAIT__ |
|
160 |
__MEASURE1__ |
|
161 |
__MEASURE2__ |
|
162 |
__AFTER_WAIT__ |
|
163 |
/////////////////////////////////////////// |
|
164 |
test.Next(_L("User::After")); |
|
165 |
TInt TimeValues2[KMaxTimeValues]={10000, 40000,80000,160000,320000,-1}; |
|
166 |
TimeValue = &TimeValues2[0]; |
|
167 |
__BEFORE_WAIT__ |
|
168 |
__MEASURE1__ |
|
169 |
User::After(value); |
|
170 |
__MEASURE2__ |
|
171 |
__AFTER_WAIT__ |
|
172 |
#if defined(__EPOC32__) |
|
173 |
//Check that User::After calls completed within boundaries |
|
174 |
TInt k; |
|
175 |
for (k = 0; k<KMaxTimeValues; k++) |
|
176 |
{ |
|
177 |
if (TimeValue[k] == -1) break; |
|
178 |
test(TimeValue[k] <= TimeMin[k]); |
|
179 |
TInt aTimerResolution = 1000000/64; |
|
180 |
test((TimeValue[k] + aTimerResolution +2*tickPeriod) >= TimeMax[k]); |
|
181 |
} |
|
182 |
#endif |
|
183 |
/////////////////////////////////////////// |
|
184 |
test.Next(_L("User::At")); |
|
185 |
MaxTimeMeasurements = KMaxTimeMeasurements/2; |
|
186 |
TInt TimeValues3[KMaxTimeValues]={950000,1000000,-1}; |
|
187 |
TimeValue = &TimeValues3[0]; |
|
188 |
TTime time; |
|
189 |
time.Set(_L("20050101:000001.000000")); |
|
190 |
User::SetHomeTime(time); |
|
191 |
__BEFORE_WAIT__ |
|
192 |
time.HomeTime(); |
|
193 |
time += (TTimeIntervalMicroSeconds32)value; |
|
194 |
__MEASURE1__ |
|
195 |
User::At(time); |
|
196 |
__MEASURE2__ |
|
197 |
__AFTER_WAIT__ |
|
198 |
/////////////////////////////////////////// |
|
199 |
test.Next(_L("User::AfterHighRes")); |
|
200 |
MaxTimeMeasurements = KMaxTimeMeasurements; |
|
201 |
TInt TimeValues4[KMaxTimeValues]={1000,2000,4000,8000,16000,32000,64000,128000,-1}; |
|
202 |
TimeValue = &TimeValues4[0]; |
|
203 |
__BEFORE_WAIT__ |
|
204 |
__MEASURE1__ |
|
205 |
User::AfterHighRes(value); |
|
206 |
__MEASURE2__ |
|
207 |
__AFTER_WAIT__ |
|
208 |
#if defined(__EPOC32__) |
|
209 |
//Check that User::AfterHighRes calls completed within boundaries |
|
210 |
for (k = 0; k<KMaxTimeValues; k++) |
|
211 |
{ |
|
212 |
if (TimeValue[k] == -1) break; |
|
213 |
test(TimeValue[k] <= TimeMin[k]); |
|
214 |
test((TimeValue[k] + 2*tickPeriod) >= TimeMax[k]); |
|
215 |
} |
|
216 |
#endif |
|
217 |
/////////////////////////////////////////// |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
218 |
test.Next(_L("RTimer::AgainHighRes (2 steps)")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
219 |
MaxTimeMeasurements = KMaxTimeMeasurements; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
220 |
TInt TimeValues5[KMaxTimeValues]={2000,4000,8000,16000,32000,64000,128000,-1}; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
221 |
TimeValue = &TimeValues5[0]; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
222 |
__BEFORE_WAIT__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
223 |
__MEASURE1__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
224 |
WaitInSteps(value, tickPeriod, 2); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
225 |
__MEASURE2__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
226 |
__AFTER_WAIT__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
227 |
#if defined(__EPOC32__) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
228 |
//Check that RTimer::AgainHighRes() calls completed within boundaries |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
229 |
for (k = 0; k<KMaxTimeValues; k++) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
230 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
231 |
if (TimeValue[k] == -1) break; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
232 |
test(TimeValue[k] <= TimeMin[k]); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
233 |
test((TimeValue[k] + 2*tickPeriod) >= TimeMax[k]); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
234 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
235 |
#endif |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
236 |
/////////////////////////////////////////// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
237 |
test.Next(_L("RTimer::AgainHighRes (5 steps)")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
238 |
MaxTimeMeasurements = KMaxTimeMeasurements; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
239 |
TInt TimeValues6[KMaxTimeValues]={4000,8000,16000,32000,64000,128000,-1}; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
240 |
TimeValue = &TimeValues6[0]; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
241 |
__BEFORE_WAIT__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
242 |
__MEASURE1__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
243 |
WaitInSteps(value, tickPeriod, 5); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
244 |
__MEASURE2__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
245 |
__AFTER_WAIT__ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
246 |
#if defined(__EPOC32__) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
247 |
//Check that RTimer::AgainHighRes() calls completed within boundaries |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
for (k = 0; k<KMaxTimeValues; k++) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
249 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
if (TimeValue[k] == -1) break; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
test(TimeValue[k] <= TimeMin[k]); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
test((TimeValue[k] + 2*tickPeriod) >= TimeMax[k]); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
254 |
#endif |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
/////////////////////////////////////////// |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
256 |
TheTimer.Close(); |
0 | 257 |
test.End(); |
258 |
return(KErrNone); |
|
259 |
} |