|
1 // Copyright (c) 2007-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 "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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 */ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32debug.h> |
|
23 #include "t_simloadutils.h" |
|
24 #include "t_simloadapp.h" |
|
25 |
|
26 GLDEF_C TInt E32Main() |
|
27 { |
|
28 RDebug::Print(_L("T_SimLoadApp3::E32Main - entry")); |
|
29 |
|
30 CTrapCleanup* TheTrapCleanup = CTrapCleanup::New(); |
|
31 |
|
32 TRAPD(err, StartTestL()); |
|
33 if (err) |
|
34 { |
|
35 User::Panic(KTSimLoadAppPanic,err); |
|
36 } |
|
37 |
|
38 delete TheTrapCleanup; |
|
39 |
|
40 RDebug::Print(_L("T_SimLoadApp3::E32Main - exit")); |
|
41 return KErrNone; |
|
42 } |
|
43 |
|
44 LOCAL_C void StartTestL(void) |
|
45 { |
|
46 TInt mySimLoad = CTSimLoadAppUtils::SimLoadL(); |
|
47 |
|
48 // static simulated load |
|
49 if (CTSimLoadAppUtils::IsStaticLoadL()) |
|
50 { |
|
51 // when simulating the static load there are 3 simload |
|
52 // apps executing at the same time. To harmonise the |
|
53 // load a different number (seed value) is passed |
|
54 // to the engine, hence 200000 in this case |
|
55 CTSimLoadAppUtils::SimulateStaticLoadL(mySimLoad, 200000); |
|
56 } |
|
57 else |
|
58 { |
|
59 // spiked simulated load |
|
60 // in a spiked load situation only simload1 |
|
61 // executes a spiked load pattern, whilst simload2 |
|
62 // and simload3 run in the background |
|
63 CTSimLoadAppUtils::SimulateStaticLoadL(0, 200000); |
|
64 } |
|
65 } |