sl@0
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "FbsRalc.h"
|
sl@0
|
17 |
#include "UTILS.H"
|
sl@0
|
18 |
#include "TRalc.h"
|
sl@0
|
19 |
#include "fbsmessage.h"
|
sl@0
|
20 |
#include "fbsdefs.h"
|
sl@0
|
21 |
|
sl@0
|
22 |
_LIT(KMbmFileEikon, "z:\\System\\Data\\tfbs_file4.mbm");
|
sl@0
|
23 |
_LIT(KMbmFileTechview, "z:\\System\\Data\\tfbs_file5.mbm");
|
sl@0
|
24 |
_LIT(KMbmFileTechviewU,"Z:\\SYSTEM\\DATA\\TFBS_FILE5.MBM");
|
sl@0
|
25 |
_LIT(KMbmFileLafcurs, "z:\\System\\Data\\tfbs_file2.mbm");
|
sl@0
|
26 |
_LIT(KMbmFileShell, "z:\\System\\Data\\tfbs_file1.mbm");
|
sl@0
|
27 |
_LIT(KMbmFileShel, "z:\\System\\Data\\tfbs_file_.mbm");
|
sl@0
|
28 |
_LIT(KMbmFileTimew, "z:\\System\\Data\\tfbs_file3.mbm");
|
sl@0
|
29 |
|
sl@0
|
30 |
_LIT(KMbmFileLafcursLong, "z:\\siuhsiughighifhgidfhguifhguidhfguifhghlarglaghghghghghkrjghszkjg\\System\\Data\\tfbs_file2.mbm");
|
sl@0
|
31 |
_LIT(KMbmFileShellLong, "z:\\siuhsiughighifhgidfhguifhguidhfguifhghlarglaghghghghghkrjghszkjg\\System\\Data\\tfbs_file1.mbm");
|
sl@0
|
32 |
|
sl@0
|
33 |
// ============================================================================
|
sl@0
|
34 |
|
sl@0
|
35 |
CTRalc::CTRalc(CTestStep* aStep):
|
sl@0
|
36 |
CTGraphicsBase(aStep),
|
sl@0
|
37 |
iHandle(0),
|
sl@0
|
38 |
iFbs(NULL),
|
sl@0
|
39 |
iResourceCount(0),
|
sl@0
|
40 |
iAllocs(0)
|
sl@0
|
41 |
{
|
sl@0
|
42 |
}
|
sl@0
|
43 |
|
sl@0
|
44 |
CTRalc::~CTRalc()
|
sl@0
|
45 |
{
|
sl@0
|
46 |
if(iShutdownFbs)
|
sl@0
|
47 |
RFbsSession::GetSession()->SendCommand(EFbsMessShutdown);
|
sl@0
|
48 |
RFbsSession::Disconnect();
|
sl@0
|
49 |
}
|
sl@0
|
50 |
|
sl@0
|
51 |
void CTRalc::ConstructL()
|
sl@0
|
52 |
{
|
sl@0
|
53 |
if(RFbsSession::Connect()==KErrNone)
|
sl@0
|
54 |
{
|
sl@0
|
55 |
iShutdownFbs = EFalse;
|
sl@0
|
56 |
}
|
sl@0
|
57 |
else
|
sl@0
|
58 |
{
|
sl@0
|
59 |
FbsStartup();
|
sl@0
|
60 |
RFbsSession::Connect();
|
sl@0
|
61 |
iShutdownFbs = ETrue;
|
sl@0
|
62 |
}
|
sl@0
|
63 |
|
sl@0
|
64 |
iFbs = RFbsSession::GetSession();
|
sl@0
|
65 |
|
sl@0
|
66 |
TRAPD(err,ExpandCleanupStackL());
|
sl@0
|
67 |
if (err != KErrNone)
|
sl@0
|
68 |
User::Panic(_L("CleanupStack expansion failed"),err);
|
sl@0
|
69 |
|
sl@0
|
70 |
INFO_PRINTF1(_L("FBS Client RALC testing"));
|
sl@0
|
71 |
}
|
sl@0
|
72 |
|
sl@0
|
73 |
void CTRalc::ExpandCleanupStackL()
|
sl@0
|
74 |
{
|
sl@0
|
75 |
TInt count=0;
|
sl@0
|
76 |
for(;count<10;count++)
|
sl@0
|
77 |
CleanupStack::PushL((TUint32*)0x1);
|
sl@0
|
78 |
CleanupStack::Pop(count);
|
sl@0
|
79 |
}
|
sl@0
|
80 |
|
sl@0
|
81 |
/**
|
sl@0
|
82 |
@SYMTestCaseID
|
sl@0
|
83 |
GRAPHICS-FBSERV-0604
|
sl@0
|
84 |
|
sl@0
|
85 |
@SYMTestCaseDesc
|
sl@0
|
86 |
Tests the creation of CFbsRalCacheEl objects.
|
sl@0
|
87 |
|
sl@0
|
88 |
@SYMTestActions
|
sl@0
|
89 |
1. Test the API on a default built element object.
|
sl@0
|
90 |
2. Test a New'd element object followed by delete.
|
sl@0
|
91 |
3. Test a New'd element object followed by destroy & free.
|
sl@0
|
92 |
4. Test matching of an element object.
|
sl@0
|
93 |
|
sl@0
|
94 |
@SYMTestExpectedResults
|
sl@0
|
95 |
Test should pass
|
sl@0
|
96 |
*/
|
sl@0
|
97 |
void CTRalc::TestRALCEntryClass()
|
sl@0
|
98 |
{
|
sl@0
|
99 |
INFO_PRINTF1(_L("Test of CFbsRalCacheEl API"));
|
sl@0
|
100 |
|
sl@0
|
101 |
// Test the API on a defaultly built element object
|
sl@0
|
102 |
{
|
sl@0
|
103 |
CFbsRalCacheEl elOne;
|
sl@0
|
104 |
TEST(elOne.iAddress == 0);
|
sl@0
|
105 |
TEST(elOne.iFilename == 0);
|
sl@0
|
106 |
|
sl@0
|
107 |
// Test matching method
|
sl@0
|
108 |
TBool r1 = EFalse;
|
sl@0
|
109 |
r1 = elOne.MatchKey (KMbmFileEikon);
|
sl@0
|
110 |
TEST(r1 == EFalse);
|
sl@0
|
111 |
|
sl@0
|
112 |
// Test destruction
|
sl@0
|
113 |
}
|
sl@0
|
114 |
|
sl@0
|
115 |
// Test a New'd element object followed by delete
|
sl@0
|
116 |
{
|
sl@0
|
117 |
CFbsRalCacheEl *elTwo = 0;
|
sl@0
|
118 |
elTwo = CFbsRalCacheEl::New(KMbmFileTimew, (TAny*)0x58001000);
|
sl@0
|
119 |
TEST(elTwo != 0);
|
sl@0
|
120 |
TEST(elTwo->iFilename->CompareF(KMbmFileTimew) == 0);
|
sl@0
|
121 |
TEST(elTwo->iAddress == (TAny*)0x58001000);
|
sl@0
|
122 |
|
sl@0
|
123 |
delete elTwo;
|
sl@0
|
124 |
}
|
sl@0
|
125 |
|
sl@0
|
126 |
// Test a New'd element object followed by destroy & free
|
sl@0
|
127 |
{
|
sl@0
|
128 |
CFbsRalCacheEl *elThree = 0;
|
sl@0
|
129 |
elThree = CFbsRalCacheEl::New(KMbmFileLafcursLong, (TAny*)0x58002000);
|
sl@0
|
130 |
TEST(elThree != 0);
|
sl@0
|
131 |
TEST(elThree->iFilename->CompareF(KMbmFileLafcursLong) == 0);
|
sl@0
|
132 |
TEST(elThree->iAddress == (TAny*)0x58002000);
|
sl@0
|
133 |
|
sl@0
|
134 |
elThree->~CFbsRalCacheEl();
|
sl@0
|
135 |
TEST(elThree->iFilename == 0);
|
sl@0
|
136 |
CFbsRalCacheEl::FreeOnly(elThree);
|
sl@0
|
137 |
TEST(elThree == 0);
|
sl@0
|
138 |
}
|
sl@0
|
139 |
|
sl@0
|
140 |
// Test matching of an element object
|
sl@0
|
141 |
{
|
sl@0
|
142 |
CFbsRalCacheEl *elFour = 0;
|
sl@0
|
143 |
elFour = CFbsRalCacheEl::New(KMbmFileTechview, (TAny*)0x58003000);
|
sl@0
|
144 |
TEST(elFour != 0);
|
sl@0
|
145 |
|
sl@0
|
146 |
TBool r2 = EFalse;
|
sl@0
|
147 |
r2 = elFour->MatchKey (KMbmFileEikon);
|
sl@0
|
148 |
TEST(r2 == EFalse);
|
sl@0
|
149 |
|
sl@0
|
150 |
r2 = elFour->MatchKey (KMbmFileTechview);
|
sl@0
|
151 |
TEST(r2);
|
sl@0
|
152 |
|
sl@0
|
153 |
r2 = elFour->MatchKey(KMbmFileTechviewU);
|
sl@0
|
154 |
TEST(r2);
|
sl@0
|
155 |
|
sl@0
|
156 |
delete elFour;
|
sl@0
|
157 |
}
|
sl@0
|
158 |
}
|
sl@0
|
159 |
|
sl@0
|
160 |
/**
|
sl@0
|
161 |
@SYMTestCaseID
|
sl@0
|
162 |
GRAPHICS-FBSERV-0605
|
sl@0
|
163 |
|
sl@0
|
164 |
@SYMTestCaseDesc
|
sl@0
|
165 |
Tests the RALC Cache class.
|
sl@0
|
166 |
|
sl@0
|
167 |
@SYMTestActions
|
sl@0
|
168 |
Connect to the file server. Creates a CFbsRalCache
|
sl@0
|
169 |
object on the heap. Deletes the object.
|
sl@0
|
170 |
Test the lookup facility of the cache with overflow.
|
sl@0
|
171 |
|
sl@0
|
172 |
@SYMTestExpectedResults
|
sl@0
|
173 |
Test should pass
|
sl@0
|
174 |
*/
|
sl@0
|
175 |
void CTRalc::TestRALCCacheClass()
|
sl@0
|
176 |
{
|
sl@0
|
177 |
RFs fileServer;
|
sl@0
|
178 |
TInt ret;
|
sl@0
|
179 |
|
sl@0
|
180 |
ret = fileServer.Connect();
|
sl@0
|
181 |
TEST(ret==KErrNone);
|
sl@0
|
182 |
|
sl@0
|
183 |
INFO_PRINTF1(_L("Test of CFbsRalCache API"));
|
sl@0
|
184 |
|
sl@0
|
185 |
// Test the construction/destruction API
|
sl@0
|
186 |
{
|
sl@0
|
187 |
CFbsRalCache* cache1 = CFbsRalCache::New(0, fileServer);
|
sl@0
|
188 |
TEST(cache1 == 0);
|
sl@0
|
189 |
|
sl@0
|
190 |
cache1 = CFbsRalCache::New(5, fileServer);
|
sl@0
|
191 |
TEST(cache1 != 0);
|
sl@0
|
192 |
TEST(cache1->Count() == 0);
|
sl@0
|
193 |
TEST(cache1->Length() == 5);
|
sl@0
|
194 |
|
sl@0
|
195 |
delete cache1;
|
sl@0
|
196 |
}
|
sl@0
|
197 |
|
sl@0
|
198 |
// Test the lookup facility of the cache with overflow
|
sl@0
|
199 |
{
|
sl@0
|
200 |
CFbsRalCache* cache2 = CFbsRalCache::New(2, fileServer);
|
sl@0
|
201 |
|
sl@0
|
202 |
TAny* p1;
|
sl@0
|
203 |
p1 = cache2->Lookup(KMbmFileLafcurs);
|
sl@0
|
204 |
TEST(p1 != 0);
|
sl@0
|
205 |
TEST(cache2->Count() == 1);
|
sl@0
|
206 |
|
sl@0
|
207 |
p1 = cache2->Lookup(KMbmFileShel);
|
sl@0
|
208 |
TEST(p1 == 0);
|
sl@0
|
209 |
TEST(cache2->Count() == 1);
|
sl@0
|
210 |
|
sl@0
|
211 |
p1 = cache2->Lookup(KMbmFileShell);
|
sl@0
|
212 |
TEST(p1 != 0);
|
sl@0
|
213 |
TEST(cache2->Count() == 2);
|
sl@0
|
214 |
|
sl@0
|
215 |
p1 = cache2->Lookup(KMbmFileEikon);
|
sl@0
|
216 |
TEST(p1 != 0);
|
sl@0
|
217 |
TEST(cache2->Count() == 2);
|
sl@0
|
218 |
|
sl@0
|
219 |
delete cache2;
|
sl@0
|
220 |
}
|
sl@0
|
221 |
|
sl@0
|
222 |
fileServer.Close();
|
sl@0
|
223 |
}
|
sl@0
|
224 |
|
sl@0
|
225 |
/**
|
sl@0
|
226 |
@SYMTestCaseID
|
sl@0
|
227 |
GRAPHICS-FBSERV-0606
|
sl@0
|
228 |
|
sl@0
|
229 |
@SYMTestCaseDesc
|
sl@0
|
230 |
Tests Out Of Memory conditions for the CFbsRalCache class.
|
sl@0
|
231 |
|
sl@0
|
232 |
@SYMTestActions
|
sl@0
|
233 |
Connects to the file server. Sets a macro
|
sl@0
|
234 |
that makes heap allocation fail after a certain
|
sl@0
|
235 |
number of heap allocations. Creates a CFbsRalCache
|
sl@0
|
236 |
object on the heap. Deletes the object. Closes the file
|
sl@0
|
237 |
server handle.
|
sl@0
|
238 |
|
sl@0
|
239 |
@SYMTestExpectedResults
|
sl@0
|
240 |
Test should pass
|
sl@0
|
241 |
*/
|
sl@0
|
242 |
void CTRalc::TestOOMCondition()
|
sl@0
|
243 |
{
|
sl@0
|
244 |
RFs fileServer;
|
sl@0
|
245 |
TInt ret;
|
sl@0
|
246 |
ret = fileServer.Connect();
|
sl@0
|
247 |
TEST(ret==KErrNone);
|
sl@0
|
248 |
|
sl@0
|
249 |
INFO_PRINTF1(_L("Test of CFbsRalCache and OOM"));
|
sl@0
|
250 |
|
sl@0
|
251 |
for (TInt count = 1; ; count++)
|
sl@0
|
252 |
{
|
sl@0
|
253 |
__UHEAP_SETFAIL(RHeap::EDeterministic,count);
|
sl@0
|
254 |
__UHEAP_MARK;
|
sl@0
|
255 |
|
sl@0
|
256 |
CFbsRalCache* cache = 0;
|
sl@0
|
257 |
cache = CFbsRalCache::New(4, fileServer);
|
sl@0
|
258 |
|
sl@0
|
259 |
if (cache == 0)
|
sl@0
|
260 |
{
|
sl@0
|
261 |
__UHEAP_MARKEND;
|
sl@0
|
262 |
}
|
sl@0
|
263 |
else
|
sl@0
|
264 |
{
|
sl@0
|
265 |
delete cache;
|
sl@0
|
266 |
__UHEAP_MARKEND;
|
sl@0
|
267 |
__UHEAP_SETFAIL(RHeap::ENone,count);
|
sl@0
|
268 |
break;
|
sl@0
|
269 |
}
|
sl@0
|
270 |
}
|
sl@0
|
271 |
|
sl@0
|
272 |
fileServer.Close();
|
sl@0
|
273 |
}
|
sl@0
|
274 |
|
sl@0
|
275 |
/**
|
sl@0
|
276 |
@SYMTestCaseID
|
sl@0
|
277 |
GRAPHICS-FBSERV-0607
|
sl@0
|
278 |
|
sl@0
|
279 |
@SYMTestCaseDesc
|
sl@0
|
280 |
Intended to measure performance of bitmap loading.
|
sl@0
|
281 |
|
sl@0
|
282 |
@SYMTestActions
|
sl@0
|
283 |
Creates to CFbsBitmap objects on the stack and
|
sl@0
|
284 |
loads a bitmap file in to objects in a loop.
|
sl@0
|
285 |
Test case is not complete.
|
sl@0
|
286 |
|
sl@0
|
287 |
@SYMTestExpectedResults
|
sl@0
|
288 |
No test result is given in the function.
|
sl@0
|
289 |
*/
|
sl@0
|
290 |
void CTRalc::MeasurePerformanceWith2()
|
sl@0
|
291 |
{
|
sl@0
|
292 |
TInt loopI;
|
sl@0
|
293 |
CFbsBitmap bitmap1;
|
sl@0
|
294 |
CFbsBitmap bitmap2;
|
sl@0
|
295 |
|
sl@0
|
296 |
INFO_PRINTF1(_L("Performance Test with 2 Lookups"));
|
sl@0
|
297 |
|
sl@0
|
298 |
for (loopI=0; loopI<2700; loopI++)
|
sl@0
|
299 |
bitmap1.Load(KMbmFileLafcurs, 0, EFalse);
|
sl@0
|
300 |
|
sl@0
|
301 |
for (loopI=0; loopI<600; loopI++)
|
sl@0
|
302 |
bitmap2.Load(KMbmFileShell, 0, EFalse);
|
sl@0
|
303 |
|
sl@0
|
304 |
/* RDebug::ProfileEnd(10);
|
sl@0
|
305 |
TProfile profile;
|
sl@0
|
306 |
RDebug::ProfileResult(&profile,10,1);
|
sl@0
|
307 |
RDebug::Print(_L("Performance test end %d.%d s\n"),profile.iTime/1000000,(profile.iTime/1000)%1000); */
|
sl@0
|
308 |
}
|
sl@0
|
309 |
|
sl@0
|
310 |
/**
|
sl@0
|
311 |
@SYMTestCaseID
|
sl@0
|
312 |
GRAPHICS-FBSERV-0609
|
sl@0
|
313 |
|
sl@0
|
314 |
@SYMTestCaseDesc
|
sl@0
|
315 |
Intended to measure performance of bitmap loading.
|
sl@0
|
316 |
|
sl@0
|
317 |
@SYMTestActions
|
sl@0
|
318 |
Creates to CFbsBitmap objects on the stack and
|
sl@0
|
319 |
loads a bitmap file in to objects in a loop.
|
sl@0
|
320 |
Test case is not complete.
|
sl@0
|
321 |
|
sl@0
|
322 |
@SYMTestExpectedResults
|
sl@0
|
323 |
No test result is given in the function.
|
sl@0
|
324 |
*/
|
sl@0
|
325 |
void CTRalc::MeasurePerformanceWith2Long()
|
sl@0
|
326 |
{
|
sl@0
|
327 |
TInt loopI;
|
sl@0
|
328 |
CFbsBitmap bitmap1;
|
sl@0
|
329 |
CFbsBitmap bitmap2;
|
sl@0
|
330 |
|
sl@0
|
331 |
INFO_PRINTF1(_L("Performance Test with 2 LONG Lookups"));
|
sl@0
|
332 |
// RDebug::ProfileReset(10, 1);
|
sl@0
|
333 |
// RDebug::ProfileStart(10);
|
sl@0
|
334 |
|
sl@0
|
335 |
for (loopI=0; loopI<2700; loopI++)
|
sl@0
|
336 |
(void)bitmap1.Load(KMbmFileLafcursLong, 0, EFalse);
|
sl@0
|
337 |
|
sl@0
|
338 |
for (loopI=0; loopI<600; loopI++)
|
sl@0
|
339 |
(void)bitmap2.Load(KMbmFileShellLong, 0, EFalse);
|
sl@0
|
340 |
|
sl@0
|
341 |
/* RDebug::ProfileEnd(10);
|
sl@0
|
342 |
TProfile profile;
|
sl@0
|
343 |
RDebug::ProfileResult(&profile,10,1);
|
sl@0
|
344 |
RDebug::Print(_L("Performance test end %d.%d s\n"),profile.iTime/1000000,(profile.iTime/1000)%1000); */
|
sl@0
|
345 |
}
|
sl@0
|
346 |
|
sl@0
|
347 |
/**
|
sl@0
|
348 |
@SYMTestCaseID
|
sl@0
|
349 |
GRAPHICS-FBSERV-0608
|
sl@0
|
350 |
|
sl@0
|
351 |
@SYMTestCaseDesc
|
sl@0
|
352 |
Intended to measure performance of bitmap loading.
|
sl@0
|
353 |
|
sl@0
|
354 |
@SYMTestActions
|
sl@0
|
355 |
Creates five CFbsBitmap objects on the stack and
|
sl@0
|
356 |
loads different bitmap files in to the objects in a loop.
|
sl@0
|
357 |
|
sl@0
|
358 |
@SYMTestExpectedResults
|
sl@0
|
359 |
No test result is given in the function.
|
sl@0
|
360 |
*/
|
sl@0
|
361 |
void CTRalc::MeasurePerformanceWith5()
|
sl@0
|
362 |
{
|
sl@0
|
363 |
TInt loopI;
|
sl@0
|
364 |
CFbsBitmap bitmap1;
|
sl@0
|
365 |
CFbsBitmap bitmap2;
|
sl@0
|
366 |
CFbsBitmap bitmap3;
|
sl@0
|
367 |
CFbsBitmap bitmap4;
|
sl@0
|
368 |
CFbsBitmap bitmap5;
|
sl@0
|
369 |
|
sl@0
|
370 |
INFO_PRINTF1(_L("Performance Test with 5 Lookups"));
|
sl@0
|
371 |
// RDebug::ProfileReset(10, 1);
|
sl@0
|
372 |
// RDebug::ProfileStart(10);
|
sl@0
|
373 |
|
sl@0
|
374 |
for (loopI=0; loopI<500; loopI++)
|
sl@0
|
375 |
bitmap1.Load(KMbmFileEikon, 0, EFalse);
|
sl@0
|
376 |
|
sl@0
|
377 |
for (loopI=0; loopI<200; loopI++)
|
sl@0
|
378 |
bitmap2.Load(KMbmFileTechview, 0, EFalse);
|
sl@0
|
379 |
|
sl@0
|
380 |
for (loopI=0; loopI<2700; loopI++)
|
sl@0
|
381 |
bitmap3.Load(KMbmFileLafcurs, 0, EFalse);
|
sl@0
|
382 |
|
sl@0
|
383 |
for (loopI=0; loopI<600; loopI++)
|
sl@0
|
384 |
bitmap4.Load(KMbmFileShell, 0, EFalse);
|
sl@0
|
385 |
|
sl@0
|
386 |
for (loopI=0; loopI<1100; loopI++)
|
sl@0
|
387 |
bitmap5.Load(KMbmFileTimew, 0, EFalse);
|
sl@0
|
388 |
|
sl@0
|
389 |
/* RDebug::ProfileEnd(10);
|
sl@0
|
390 |
TProfile profile;
|
sl@0
|
391 |
RDebug::ProfileResult(&profile,10,1);
|
sl@0
|
392 |
RDebug::Print(_L("Performance test end %d.%d s\n"),profile.iTime/1000000,(profile.iTime/1000)%1000); */
|
sl@0
|
393 |
}
|
sl@0
|
394 |
|
sl@0
|
395 |
/**
|
sl@0
|
396 |
@SYMTestCaseID
|
sl@0
|
397 |
GRAPHICS-FBSERV-0610
|
sl@0
|
398 |
|
sl@0
|
399 |
@SYMTestCaseDesc
|
sl@0
|
400 |
Intended to measure performance of bitmap loading.
|
sl@0
|
401 |
|
sl@0
|
402 |
@SYMTestActions
|
sl@0
|
403 |
Creates five CFbsBitmap objects on the stack and
|
sl@0
|
404 |
loads different bitmap files in to the objects in a loop.
|
sl@0
|
405 |
|
sl@0
|
406 |
@SYMTestExpectedResults
|
sl@0
|
407 |
No test result is given in the function.
|
sl@0
|
408 |
*/
|
sl@0
|
409 |
void CTRalc::MeasurePerformanceWith23Mix()
|
sl@0
|
410 |
{
|
sl@0
|
411 |
TInt loopI;
|
sl@0
|
412 |
CFbsBitmap bitmap1;
|
sl@0
|
413 |
CFbsBitmap bitmap2;
|
sl@0
|
414 |
CFbsBitmap bitmap3;
|
sl@0
|
415 |
CFbsBitmap bitmap4;
|
sl@0
|
416 |
CFbsBitmap bitmap5;
|
sl@0
|
417 |
|
sl@0
|
418 |
INFO_PRINTF1(_L("Performance Test with 2/3 Mix of Lookups"));
|
sl@0
|
419 |
// RDebug::ProfileReset(10, 1);
|
sl@0
|
420 |
// RDebug::ProfileStart(10);
|
sl@0
|
421 |
|
sl@0
|
422 |
for (loopI=0; loopI<500; loopI++)
|
sl@0
|
423 |
bitmap1.Load(KMbmFileEikon, 0, EFalse);
|
sl@0
|
424 |
|
sl@0
|
425 |
for (loopI=0; loopI<200; loopI++)
|
sl@0
|
426 |
bitmap2.Load(KMbmFileTechview, 0, EFalse);
|
sl@0
|
427 |
|
sl@0
|
428 |
for (loopI=0; loopI<2700; loopI++)
|
sl@0
|
429 |
bitmap3.Load(KMbmFileLafcursLong, 0, EFalse);
|
sl@0
|
430 |
|
sl@0
|
431 |
for (loopI=0; loopI<600; loopI++)
|
sl@0
|
432 |
bitmap4.Load(KMbmFileShellLong, 0, EFalse);
|
sl@0
|
433 |
|
sl@0
|
434 |
for (loopI=0; loopI<1100; loopI++)
|
sl@0
|
435 |
bitmap5.Load(KMbmFileTimew, 0, EFalse);
|
sl@0
|
436 |
|
sl@0
|
437 |
/* RDebug::ProfileEnd(10);
|
sl@0
|
438 |
TProfile profile;
|
sl@0
|
439 |
RDebug::ProfileResult(&profile,10,1);
|
sl@0
|
440 |
RDebug::Print(_L("Performance test end %d.%d s\n"),profile.iTime/1000000,(profile.iTime/1000)%1000);*/
|
sl@0
|
441 |
}
|
sl@0
|
442 |
|
sl@0
|
443 |
void CTRalc::RunTestCaseL(TInt aCurTestCase)
|
sl@0
|
444 |
{
|
sl@0
|
445 |
TUint32* romAddress = NULL;
|
sl@0
|
446 |
if(!CFbsBitmap::IsFileInRom(KMbmFileEikon, romAddress)) //check any rom bitmap
|
sl@0
|
447 |
{
|
sl@0
|
448 |
INFO_PRINTF2(_L("Skipping CFbsRalCache tests since file \"%S\" is reported to not be a ROM bitmap."),
|
sl@0
|
449 |
&KMbmFileEikon);
|
sl@0
|
450 |
INFO_PRINTF1(_L("This should only occur on non-XIP ROMs, e.g. NAND ROMs, where ROM bitmaps aren't supported."));
|
sl@0
|
451 |
TestComplete();
|
sl@0
|
452 |
}
|
sl@0
|
453 |
else
|
sl@0
|
454 |
{
|
sl@0
|
455 |
((CTRalcStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
|
sl@0
|
456 |
switch(aCurTestCase)
|
sl@0
|
457 |
{
|
sl@0
|
458 |
case 1:
|
sl@0
|
459 |
((CTRalcStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0604"));
|
sl@0
|
460 |
TestRALCEntryClass();
|
sl@0
|
461 |
break;
|
sl@0
|
462 |
case 2:
|
sl@0
|
463 |
((CTRalcStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0605"));
|
sl@0
|
464 |
TestRALCCacheClass();
|
sl@0
|
465 |
break;
|
sl@0
|
466 |
case 3:
|
sl@0
|
467 |
((CTRalcStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0606"));
|
sl@0
|
468 |
TestOOMCondition();
|
sl@0
|
469 |
break;
|
sl@0
|
470 |
case 4:
|
sl@0
|
471 |
((CTRalcStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0607"));
|
sl@0
|
472 |
MeasurePerformanceWith2();
|
sl@0
|
473 |
break;
|
sl@0
|
474 |
case 5:
|
sl@0
|
475 |
((CTRalcStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0608"));
|
sl@0
|
476 |
MeasurePerformanceWith5();
|
sl@0
|
477 |
break;
|
sl@0
|
478 |
case 6:
|
sl@0
|
479 |
((CTRalcStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0609"));
|
sl@0
|
480 |
MeasurePerformanceWith2Long();
|
sl@0
|
481 |
break;
|
sl@0
|
482 |
case 7:
|
sl@0
|
483 |
((CTRalcStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0610"));
|
sl@0
|
484 |
MeasurePerformanceWith23Mix();
|
sl@0
|
485 |
break;
|
sl@0
|
486 |
case 8:
|
sl@0
|
487 |
((CTRalcStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
sl@0
|
488 |
((CTRalcStep*)iStep)->CloseTMSGraphicsStep();
|
sl@0
|
489 |
TestComplete();
|
sl@0
|
490 |
break;
|
sl@0
|
491 |
}
|
sl@0
|
492 |
((CTRalcStep*)iStep)->RecordTestResultL();
|
sl@0
|
493 |
}
|
sl@0
|
494 |
}
|
sl@0
|
495 |
|
sl@0
|
496 |
//--------------
|
sl@0
|
497 |
__CONSTRUCT_STEP__(Ralc)
|
sl@0
|
498 |
|
sl@0
|
499 |
void CTRalcStep::TestSetupL()
|
sl@0
|
500 |
{
|
sl@0
|
501 |
// Leaking thread handles
|
sl@0
|
502 |
iThread.HandleCount(iStartProcessHandleCount, iStartThreadHandleCount);
|
sl@0
|
503 |
}
|
sl@0
|
504 |
|
sl@0
|
505 |
void CTRalcStep::TestClose()
|
sl@0
|
506 |
{
|
sl@0
|
507 |
// Check for open handles
|
sl@0
|
508 |
iThread.HandleCount(iEndProcessHandleCount, iEndThreadHandleCount);
|
sl@0
|
509 |
if(iStartThreadHandleCount != iEndThreadHandleCount)
|
sl@0
|
510 |
{__DEBUGGER()} // Oops leaked some handles
|
sl@0
|
511 |
}
|