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