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: This file contains testclass implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 // [INCLUDE FILES] - do not remove |
|
19 #include <e32svr.h> |
|
20 #include <StifParser.h> |
|
21 #include <StifTestInterface.h> |
|
22 #include "TemplateScriptXXX.h" |
|
23 |
|
24 // EXTERNAL DATA STRUCTURES |
|
25 //extern ?external_data; |
|
26 |
|
27 // EXTERNAL FUNCTION PROTOTYPES |
|
28 //extern ?external_function( ?arg_type,?arg_type ); |
|
29 |
|
30 // CONSTANTS |
|
31 //const ?type ?constant_var = ?constant; |
|
32 |
|
33 // MACROS |
|
34 //#define ?macro ?macro_def |
|
35 |
|
36 // LOCAL CONSTANTS AND MACROS |
|
37 //const ?type ?constant_var = ?constant; |
|
38 //#define ?macro_name ?macro_def |
|
39 |
|
40 // MODULE DATA STRUCTURES |
|
41 //enum ?declaration |
|
42 //typedef ?declaration |
|
43 |
|
44 // LOCAL FUNCTION PROTOTYPES |
|
45 //?type ?function_name( ?arg_type, ?arg_type ); |
|
46 |
|
47 // FORWARD DECLARATIONS |
|
48 //class ?FORWARD_CLASSNAME; |
|
49 |
|
50 // ============================= LOCAL FUNCTIONS =============================== |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // ?function_name ?description. |
|
54 // ?description |
|
55 // Returns: ?value_1: ?description |
|
56 // ?value_n: ?description_line1 |
|
57 // ?description_line2 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 /* |
|
61 ?type ?function_name( |
|
62 ?arg_type arg, // ?description |
|
63 ?arg_type arg) // ?description |
|
64 { |
|
65 |
|
66 ?code // ?comment |
|
67 |
|
68 // ?comment |
|
69 ?code |
|
70 } |
|
71 */ |
|
72 |
|
73 // ============================ MEMBER FUNCTIONS =============================== |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CTemplateScriptXXX::Delete |
|
77 // Delete here all resources allocated and opened from test methods. |
|
78 // Called from destructor. |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 void CTemplateScriptXXX::Delete() |
|
82 { |
|
83 |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CTemplateScriptXXX::RunMethodL |
|
88 // Run specified method. Contains also table of test mothods and their names. |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 TInt CTemplateScriptXXX::RunMethodL( |
|
92 CStifItemParser& aItem ) |
|
93 { |
|
94 |
|
95 static TStifFunctionInfo const KFunctions[] = |
|
96 { |
|
97 // Copy this line for every implemented function. |
|
98 // First string is the function name used in TestScripter script file. |
|
99 // Second is the actual implementation member function. |
|
100 ENTRY( "Example", CTemplateScriptXXX::ExampleL ), |
|
101 //ADD NEW ENTRY HERE |
|
102 // [test cases entries] - Do not remove |
|
103 |
|
104 }; |
|
105 |
|
106 const TInt count = sizeof( KFunctions ) / |
|
107 sizeof( TStifFunctionInfo ); |
|
108 |
|
109 return RunInternalL( KFunctions, count, aItem ); |
|
110 |
|
111 } |
|
112 |
|
113 // ----------------------------------------------------------------------------- |
|
114 // CTemplateScriptXXX::ExampleL |
|
115 // Example test method function. |
|
116 // (other items were commented in a header). |
|
117 // ----------------------------------------------------------------------------- |
|
118 // |
|
119 TInt CTemplateScriptXXX::ExampleL( CStifItemParser& aItem ) |
|
120 { |
|
121 |
|
122 // Print to UI |
|
123 _LIT( KTemplateScriptXXX, "TemplateScriptXXX" ); |
|
124 _LIT( KExample, "In Example" ); |
|
125 TestModuleIf().Printf( 0, KTemplateScriptXXX, KExample ); |
|
126 // Print to log file |
|
127 iLog->Log( KExample ); |
|
128 |
|
129 TInt i = 0; |
|
130 TPtrC string; |
|
131 _LIT( KParam, "Param[%i]: %S" ); |
|
132 while ( aItem.GetNextString ( string ) == KErrNone ) |
|
133 { |
|
134 TestModuleIf().Printf( i, KTemplateScriptXXX, |
|
135 KParam, i, &string ); |
|
136 i++; |
|
137 } |
|
138 |
|
139 return KErrNone; |
|
140 |
|
141 } |
|
142 |
|
143 // ----------------------------------------------------------------------------- |
|
144 // CTemplateScriptXXX::?member_function |
|
145 // ?implementation_description |
|
146 // (other items were commented in a header). |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 /* |
|
150 TInt CTemplateScriptXXX::?member_function( |
|
151 CItemParser& aItem ) |
|
152 { |
|
153 |
|
154 ?code |
|
155 |
|
156 } |
|
157 */ |
|
158 |
|
159 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
160 // None |
|
161 |
|
162 // [End of File] - Do not remove |
|
163 |
|
164 // End of File |
|