|
1 /* |
|
2 * Copyright (c) 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 "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: Declaration of test class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MSGCENTERRFSPLUGINTEST_H |
|
20 #define C_MSGCENTERRFSPLUGINTEST_H |
|
21 |
|
22 // INCLUDES |
|
23 #if defined (_MSC_VER) && (_MSC_VER >= 1000) |
|
24 #pragma once |
|
25 #endif |
|
26 |
|
27 #include <testscripterinternal.h> |
|
28 #include "trace.h" |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 // None |
|
34 |
|
35 // DATA TYPES |
|
36 // None |
|
37 |
|
38 // FUNCTION PROTOTYPES |
|
39 // None |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CRFSPlugin; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 class CMsgCentreRfsPluginTest; |
|
46 class TCaseInfo; |
|
47 // DESCRIPTION |
|
48 // This a Test Module interface template |
|
49 // that does not really do anything. |
|
50 |
|
51 typedef TInt (CMsgCentreRfsPluginTest::* TestFunction)(TTestResult&); |
|
52 |
|
53 NONSHARABLE_CLASS(CMsgCentreRfsPluginTest) : public CScriptBase |
|
54 { |
|
55 public: // Enumerations |
|
56 |
|
57 private: // Enumerations |
|
58 |
|
59 public: // Constructors and destructor |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 static CMsgCentreRfsPluginTest* NewL(CTestModuleIf& aTestModuleIf); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 ~CMsgCentreRfsPluginTest(); |
|
70 |
|
71 public: // New functions |
|
72 |
|
73 public: // Functions from base classes |
|
74 |
|
75 TInt RunMethodL( CStifItemParser& aItem ); |
|
76 |
|
77 protected: // New functions |
|
78 |
|
79 TInt CreatePlugin( CStifItemParser& aItem ); |
|
80 TInt DestroyPlugin( CStifItemParser& aItem ); |
|
81 TInt RestoreFactorySettings( CStifItemParser& aItem ); |
|
82 TInt GetScript( CStifItemParser& aItem ); |
|
83 TInt ExecuteCustomCommand( CStifItemParser& aItem ); |
|
84 |
|
85 public: |
|
86 |
|
87 private: |
|
88 /** |
|
89 * C++ default constructor. |
|
90 */ |
|
91 CMsgCentreRfsPluginTest(CTestModuleIf& aTestModuleIf); |
|
92 |
|
93 /** |
|
94 * By default Symbian OS constructor is private. |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 /** |
|
99 * Function returning test case name and pointer to test case function |
|
100 */ |
|
101 const TCaseInfo Case ( const TInt aCaseNumber ) const; |
|
102 |
|
103 void ResetDataItems(); |
|
104 |
|
105 public: // Data |
|
106 |
|
107 protected: // Data |
|
108 |
|
109 private: // Data |
|
110 |
|
111 CRFSPlugin* iPlugin; |
|
112 TBool iTestResult; |
|
113 LOG_OBJECT_NEW |
|
114 |
|
115 public: // Friend classes |
|
116 |
|
117 protected: // Friend classes |
|
118 |
|
119 private: // Friend classes |
|
120 |
|
121 }; |
|
122 |
|
123 // Function pointer related internal definitions |
|
124 #ifndef __GCC32__ |
|
125 #define GETPTR |
|
126 #else |
|
127 #define GETPTR & |
|
128 #endif |
|
129 |
|
130 |
|
131 // An internal structure containing a test case name and |
|
132 // the pointer to function doing the test |
|
133 class TCaseInfoInternal |
|
134 { |
|
135 public: |
|
136 const TText* iCaseName; |
|
137 TestFunction iMethod; |
|
138 }; |
|
139 |
|
140 // An internal structure containing a test case name and |
|
141 // the pointer to function doing the test |
|
142 class TCaseInfo |
|
143 { |
|
144 public: |
|
145 TPtrC iCaseName; |
|
146 TestFunction iMethod; |
|
147 |
|
148 TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) |
|
149 { |
|
150 }; |
|
151 |
|
152 }; |
|
153 |
|
154 |
|
155 #endif // C_MSGCENTERRFSPLUGINTEST_H |
|
156 |
|
157 // End of File |