sl@0
|
1 |
// Copyright (c) 2007-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 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@test
|
sl@0
|
19 |
*/
|
sl@0
|
20 |
|
sl@0
|
21 |
#ifndef __T_SIM_LOAD_UTILS_H__
|
sl@0
|
22 |
#define __T_SIM_LOAD_UTILS_H__
|
sl@0
|
23 |
|
sl@0
|
24 |
#include <e32base.h>
|
sl@0
|
25 |
|
sl@0
|
26 |
_LIT(KDefaultSectionName, "default");
|
sl@0
|
27 |
|
sl@0
|
28 |
class CTSimLoadAppUtils
|
sl@0
|
29 |
{
|
sl@0
|
30 |
public:
|
sl@0
|
31 |
/**
|
sl@0
|
32 |
* Read in sim load type parameter from configuration file
|
sl@0
|
33 |
* created by test step, and indicate whether the type is
|
sl@0
|
34 |
* static.
|
sl@0
|
35 |
*
|
sl@0
|
36 |
* @return ETrue if static load specified.
|
sl@0
|
37 |
EFalse if spiked load specified
|
sl@0
|
38 |
* @leave KErrAbort if the load type cannot be determined,
|
sl@0
|
39 |
otherwise a system error code.
|
sl@0
|
40 |
*/
|
sl@0
|
41 |
IMPORT_C static TBool IsStaticLoadL();
|
sl@0
|
42 |
|
sl@0
|
43 |
/**
|
sl@0
|
44 |
* Read in the simload (as a percentage) config parameter from
|
sl@0
|
45 |
* configuration file created by test step.
|
sl@0
|
46 |
*
|
sl@0
|
47 |
* @return The simulated load that the app (in
|
sl@0
|
48 |
* combination with 2 other apps) is to achieve.
|
sl@0
|
49 |
* @leave System error code.
|
sl@0
|
50 |
*/
|
sl@0
|
51 |
IMPORT_C static TInt SimLoadL();
|
sl@0
|
52 |
|
sl@0
|
53 |
/**
|
sl@0
|
54 |
* Given a load percentage, and seed value for delay, create a load that when
|
sl@0
|
55 |
* combined with 2 other sim load apps produce the load percentage passed in.
|
sl@0
|
56 |
*
|
sl@0
|
57 |
* @param aLoadPercentage The simulated load that the app (in
|
sl@0
|
58 |
* combination with 2 other apps) is to achieve.
|
sl@0
|
59 |
* @param aDelay Seed value which harmonises the load pattern.
|
sl@0
|
60 |
* @leave System wide error code
|
sl@0
|
61 |
*/
|
sl@0
|
62 |
IMPORT_C static void SimulateStaticLoadL(TInt aLoadPercentage, TInt aDelay);
|
sl@0
|
63 |
|
sl@0
|
64 |
/**
|
sl@0
|
65 |
* Simulates a spiked load, e.g. 100% load for short period of time, at regular
|
sl@0
|
66 |
* spaced intervals, to simulate the load produced when for example a phone
|
sl@0
|
67 |
* call is received.
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
IMPORT_C static void SimulateSpikedLoad();
|
sl@0
|
70 |
|
sl@0
|
71 |
private:
|
sl@0
|
72 |
CTSimLoadAppUtils() {}
|
sl@0
|
73 |
static void SimulateTestLoad(TInt, TInt);
|
sl@0
|
74 |
static TInt CalculateSimLoadL(TInt);
|
sl@0
|
75 |
};
|
sl@0
|
76 |
|
sl@0
|
77 |
#endif // __T_SIM_LOAD_UTILS_H__
|
sl@0
|
78 |
|