|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 */ |
|
24 |
|
25 |
|
26 #ifndef __TUISUPPORTSTEP_H__ |
|
27 #define __TUISUPPORTSTEP_H__ |
|
28 |
|
29 #include <test/testexecutestepbase.h> |
|
30 |
|
31 namespace Swi |
|
32 { |
|
33 class TAppInfo; |
|
34 class RUiHandler; |
|
35 |
|
36 namespace Test |
|
37 { |
|
38 |
|
39 class CDaemonTestStep : public CTestStep |
|
40 { |
|
41 const static int KErrConfigRead = -18912; //To Do Get an error code |
|
42 |
|
43 protected: |
|
44 |
|
45 // wrapper functions, leave with KErrConfigRead if there's an error |
|
46 TBool CheckedGetIntFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult); |
|
47 TBool CheckedGetStringFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult); |
|
48 TBool CheckedGetBoolFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TBool& aResult); |
|
49 |
|
50 TBool CheckedGetIntFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult, const TDesC& aObjectName); |
|
51 TBool CheckedGetStringFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult, const TDesC& aObjectName); |
|
52 TBool CheckedGetBoolFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TBool& aResult, const TDesC& aObjectName); |
|
53 |
|
54 virtual TVerdict doTestStepL(); |
|
55 virtual TVerdict runTestStepL(TBool aOomTest)=0; |
|
56 |
|
57 /** |
|
58 * Used by the test step to free memory, before HEAP_MARK_END |
|
59 */ |
|
60 virtual void FreeMemory(); |
|
61 |
|
62 void ReadIntReturnValueL(TInt& aValue); |
|
63 void ReadBoolReturnValueL(TBool& aValue); |
|
64 |
|
65 template <class T> |
|
66 void ReadEnumL(T& aValue, const TDesC& aName); |
|
67 |
|
68 private: |
|
69 }; |
|
70 |
|
71 template <class T> |
|
72 void CDaemonTestStep::ReadEnumL(T& aValue, const TDesC& aName) |
|
73 { |
|
74 TInt value; |
|
75 CheckedGetIntFromConfigL(ConfigSection(), aName, value); |
|
76 aValue=T(value); |
|
77 } |
|
78 |
|
79 } // namespace Swi::Test |
|
80 |
|
81 } //namespace Swi |
|
82 |
|
83 #endif // #ifndef __TUISUPPORTSTEP_H__ |
|
84 |