|
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: test api of alf_core_toolkit |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <uiacceltk/huimesh.h> |
|
25 #include <uiacceltk/huienv.h> |
|
26 #include <uiacceltk/huicontrol.h> |
|
27 #include <uiacceltk/huilayout.h> |
|
28 #include <uiacceltk/huimeshvisual.h> |
|
29 #include <uiacceltk/huistatic.h> |
|
30 |
|
31 #include "testuiaifcoretoolkit.h" |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CTestUiAifCoreToolkit::TestCHuiMeshNewL |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 TInt CTestUiAifCoreToolkit::TestCHuiMeshNewL( CStifItemParser& /*aItem*/ ) |
|
38 { |
|
39 |
|
40 // Print to UI |
|
41 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
42 _LIT( KTestCHuiMesh, "In TestCHuiMeshNewL" ); |
|
43 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
44 // Print to log file |
|
45 iLog->Log( KTestCHuiMesh ); |
|
46 |
|
47 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
48 CleanupStack::PushL( mesh ); |
|
49 STIF_ASSERT_NOT_NULL( mesh ); |
|
50 CleanupStack::PopAndDestroy( mesh ); |
|
51 |
|
52 return KErrNone; |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CTestUiAifCoreToolkit::TestCHuiMeshNewLCL |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 TInt CTestUiAifCoreToolkit::TestCHuiMeshNewLCL( CStifItemParser& /*aItem*/ ) |
|
60 { |
|
61 |
|
62 // Print to UI |
|
63 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
64 _LIT( KTestCHuiMesh, "In TestCHuiMeshNewLCL" ); |
|
65 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
66 // Print to log file |
|
67 iLog->Log( KTestCHuiMesh ); |
|
68 |
|
69 CHuiMesh* mesh = CHuiMesh::NewLC( EHuiMeshTypeProcedural ); |
|
70 STIF_ASSERT_NOT_NULL( mesh ); |
|
71 CleanupStack::Pop(); |
|
72 delete mesh; |
|
73 mesh = NULL; |
|
74 |
|
75 return KErrNone; |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CTestUiAifCoreToolkit::TestCHuiMeshDestructL |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 TInt CTestUiAifCoreToolkit::TestCHuiMeshDestructL( CStifItemParser& /*aItem*/ ) |
|
83 { |
|
84 |
|
85 // Print to UI |
|
86 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
87 _LIT( KTestCHuiMesh, "In TestCHuiMeshDestructL" ); |
|
88 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
89 // Print to log file |
|
90 iLog->Log( KTestCHuiMesh ); |
|
91 |
|
92 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
93 CleanupStack::PushL( mesh ); |
|
94 STIF_ASSERT_NOT_NULL( mesh ); |
|
95 CleanupStack::PopAndDestroy( mesh ); |
|
96 |
|
97 return KErrNone; |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CTestUiAifCoreToolkit::TestCHuiMeshMeshTypeL |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 TInt CTestUiAifCoreToolkit::TestCHuiMeshMeshTypeL( CStifItemParser& /*aItem*/ ) |
|
105 { |
|
106 |
|
107 // Print to UI |
|
108 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
109 _LIT( KTestCHuiMesh, "In TestCHuiMeshMeshTypeL" ); |
|
110 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
111 // Print to log file |
|
112 iLog->Log( KTestCHuiMesh ); |
|
113 |
|
114 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
115 CleanupStack::PushL( mesh ); |
|
116 STIF_ASSERT_NOT_NULL( mesh ); |
|
117 THuiMeshType type = mesh->MeshType(); |
|
118 STIF_ASSERT_TRUE( type == EHuiMeshTypeProcedural ); |
|
119 CleanupStack::PopAndDestroy( mesh ); |
|
120 |
|
121 return KErrNone; |
|
122 } |
|
123 |
|
124 // ----------------------------------------------------------------------------- |
|
125 // CTestUiAifCoreToolkit::TestCHuiMeshResetL |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 TInt CTestUiAifCoreToolkit::TestCHuiMeshResetL( CStifItemParser& /*aItem*/ ) |
|
129 { |
|
130 |
|
131 // Print to UI |
|
132 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
133 _LIT( KTestCHuiMesh, "In TestCHuiMeshResetL" ); |
|
134 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
135 // Print to log file |
|
136 iLog->Log( KTestCHuiMesh ); |
|
137 |
|
138 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
139 CleanupStack::PushL( mesh ); |
|
140 STIF_ASSERT_NOT_NULL( mesh ); |
|
141 mesh->Reset(); |
|
142 CleanupStack::PopAndDestroy( mesh ); |
|
143 |
|
144 return KErrNone; |
|
145 } |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // CTestUiAifCoreToolkit::TestCHuiMeshStretchUniformlyL |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 TInt CTestUiAifCoreToolkit::TestCHuiMeshStretchUniformlyL( CStifItemParser& /*aItem*/ ) |
|
152 { |
|
153 |
|
154 // Print to UI |
|
155 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
156 _LIT( KTestCHuiMesh, "In TestCHuiMeshStretchUniformlyL" ); |
|
157 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
158 // Print to log file |
|
159 iLog->Log( KTestCHuiMesh ); |
|
160 |
|
161 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
162 CleanupStack::PushL( mesh ); |
|
163 STIF_ASSERT_NOT_NULL( mesh ); |
|
164 mesh->StretchUniformly( 0, 0, 0, 0, 0, 0 ); |
|
165 CleanupStack::PopAndDestroy( mesh ); |
|
166 |
|
167 return KErrNone; |
|
168 } |
|
169 |
|
170 // ----------------------------------------------------------------------------- |
|
171 // CTestUiAifCoreToolkit::TestCHuiMeshScaleUniformlyL |
|
172 // ----------------------------------------------------------------------------- |
|
173 // |
|
174 TInt CTestUiAifCoreToolkit::TestCHuiMeshScaleUniformlyL( CStifItemParser& /*aItem*/ ) |
|
175 { |
|
176 |
|
177 // Print to UI |
|
178 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
179 _LIT( KTestCHuiMesh, "In TestCHuiMeshScaleUniformlyL" ); |
|
180 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
181 // Print to log file |
|
182 iLog->Log( KTestCHuiMesh ); |
|
183 |
|
184 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
185 CleanupStack::PushL( mesh ); |
|
186 STIF_ASSERT_NOT_NULL( mesh ); |
|
187 mesh->ScaleUniformly( 0, 0, 0 ); |
|
188 CleanupStack::PopAndDestroy( mesh ); |
|
189 |
|
190 return KErrNone; |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // CTestUiAifCoreToolkit::TestCHuiMeshTypeL |
|
195 // ----------------------------------------------------------------------------- |
|
196 // |
|
197 TInt CTestUiAifCoreToolkit::TestCHuiMeshTypeL( CStifItemParser& /*aItem*/ ) |
|
198 { |
|
199 |
|
200 // Print to UI |
|
201 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
202 _LIT( KTestCHuiMesh, "In TestCHuiMeshTypeL" ); |
|
203 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
204 // Print to log file |
|
205 iLog->Log( KTestCHuiMesh ); |
|
206 |
|
207 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
208 CleanupStack::PushL( mesh ); |
|
209 STIF_ASSERT_NOT_NULL( mesh ); |
|
210 mesh->Type(); |
|
211 CleanupStack::PopAndDestroy( mesh ); |
|
212 |
|
213 return KErrNone; |
|
214 } |
|
215 |
|
216 // ----------------------------------------------------------------------------- |
|
217 // CTestUiAifCoreToolkit::TestCHuiMeshSessionIdL |
|
218 // ----------------------------------------------------------------------------- |
|
219 // |
|
220 TInt CTestUiAifCoreToolkit::TestCHuiMeshSessionIdL( CStifItemParser& /*aItem*/ ) |
|
221 { |
|
222 |
|
223 // Print to UI |
|
224 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
225 _LIT( KTestCHuiMesh, "In TestCHuiMeshSessionIdL" ); |
|
226 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
227 // Print to log file |
|
228 iLog->Log( KTestCHuiMesh ); |
|
229 |
|
230 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
231 CleanupStack::PushL( mesh ); |
|
232 STIF_ASSERT_NOT_NULL( mesh ); |
|
233 mesh->SessionId(); |
|
234 CleanupStack::PopAndDestroy( mesh ); |
|
235 |
|
236 return KErrNone; |
|
237 } |
|
238 |
|
239 // ----------------------------------------------------------------------------- |
|
240 // CTestUiAifCoreToolkit::TestCHuiMeshSetSessionIdL |
|
241 // ----------------------------------------------------------------------------- |
|
242 // |
|
243 TInt CTestUiAifCoreToolkit::TestCHuiMeshSetSessionIdL( CStifItemParser& /*aItem*/ ) |
|
244 { |
|
245 |
|
246 // Print to UI |
|
247 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
248 _LIT( KTestCHuiMesh, "In TestCHuiMeshSetSessionIdL" ); |
|
249 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
250 // Print to log file |
|
251 iLog->Log( KTestCHuiMesh ); |
|
252 |
|
253 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
254 CleanupStack::PushL( mesh ); |
|
255 STIF_ASSERT_NOT_NULL( mesh ); |
|
256 mesh->SetSessionId( 1 ); |
|
257 TInt id = mesh->SessionId(); |
|
258 STIF_ASSERT_EQUALS( id , 1 ); |
|
259 CleanupStack::PopAndDestroy( mesh ); |
|
260 |
|
261 return KErrNone; |
|
262 } |
|
263 |
|
264 // ----------------------------------------------------------------------------- |
|
265 // CTestUiAifCoreToolkit::TestCHuiMeshAnimationControllerCountL |
|
266 // ----------------------------------------------------------------------------- |
|
267 // |
|
268 TInt CTestUiAifCoreToolkit::TestCHuiMeshAnimationControllerCountL( CStifItemParser& /*aItem*/ ) |
|
269 { |
|
270 |
|
271 // Print to UI |
|
272 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
273 _LIT( KTestCHuiMesh, "In TestCHuiMeshAnimationControllerCountL" ); |
|
274 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
275 // Print to log file |
|
276 iLog->Log( KTestCHuiMesh ); |
|
277 |
|
278 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
279 CleanupStack::PushL( mesh ); |
|
280 STIF_ASSERT_NOT_NULL( mesh ); |
|
281 mesh->AnimationControllerCount(); |
|
282 CleanupStack::PopAndDestroy( mesh ); |
|
283 |
|
284 return KErrNone; |
|
285 } |
|
286 |
|
287 // ----------------------------------------------------------------------------- |
|
288 // CTestUiAifCoreToolkit::TestCHuiMeshSetAnimationPositionL |
|
289 // ----------------------------------------------------------------------------- |
|
290 // |
|
291 TInt CTestUiAifCoreToolkit::TestCHuiMeshSetAnimationPositionL( CStifItemParser& /*aItem*/ ) |
|
292 { |
|
293 |
|
294 // Print to UI |
|
295 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
296 _LIT( KTestCHuiMesh, "In TestCHuiMeshSetAnimationPositionL" ); |
|
297 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
298 // Print to log file |
|
299 iLog->Log( KTestCHuiMesh ); |
|
300 |
|
301 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
302 CleanupStack::PushL( mesh ); |
|
303 STIF_ASSERT_NOT_NULL( mesh ); |
|
304 mesh->SetAnimationPosition( 0 ,0 ,0 ); |
|
305 CleanupStack::PopAndDestroy( mesh ); |
|
306 |
|
307 return KErrNone; |
|
308 } |
|
309 |
|
310 // ----------------------------------------------------------------------------- |
|
311 // CTestUiAifCoreToolkit::TestCHuiMeshStartAnimationControllerL |
|
312 // ----------------------------------------------------------------------------- |
|
313 // |
|
314 TInt CTestUiAifCoreToolkit::TestCHuiMeshStartAnimationControllerL( CStifItemParser& /*aItem*/ ) |
|
315 { |
|
316 |
|
317 // Print to UI |
|
318 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
319 _LIT( KTestCHuiMesh, "In TestCHuiMeshStartAnimationControllerL" ); |
|
320 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
321 // Print to log file |
|
322 iLog->Log( KTestCHuiMesh ); |
|
323 |
|
324 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
325 CleanupStack::PushL( mesh ); |
|
326 STIF_ASSERT_NOT_NULL( mesh ); |
|
327 mesh->StartAnimationController( 0 ); |
|
328 CleanupStack::PopAndDestroy( mesh ); |
|
329 |
|
330 return KErrNone; |
|
331 } |
|
332 |
|
333 // ----------------------------------------------------------------------------- |
|
334 // CTestUiAifCoreToolkit::TestCHuiMeshStopAnimationControllerL |
|
335 // ----------------------------------------------------------------------------- |
|
336 // |
|
337 TInt CTestUiAifCoreToolkit::TestCHuiMeshStopAnimationControllerL( CStifItemParser& /*aItem*/ ) |
|
338 { |
|
339 |
|
340 // Print to UI |
|
341 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
342 _LIT( KTestCHuiMesh, "In TestCHuiMeshStopAnimationControllerL" ); |
|
343 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
344 // Print to log file |
|
345 iLog->Log( KTestCHuiMesh ); |
|
346 |
|
347 CHuiMesh* mesh = CHuiMesh::NewL( EHuiMeshTypeProcedural ); |
|
348 CleanupStack::PushL( mesh ); |
|
349 STIF_ASSERT_NOT_NULL( mesh ); |
|
350 mesh->StartAnimationController( 0 ); |
|
351 mesh->StopAnimationController( 0 ); |
|
352 CleanupStack::PopAndDestroy( mesh ); |
|
353 |
|
354 return KErrNone; |
|
355 } |