|
1 /* |
|
2 * Copyright (c) 2002-2007 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 "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: FSQ Test DLL |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DEMOMODULE_H |
|
20 #define DEMOMODULE_H |
|
21 |
|
22 // INCLUDES |
|
23 #if defined (_MSC_VER) && (_MSC_VER >= 1000) |
|
24 #pragma once |
|
25 #endif |
|
26 |
|
27 #include <StifTestModule.h> |
|
28 #include "TestFramework/testsuite.h" |
|
29 |
|
30 // CONSTANTS |
|
31 // None |
|
32 |
|
33 // MACROS |
|
34 // None |
|
35 |
|
36 // DATA TYPES |
|
37 // None |
|
38 |
|
39 // FUNCTION PROTOTYPES |
|
40 // None |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 class CTestModule; |
|
44 class TCaseInfo; |
|
45 |
|
46 // CLASS DECLARATION |
|
47 |
|
48 |
|
49 // DESCRIPTION |
|
50 // Demo testmodule class definition. |
|
51 NONSHARABLE_CLASS( CTestModule ) |
|
52 :public CTestModuleBase |
|
53 { |
|
54 public: // Enumerations |
|
55 // None |
|
56 |
|
57 private: // Enumerations |
|
58 // None |
|
59 |
|
60 public: // Constructors and destructor |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 */ |
|
65 static CTestModule* NewL(); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 ~CTestModule(); |
|
71 |
|
72 public: // New functions |
|
73 // None |
|
74 |
|
75 public: // Functions from base classes |
|
76 |
|
77 /** |
|
78 * Test cases are inquired from the Test Module by calling GetTestCases. |
|
79 * Test cases are appended to RPointerArray<TTestCaseInfo>& aTestCases |
|
80 * that is a list consisting of several TTestCaseInfo objects. |
|
81 */ |
|
82 TInt GetTestCasesL( const TFileName& aConfigFile, |
|
83 RPointerArray<TTestCaseInfo>& aTestCases ); |
|
84 /** |
|
85 * RunTestCase is used to run an individual test case. |
|
86 */ |
|
87 TInt RunTestCaseL( const TInt aCaseNumber, |
|
88 const TFileName& aConfig, |
|
89 TTestResult& aResult ); |
|
90 |
|
91 protected: // New functions |
|
92 // None |
|
93 |
|
94 protected: // Functions from base classes |
|
95 // None |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * C++ default constructor. |
|
101 */ |
|
102 CTestModule(); |
|
103 |
|
104 /** |
|
105 * Symbian OS constructor. |
|
106 */ |
|
107 void ConstructL(); |
|
108 |
|
109 /** |
|
110 * Function returning test case name and pointer to test case function |
|
111 */ |
|
112 const TCaseInfo Case ( const TInt aCaseNumber ) const; |
|
113 |
|
114 void SetAllocFailureSimulation( RHeap::TAllocFail aAllocFailureType, TInt aAllocFailureRate ); |
|
115 void AllocFailureSimulation ( TBool aSwitchedOn ); |
|
116 |
|
117 void RunTestCaseInOOMLoopL( const TInt aCaseNumber, TTestResult& aResult ); |
|
118 |
|
119 private: // Data |
|
120 |
|
121 CTestSuite *iTestSuite ; |
|
122 CActiveScheduler* iScheduler; |
|
123 RHeap::TAllocFail iAllocFailureType; |
|
124 TInt iAllocFailureRate; |
|
125 TInt iCurrentAllocFailureRate; |
|
126 }; |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 #endif // DEMOMODULE_H |
|
132 |
|
133 // End of File |