|
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 the License "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: Tests phone features |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <e32svr.h> |
|
23 #include <StifParser.h> |
|
24 #include <Stiftestinterface.h> |
|
25 #include "tsysfeatures.h" |
|
26 #include "entitykeys.h" |
|
27 |
|
28 using namespace SysInfo; |
|
29 |
|
30 // EXTERNAL DATA STRUCTURES |
|
31 //extern ?external_data; |
|
32 |
|
33 // EXTERNAL FUNCTION PROTOTYPES |
|
34 //extern ?external_function( ?arg_type,?arg_type ); |
|
35 |
|
36 // CONSTANTS |
|
37 //const ?type ?constant_var = ?constant; |
|
38 |
|
39 // MACROS |
|
40 //#define ?macro ?macro_def |
|
41 |
|
42 // LOCAL CONSTANTS AND MACROS |
|
43 //const ?type ?constant_var = ?constant; |
|
44 //#define ?macro_name ?macro_def |
|
45 |
|
46 // MODULE DATA STRUCTURES |
|
47 //enum ?declaration |
|
48 //typedef ?declaration |
|
49 |
|
50 // LOCAL FUNCTION PROTOTYPES |
|
51 //?type ?function_name( ?arg_type, ?arg_type ); |
|
52 |
|
53 // FORWARD DECLARATIONS |
|
54 //class ?FORWARD_CLASSNAME; |
|
55 |
|
56 // ============================= LOCAL FUNCTIONS =============================== |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // ?function_name ?description. |
|
60 // ?description |
|
61 // Returns: ?value_1: ?description |
|
62 // ?value_n: ?description_line1 |
|
63 // ?description_line2 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 /* |
|
67 ?type ?function_name( |
|
68 ?arg_type arg, // ?description |
|
69 ?arg_type arg) // ?description |
|
70 { |
|
71 |
|
72 ?code // ?comment |
|
73 |
|
74 // ?comment |
|
75 ?code |
|
76 } |
|
77 */ |
|
78 |
|
79 // ============================ MEMBER FUNCTIONS =============================== |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // Ctsysfeatures::Delete |
|
83 // Delete here all resources allocated and opened from test methods. |
|
84 // Called from destructor. |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 void Ctsysfeatures::Delete() |
|
88 { |
|
89 |
|
90 } |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // Ctsysfeatures::RunMethodL |
|
94 // Run specified method. Contains also table of test mothods and their names. |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 TInt Ctsysfeatures::RunMethodL( |
|
98 CStifItemParser& aItem ) |
|
99 { |
|
100 |
|
101 static TStifFunctionInfo const KFunctions[] = |
|
102 { |
|
103 // Copy this line for every implemented function. |
|
104 // First string is the function name used in TestScripter script file. |
|
105 // Second is the actual implementation member function. |
|
106 ENTRY( "BlueTooth", Ctsysfeatures::BlueTooth ), |
|
107 ENTRY( "InfraRed", Ctsysfeatures::InfraRed ), |
|
108 ENTRY( "Camera", Ctsysfeatures::Camera ), |
|
109 ENTRY( "MemoryCard", Ctsysfeatures::MemoryCard ), |
|
110 ENTRY( "FMRadio", Ctsysfeatures::FMRadio ), |
|
111 ENTRY( "Qwerty", Ctsysfeatures::Qwerty ), |
|
112 ENTRY( "WLan", Ctsysfeatures::WLan ), |
|
113 ENTRY( "Usb", Ctsysfeatures::Usb ), |
|
114 ENTRY( "Pen", Ctsysfeatures::Pen ), |
|
115 ENTRY( "LED", Ctsysfeatures::LED ), |
|
116 ENTRY( "CoverUI", Ctsysfeatures::CoverUI ), |
|
117 ENTRY( "SideVolumeKeys", Ctsysfeatures::SideVolumeKeys ), |
|
118 ENTRY( "Vibra", Ctsysfeatures::Vibra ), |
|
119 ENTRY( "WrongKey", Ctsysfeatures::WrongKey ), |
|
120 |
|
121 |
|
122 }; |
|
123 |
|
124 const TInt count = sizeof( KFunctions ) / |
|
125 sizeof( TStifFunctionInfo ); |
|
126 |
|
127 return RunInternalL( KFunctions, count, aItem ); |
|
128 |
|
129 } |
|
130 |
|
131 // ----------------------------------------------------------------------------- |
|
132 // Ctsysfeatures::BlueTooth |
|
133 // Test method for checking Bluetooth feature |
|
134 // ----------------------------------------------------------------------------- |
|
135 // |
|
136 TInt Ctsysfeatures::BlueTooth( CStifItemParser& /*aItem*/ ) |
|
137 { |
|
138 |
|
139 __UHEAP_MARK; |
|
140 |
|
141 _LIT(KEntity,"Features") ; |
|
142 _LIT(KKey,"BlueTooth") ; |
|
143 |
|
144 TInt returnCode = KErrNone ; |
|
145 TInt expState = 0; |
|
146 TInt expDataType = 0 ; |
|
147 expState = FeatSupportInfo(KKey) ; |
|
148 |
|
149 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
150 |
|
151 if( NULL == CoreObj) |
|
152 { |
|
153 iLog->Log(_L8("Failed.. @Core")) ; |
|
154 return KErrGeneral ; |
|
155 } |
|
156 |
|
157 CSysData *sysData ; |
|
158 |
|
159 |
|
160 iLog->Log(_L8("expState : %d"),expState) ; |
|
161 |
|
162 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
163 |
|
164 if(KErrNone == leaveCode) |
|
165 { |
|
166 |
|
167 TInt retType = sysData->DataType() ; |
|
168 |
|
169 if(expDataType == retType) |
|
170 { |
|
171 |
|
172 CStatus *status = (CStatus*)sysData ; |
|
173 TInt retStatus = status->Status() ; |
|
174 |
|
175 if(expState != retStatus) |
|
176 { |
|
177 returnCode = KErrGeneral ; |
|
178 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
179 } |
|
180 else |
|
181 { |
|
182 iLog->Log(_L8("Passed..")) ; |
|
183 } |
|
184 |
|
185 } |
|
186 |
|
187 else |
|
188 { |
|
189 returnCode = KErrGeneral ; |
|
190 iLog->Log(_L8("Failed.. @retType")) ; |
|
191 } |
|
192 delete sysData ; |
|
193 |
|
194 } |
|
195 else |
|
196 { |
|
197 returnCode = KErrGeneral ; |
|
198 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
199 } |
|
200 delete CoreObj ; |
|
201 |
|
202 |
|
203 __UHEAP_MARKEND ; |
|
204 return returnCode ; |
|
205 |
|
206 |
|
207 } |
|
208 |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // Ctsysfeatures::InfraRed |
|
212 // Test method for checking InfraRed feature |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 TInt Ctsysfeatures::InfraRed( CStifItemParser& /*aItem*/ ) |
|
216 { |
|
217 |
|
218 __UHEAP_MARK; |
|
219 |
|
220 _LIT(KEntity,"Features") ; |
|
221 _LIT(KKey,"InfraRed") ; |
|
222 |
|
223 TInt returnCode = KErrNone ; |
|
224 TInt expState = 0; |
|
225 TInt expDataType = 0 ; |
|
226 expState = FeatSupportInfo(KKey) ; |
|
227 |
|
228 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
229 |
|
230 if( NULL == CoreObj) |
|
231 { |
|
232 iLog->Log(_L8("Failed.. @Core")) ; |
|
233 return KErrGeneral ; |
|
234 } |
|
235 |
|
236 CSysData *sysData ; |
|
237 |
|
238 |
|
239 iLog->Log(_L8("expState : %d"),expState) ; |
|
240 |
|
241 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
242 |
|
243 if(KErrNone == leaveCode) |
|
244 { |
|
245 |
|
246 TInt retType = sysData->DataType() ; |
|
247 |
|
248 if(expDataType == retType) |
|
249 { |
|
250 |
|
251 CStatus *status = (CStatus*)sysData ; |
|
252 TInt retStatus = status->Status() ; |
|
253 |
|
254 if(expState != retStatus) |
|
255 { |
|
256 returnCode = KErrGeneral ; |
|
257 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
258 } |
|
259 else |
|
260 { |
|
261 iLog->Log(_L8("Passed..")) ; |
|
262 } |
|
263 |
|
264 } |
|
265 |
|
266 else |
|
267 { |
|
268 returnCode = KErrGeneral ; |
|
269 iLog->Log(_L8("Failed.. @retType")) ; |
|
270 } |
|
271 delete sysData ; |
|
272 |
|
273 } |
|
274 else |
|
275 { |
|
276 returnCode = KErrGeneral ; |
|
277 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
278 } |
|
279 delete CoreObj ; |
|
280 |
|
281 |
|
282 __UHEAP_MARKEND ; |
|
283 return returnCode ; |
|
284 |
|
285 |
|
286 } |
|
287 |
|
288 |
|
289 // ----------------------------------------------------------------------------- |
|
290 // Ctsysfeatures::Camera |
|
291 // Test method for checking Camera feature |
|
292 // ----------------------------------------------------------------------------- |
|
293 // |
|
294 TInt Ctsysfeatures::Camera( CStifItemParser& /*aItem*/ ) |
|
295 { |
|
296 |
|
297 __UHEAP_MARK; |
|
298 |
|
299 _LIT(KEntity,"Features") ; |
|
300 _LIT(KKey,"Camera") ; |
|
301 |
|
302 TInt returnCode = KErrNone ; |
|
303 TInt expState = 0; |
|
304 TInt expDataType = 0 ; |
|
305 expState = FeatSupportInfo(KKey) ; |
|
306 |
|
307 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
308 |
|
309 if( NULL == CoreObj) |
|
310 { |
|
311 iLog->Log(_L8("Failed.. @Core")) ; |
|
312 return KErrGeneral ; |
|
313 } |
|
314 |
|
315 CSysData *sysData ; |
|
316 |
|
317 |
|
318 iLog->Log(_L8("expState : %d"),expState) ; |
|
319 |
|
320 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
321 |
|
322 if(KErrNone == leaveCode) |
|
323 { |
|
324 |
|
325 TInt retType = sysData->DataType() ; |
|
326 |
|
327 if(expDataType == retType) |
|
328 { |
|
329 |
|
330 CStatus *status = (CStatus*)sysData ; |
|
331 TInt retStatus = status->Status() ; |
|
332 |
|
333 if(expState != retStatus) |
|
334 { |
|
335 returnCode = KErrGeneral ; |
|
336 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
337 } |
|
338 else |
|
339 { |
|
340 iLog->Log(_L8("Passed..")) ; |
|
341 } |
|
342 |
|
343 } |
|
344 |
|
345 else |
|
346 { |
|
347 returnCode = KErrGeneral ; |
|
348 iLog->Log(_L8("Failed.. @retType")) ; |
|
349 } |
|
350 delete sysData ; |
|
351 |
|
352 } |
|
353 else |
|
354 { |
|
355 returnCode = KErrGeneral ; |
|
356 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
357 } |
|
358 delete CoreObj ; |
|
359 |
|
360 |
|
361 __UHEAP_MARKEND ; |
|
362 return returnCode ; |
|
363 |
|
364 |
|
365 } |
|
366 |
|
367 |
|
368 // ----------------------------------------------------------------------------- |
|
369 // Ctsysfeatures::MemoryCard |
|
370 // Test method for checking MemoryCard feature |
|
371 // ----------------------------------------------------------------------------- |
|
372 // |
|
373 TInt Ctsysfeatures::MemoryCard( CStifItemParser& /*aItem*/ ) |
|
374 { |
|
375 |
|
376 __UHEAP_MARK; |
|
377 |
|
378 _LIT(KEntity,"Features") ; |
|
379 _LIT(KKey,"MemoryCard") ; |
|
380 |
|
381 TInt returnCode = KErrNone ; |
|
382 TInt expState = 0; |
|
383 TInt expDataType = 0 ; |
|
384 expState = FeatSupportInfo(KKey) ; |
|
385 |
|
386 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
387 |
|
388 if( NULL == CoreObj) |
|
389 { |
|
390 iLog->Log(_L8("Failed.. @Core")) ; |
|
391 return KErrGeneral ; |
|
392 } |
|
393 |
|
394 CSysData *sysData ; |
|
395 |
|
396 |
|
397 iLog->Log(_L8("expState : %d"),expState) ; |
|
398 |
|
399 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
400 |
|
401 if(KErrNone == leaveCode) |
|
402 { |
|
403 |
|
404 TInt retType = sysData->DataType() ; |
|
405 |
|
406 if(expDataType == retType) |
|
407 { |
|
408 |
|
409 CStatus *status = (CStatus*)sysData ; |
|
410 TInt retStatus = status->Status() ; |
|
411 |
|
412 if(expState != retStatus) |
|
413 { |
|
414 returnCode = KErrGeneral ; |
|
415 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
416 } |
|
417 else |
|
418 { |
|
419 iLog->Log(_L8("Passed..")) ; |
|
420 } |
|
421 |
|
422 } |
|
423 |
|
424 else |
|
425 { |
|
426 returnCode = KErrGeneral ; |
|
427 iLog->Log(_L8("Failed.. @retType")) ; |
|
428 } |
|
429 delete sysData ; |
|
430 |
|
431 } |
|
432 else |
|
433 { |
|
434 returnCode = KErrGeneral ; |
|
435 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
436 } |
|
437 delete CoreObj ; |
|
438 |
|
439 |
|
440 __UHEAP_MARKEND ; |
|
441 return returnCode ; |
|
442 |
|
443 |
|
444 } |
|
445 |
|
446 |
|
447 // ----------------------------------------------------------------------------- |
|
448 // Ctsysfeatures::FMRadio |
|
449 // Test method for checking FMRadio feature |
|
450 // ----------------------------------------------------------------------------- |
|
451 // |
|
452 TInt Ctsysfeatures::FMRadio( CStifItemParser& /*aItem*/ ) |
|
453 { |
|
454 |
|
455 __UHEAP_MARK; |
|
456 |
|
457 _LIT(KEntity,"Features") ; |
|
458 _LIT(KKey,"FMRadio") ; |
|
459 |
|
460 TInt returnCode = KErrNone ; |
|
461 TInt expState = 0; |
|
462 TInt expDataType = 0 ; |
|
463 expState = FeatSupportInfo(KKey) ; |
|
464 |
|
465 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
466 |
|
467 if( NULL == CoreObj) |
|
468 { |
|
469 iLog->Log(_L8("Failed.. @Core")) ; |
|
470 return KErrGeneral ; |
|
471 } |
|
472 |
|
473 CSysData *sysData ; |
|
474 |
|
475 |
|
476 iLog->Log(_L8("expState : %d"),expState) ; |
|
477 |
|
478 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
479 |
|
480 if(KErrNone == leaveCode) |
|
481 { |
|
482 |
|
483 TInt retType = sysData->DataType() ; |
|
484 |
|
485 if(expDataType == retType) |
|
486 { |
|
487 |
|
488 CStatus *status = (CStatus*)sysData ; |
|
489 TInt retStatus = status->Status() ; |
|
490 |
|
491 if(expState != retStatus) |
|
492 { |
|
493 returnCode = KErrGeneral ; |
|
494 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
495 } |
|
496 else |
|
497 { |
|
498 iLog->Log(_L8("Passed..")) ; |
|
499 } |
|
500 |
|
501 } |
|
502 |
|
503 else |
|
504 { |
|
505 returnCode = KErrGeneral ; |
|
506 iLog->Log(_L8("Failed.. @retType")) ; |
|
507 } |
|
508 delete sysData ; |
|
509 |
|
510 } |
|
511 else |
|
512 { |
|
513 returnCode = KErrGeneral ; |
|
514 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
515 } |
|
516 delete CoreObj ; |
|
517 |
|
518 |
|
519 __UHEAP_MARKEND ; |
|
520 return returnCode ; |
|
521 |
|
522 |
|
523 } |
|
524 |
|
525 |
|
526 // ----------------------------------------------------------------------------- |
|
527 // Ctsysfeatures::Qwerty |
|
528 // Test method for checking Qwerty feature |
|
529 // ----------------------------------------------------------------------------- |
|
530 // |
|
531 TInt Ctsysfeatures::Qwerty( CStifItemParser& /*aItem*/ ) |
|
532 { |
|
533 |
|
534 __UHEAP_MARK; |
|
535 |
|
536 _LIT(KEntity,"Features") ; |
|
537 _LIT(KKey,"Qwerty") ; |
|
538 |
|
539 TInt returnCode = KErrNone ; |
|
540 TInt expState = 0; |
|
541 TInt expDataType = 0 ; |
|
542 expState = FeatSupportInfo(KKey) ; |
|
543 |
|
544 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
545 |
|
546 if( NULL == CoreObj) |
|
547 { |
|
548 iLog->Log(_L8("Failed.. @Core")) ; |
|
549 return KErrGeneral ; |
|
550 } |
|
551 |
|
552 CSysData *sysData ; |
|
553 |
|
554 |
|
555 iLog->Log(_L8("expState : %d"),expState) ; |
|
556 |
|
557 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
558 |
|
559 if(KErrNone == leaveCode) |
|
560 { |
|
561 |
|
562 TInt retType = sysData->DataType() ; |
|
563 |
|
564 if(expDataType == retType) |
|
565 { |
|
566 |
|
567 CStatus *status = (CStatus*)sysData ; |
|
568 TInt retStatus = status->Status() ; |
|
569 |
|
570 if(expState != retStatus) |
|
571 { |
|
572 returnCode = KErrGeneral ; |
|
573 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
574 } |
|
575 else |
|
576 { |
|
577 iLog->Log(_L8("Passed..")) ; |
|
578 } |
|
579 |
|
580 } |
|
581 |
|
582 else |
|
583 { |
|
584 returnCode = KErrGeneral ; |
|
585 iLog->Log(_L8("Failed.. @retType")) ; |
|
586 } |
|
587 delete sysData ; |
|
588 |
|
589 } |
|
590 else |
|
591 { |
|
592 returnCode = KErrGeneral ; |
|
593 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
594 } |
|
595 delete CoreObj ; |
|
596 |
|
597 |
|
598 __UHEAP_MARKEND ; |
|
599 return returnCode ; |
|
600 |
|
601 |
|
602 } |
|
603 |
|
604 |
|
605 // ----------------------------------------------------------------------------- |
|
606 // Ctsysfeatures::WLan |
|
607 // Test method for checking WLan feature |
|
608 // ----------------------------------------------------------------------------- |
|
609 // |
|
610 TInt Ctsysfeatures::WLan( CStifItemParser& /*aItem*/ ) |
|
611 { |
|
612 |
|
613 __UHEAP_MARK; |
|
614 |
|
615 _LIT(KEntity,"Features") ; |
|
616 _LIT(KKey,"WLan") ; |
|
617 |
|
618 TInt returnCode = KErrNone ; |
|
619 TInt expState = 0; |
|
620 TInt expDataType = 0 ; |
|
621 expState = FeatSupportInfo(KKey) ; |
|
622 |
|
623 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
624 |
|
625 if( NULL == CoreObj) |
|
626 { |
|
627 iLog->Log(_L8("Failed.. @Core")) ; |
|
628 return KErrGeneral ; |
|
629 } |
|
630 |
|
631 CSysData *sysData ; |
|
632 |
|
633 |
|
634 iLog->Log(_L8("expState : %d"),expState) ; |
|
635 |
|
636 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
637 |
|
638 if(KErrNone == leaveCode) |
|
639 { |
|
640 |
|
641 TInt retType = sysData->DataType() ; |
|
642 |
|
643 if(expDataType == retType) |
|
644 { |
|
645 |
|
646 CStatus *status = (CStatus*)sysData ; |
|
647 TInt retStatus = status->Status() ; |
|
648 |
|
649 if(expState != retStatus) |
|
650 { |
|
651 returnCode = KErrGeneral ; |
|
652 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
653 } |
|
654 else |
|
655 { |
|
656 iLog->Log(_L8("Passed..")) ; |
|
657 } |
|
658 |
|
659 } |
|
660 |
|
661 else |
|
662 { |
|
663 returnCode = KErrGeneral ; |
|
664 iLog->Log(_L8("Failed.. @retType")) ; |
|
665 } |
|
666 delete sysData ; |
|
667 |
|
668 } |
|
669 else |
|
670 { |
|
671 returnCode = KErrGeneral ; |
|
672 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
673 } |
|
674 delete CoreObj ; |
|
675 |
|
676 |
|
677 __UHEAP_MARKEND ; |
|
678 return returnCode ; |
|
679 |
|
680 |
|
681 } |
|
682 |
|
683 |
|
684 // ----------------------------------------------------------------------------- |
|
685 // Ctsysfeatures::Usb |
|
686 // Test method for checking Usb feature |
|
687 // ----------------------------------------------------------------------------- |
|
688 // |
|
689 TInt Ctsysfeatures::Usb( CStifItemParser& /*aItem*/ ) |
|
690 { |
|
691 |
|
692 __UHEAP_MARK; |
|
693 |
|
694 _LIT(KEntity,"Features") ; |
|
695 _LIT(KKey,"Usb") ; |
|
696 |
|
697 TInt returnCode = KErrNone ; |
|
698 TInt expState = 0; |
|
699 TInt expDataType = 0 ; |
|
700 expState = FeatSupportInfo(KKey) ; |
|
701 |
|
702 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
703 |
|
704 if( NULL == CoreObj) |
|
705 { |
|
706 iLog->Log(_L8("Failed.. @Core")) ; |
|
707 return KErrGeneral ; |
|
708 } |
|
709 |
|
710 |
|
711 CSysData *sysData ; |
|
712 |
|
713 |
|
714 iLog->Log(_L8("expState : %d"),expState) ; |
|
715 |
|
716 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
717 |
|
718 if(KErrNone == leaveCode) |
|
719 { |
|
720 |
|
721 TInt retType = sysData->DataType() ; |
|
722 |
|
723 if(expDataType == retType) |
|
724 { |
|
725 |
|
726 CStatus *status = (CStatus*)sysData ; |
|
727 TInt retStatus = status->Status() ; |
|
728 |
|
729 if(expState != retStatus) |
|
730 { |
|
731 returnCode = KErrGeneral ; |
|
732 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
733 } |
|
734 else |
|
735 { |
|
736 iLog->Log(_L8("Passed..")) ; |
|
737 } |
|
738 |
|
739 } |
|
740 |
|
741 else |
|
742 { |
|
743 returnCode = KErrGeneral ; |
|
744 iLog->Log(_L8("Failed.. @retType")) ; |
|
745 } |
|
746 delete sysData ; |
|
747 |
|
748 } |
|
749 else |
|
750 { |
|
751 returnCode = KErrGeneral ; |
|
752 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
753 } |
|
754 delete CoreObj ; |
|
755 |
|
756 |
|
757 __UHEAP_MARKEND ; |
|
758 return returnCode ; |
|
759 |
|
760 |
|
761 } |
|
762 |
|
763 |
|
764 // ----------------------------------------------------------------------------- |
|
765 // Ctsysfeatures::Pen |
|
766 // Test method for checking Pen feature |
|
767 // ----------------------------------------------------------------------------- |
|
768 // |
|
769 TInt Ctsysfeatures::Pen( CStifItemParser& /*aItem*/ ) |
|
770 { |
|
771 |
|
772 __UHEAP_MARK; |
|
773 |
|
774 _LIT(KEntity,"Features") ; |
|
775 _LIT(KKey,"Pen") ; |
|
776 |
|
777 TInt returnCode = KErrNone ; |
|
778 TInt expState = 0; |
|
779 TInt expDataType = 0 ; |
|
780 expState = FeatSupportInfo(KKey) ; |
|
781 |
|
782 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
783 |
|
784 if( NULL == CoreObj) |
|
785 { |
|
786 iLog->Log(_L8("Failed.. @Core")) ; |
|
787 return KErrGeneral ; |
|
788 } |
|
789 |
|
790 |
|
791 CSysData *sysData ; |
|
792 |
|
793 |
|
794 iLog->Log(_L8("expState : %d"),expState) ; |
|
795 |
|
796 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
797 |
|
798 if(KErrNone == leaveCode) |
|
799 { |
|
800 |
|
801 TInt retType = sysData->DataType() ; |
|
802 |
|
803 if(expDataType == retType) |
|
804 { |
|
805 |
|
806 CStatus *status = (CStatus*)sysData ; |
|
807 TInt retStatus = status->Status() ; |
|
808 |
|
809 if(expState != retStatus) |
|
810 { |
|
811 returnCode = KErrGeneral ; |
|
812 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
813 } |
|
814 else |
|
815 { |
|
816 iLog->Log(_L8("Passed..")) ; |
|
817 } |
|
818 |
|
819 } |
|
820 |
|
821 else |
|
822 { |
|
823 returnCode = KErrGeneral ; |
|
824 iLog->Log(_L8("Failed.. @retType")) ; |
|
825 } |
|
826 delete sysData ; |
|
827 |
|
828 } |
|
829 else |
|
830 { |
|
831 returnCode = KErrGeneral ; |
|
832 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
833 } |
|
834 delete CoreObj ; |
|
835 |
|
836 |
|
837 __UHEAP_MARKEND ; |
|
838 return returnCode ; |
|
839 |
|
840 |
|
841 } |
|
842 |
|
843 |
|
844 // ----------------------------------------------------------------------------- |
|
845 // Ctsysfeatures::LED |
|
846 // Test method for checking LED feature |
|
847 // ----------------------------------------------------------------------------- |
|
848 // |
|
849 TInt Ctsysfeatures::LED( CStifItemParser& /*aItem*/ ) |
|
850 { |
|
851 |
|
852 __UHEAP_MARK; |
|
853 |
|
854 _LIT(KEntity,"Features") ; |
|
855 _LIT(KKey,"LED") ; |
|
856 |
|
857 TInt returnCode = KErrNone ; |
|
858 TInt expState = 0; |
|
859 TInt expDataType = 0 ; |
|
860 expState = FeatSupportInfo(KKey) ; |
|
861 |
|
862 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
863 |
|
864 if( NULL == CoreObj) |
|
865 { |
|
866 iLog->Log(_L8("Failed.. @Core")) ; |
|
867 return KErrGeneral ; |
|
868 } |
|
869 |
|
870 CSysData *sysData ; |
|
871 |
|
872 |
|
873 iLog->Log(_L8("expState : %d"),expState) ; |
|
874 |
|
875 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
876 |
|
877 if(KErrNone == leaveCode) |
|
878 { |
|
879 |
|
880 TInt retType = sysData->DataType() ; |
|
881 |
|
882 if(expDataType == retType) |
|
883 { |
|
884 |
|
885 CStatus *status = (CStatus*)sysData ; |
|
886 TInt retStatus = status->Status() ; |
|
887 |
|
888 if(expState != retStatus) |
|
889 { |
|
890 returnCode = KErrGeneral ; |
|
891 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
892 } |
|
893 else |
|
894 { |
|
895 iLog->Log(_L8("Passed..")) ; |
|
896 } |
|
897 |
|
898 } |
|
899 |
|
900 else |
|
901 { |
|
902 returnCode = KErrGeneral ; |
|
903 iLog->Log(_L8("Failed.. @retType")) ; |
|
904 } |
|
905 delete sysData ; |
|
906 |
|
907 } |
|
908 else |
|
909 { |
|
910 returnCode = KErrGeneral ; |
|
911 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
912 } |
|
913 delete CoreObj ; |
|
914 |
|
915 |
|
916 __UHEAP_MARKEND ; |
|
917 return returnCode ; |
|
918 |
|
919 |
|
920 } |
|
921 |
|
922 |
|
923 // ----------------------------------------------------------------------------- |
|
924 // Ctsysfeatures::CoverUI |
|
925 // Test method for checking CoverUI feature |
|
926 // ----------------------------------------------------------------------------- |
|
927 // |
|
928 TInt Ctsysfeatures::CoverUI( CStifItemParser& /*aItem*/ ) |
|
929 { |
|
930 |
|
931 __UHEAP_MARK; |
|
932 |
|
933 _LIT(KEntity,"Features") ; |
|
934 _LIT(KKey,"CoverUI") ; |
|
935 |
|
936 TInt returnCode = KErrNone ; |
|
937 TInt expState = 0; |
|
938 TInt expDataType = 0 ; |
|
939 expState = FeatSupportInfo(KKey) ; |
|
940 |
|
941 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
942 |
|
943 if( NULL == CoreObj) |
|
944 { |
|
945 iLog->Log(_L8("Failed.. @Core")) ; |
|
946 return KErrGeneral ; |
|
947 } |
|
948 |
|
949 // CSysAttribute *attrib = CSysAttribute::NewL(KEntity,KKey) ; |
|
950 // TSysRequest sysReq(attrib) ; |
|
951 CSysData *sysData ; |
|
952 |
|
953 |
|
954 iLog->Log(_L8("expState : %d"),expState) ; |
|
955 |
|
956 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
957 |
|
958 if(KErrNone == leaveCode) |
|
959 { |
|
960 |
|
961 TInt retType = sysData->DataType() ; |
|
962 |
|
963 if(expDataType == retType) |
|
964 { |
|
965 |
|
966 CStatus *status = (CStatus*)sysData ; |
|
967 TInt retStatus = status->Status() ; |
|
968 |
|
969 if(expState != retStatus) |
|
970 { |
|
971 returnCode = KErrGeneral ; |
|
972 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
973 } |
|
974 else |
|
975 { |
|
976 iLog->Log(_L8("Passed..")) ; |
|
977 } |
|
978 |
|
979 } |
|
980 |
|
981 else |
|
982 { |
|
983 returnCode = KErrGeneral ; |
|
984 iLog->Log(_L8("Failed.. @retType")) ; |
|
985 } |
|
986 delete sysData ; |
|
987 |
|
988 } |
|
989 else |
|
990 { |
|
991 returnCode = KErrGeneral ; |
|
992 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
993 } |
|
994 delete CoreObj ; |
|
995 |
|
996 |
|
997 __UHEAP_MARKEND ; |
|
998 return returnCode ; |
|
999 |
|
1000 |
|
1001 } |
|
1002 |
|
1003 |
|
1004 // ----------------------------------------------------------------------------- |
|
1005 // Ctsysfeatures::SideVolumeKeys |
|
1006 // Test method for checking SideVolumeKeys feature |
|
1007 // ----------------------------------------------------------------------------- |
|
1008 // |
|
1009 TInt Ctsysfeatures::SideVolumeKeys( CStifItemParser& /*aItem*/ ) |
|
1010 { |
|
1011 |
|
1012 __UHEAP_MARK; |
|
1013 |
|
1014 _LIT(KEntity,"Features") ; |
|
1015 _LIT(KKey,"SideVolumeKeys") ; |
|
1016 |
|
1017 TInt returnCode = KErrNone ; |
|
1018 TInt expState = 0; |
|
1019 TInt expDataType = 0 ; |
|
1020 expState = FeatSupportInfo(KKey) ; |
|
1021 |
|
1022 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
1023 |
|
1024 if( NULL == CoreObj) |
|
1025 { |
|
1026 iLog->Log(_L8("Failed.. @Core")) ; |
|
1027 return KErrGeneral ; |
|
1028 } |
|
1029 |
|
1030 |
|
1031 CSysData *sysData ; |
|
1032 |
|
1033 |
|
1034 iLog->Log(_L8("expState : %d"),expState) ; |
|
1035 |
|
1036 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
1037 |
|
1038 if(KErrNone == leaveCode) |
|
1039 { |
|
1040 |
|
1041 TInt retType = sysData->DataType() ; |
|
1042 |
|
1043 if(expDataType == retType) |
|
1044 { |
|
1045 |
|
1046 CStatus *status = (CStatus*)sysData ; |
|
1047 TInt retStatus = status->Status() ; |
|
1048 |
|
1049 if(expState != retStatus) |
|
1050 { |
|
1051 returnCode = KErrGeneral ; |
|
1052 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
1053 } |
|
1054 else |
|
1055 { |
|
1056 iLog->Log(_L8("Passed..")) ; |
|
1057 } |
|
1058 |
|
1059 } |
|
1060 |
|
1061 else |
|
1062 { |
|
1063 returnCode = KErrGeneral ; |
|
1064 iLog->Log(_L8("Failed.. @retType")) ; |
|
1065 } |
|
1066 delete sysData ; |
|
1067 |
|
1068 } |
|
1069 else |
|
1070 { |
|
1071 returnCode = KErrGeneral ; |
|
1072 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
1073 } |
|
1074 delete CoreObj ; |
|
1075 |
|
1076 |
|
1077 __UHEAP_MARKEND ; |
|
1078 return returnCode ; |
|
1079 |
|
1080 |
|
1081 } |
|
1082 |
|
1083 |
|
1084 |
|
1085 // ----------------------------------------------------------------------------- |
|
1086 // Ctsysfeatures::Vibra |
|
1087 // Test method for checking Vibra feature |
|
1088 // ----------------------------------------------------------------------------- |
|
1089 // |
|
1090 TInt Ctsysfeatures::Vibra( CStifItemParser& /*aItem*/ ) |
|
1091 { |
|
1092 |
|
1093 __UHEAP_MARK; |
|
1094 |
|
1095 _LIT(KEntity,"Features") ; |
|
1096 _LIT(KKey,"Vibra") ; |
|
1097 |
|
1098 TInt returnCode = KErrNone ; |
|
1099 TInt expState = 0; |
|
1100 TInt expDataType = 0 ; |
|
1101 expState = FeatSupportInfo(KKey) ; |
|
1102 |
|
1103 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
1104 |
|
1105 if( NULL == CoreObj) |
|
1106 { |
|
1107 iLog->Log(_L8("Failed.. @Core")) ; |
|
1108 return KErrGeneral ; |
|
1109 } |
|
1110 |
|
1111 CSysData *sysData ; |
|
1112 |
|
1113 |
|
1114 iLog->Log(_L8("expState : %d"),expState) ; |
|
1115 |
|
1116 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData) ); |
|
1117 |
|
1118 if(KErrNone == leaveCode) |
|
1119 { |
|
1120 |
|
1121 TInt retType = sysData->DataType() ; |
|
1122 |
|
1123 if(expDataType == retType) |
|
1124 { |
|
1125 |
|
1126 CStatus *status = (CStatus*)sysData ; |
|
1127 TInt retStatus = status->Status() ; |
|
1128 |
|
1129 if(expState != retStatus) |
|
1130 { |
|
1131 returnCode = KErrGeneral ; |
|
1132 iLog->Log(_L8("Failed.. @retStatus")) ; |
|
1133 } |
|
1134 else |
|
1135 { |
|
1136 iLog->Log(_L8("Passed..")) ; |
|
1137 } |
|
1138 |
|
1139 } |
|
1140 |
|
1141 else |
|
1142 { |
|
1143 returnCode = KErrGeneral ; |
|
1144 iLog->Log(_L8("Failed.. @retType")) ; |
|
1145 } |
|
1146 delete sysData ; |
|
1147 |
|
1148 } |
|
1149 else |
|
1150 { |
|
1151 returnCode = KErrGeneral ; |
|
1152 iLog->Log(_L8("Failed.. @TRAPD")) ; |
|
1153 } |
|
1154 delete CoreObj ; |
|
1155 |
|
1156 |
|
1157 __UHEAP_MARKEND ; |
|
1158 return returnCode ; |
|
1159 |
|
1160 |
|
1161 } |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 // ----------------------------------------------------------------------------- |
|
1167 // Ctsysfeatures::WrongKey |
|
1168 // Test for wrong key input values |
|
1169 // ----------------------------------------------------------------------------- |
|
1170 // |
|
1171 TInt Ctsysfeatures::WrongKey( CStifItemParser& /*aItem*/ ) |
|
1172 { |
|
1173 |
|
1174 __UHEAP_MARK; |
|
1175 |
|
1176 _LIT(KEntity,"Features") ; |
|
1177 _LIT(KKey,"StatusCharging") ; |
|
1178 |
|
1179 TInt returnCode = KErrNone ; |
|
1180 |
|
1181 CSysInfoService *CoreObj = CSysInfoService :: NewL() ; |
|
1182 |
|
1183 if( NULL == CoreObj) |
|
1184 { |
|
1185 iLog->Log(_L8("Failed.. @Core")) ; |
|
1186 return KErrGeneral ; |
|
1187 } |
|
1188 |
|
1189 // CSysAttribute *attrib = CSysAttribute::NewL(KEntity,KKey) ; |
|
1190 // TSysRequest sysReq(attrib) ; |
|
1191 CSysData *sysData ; |
|
1192 |
|
1193 |
|
1194 |
|
1195 TRAPD(leaveCode, CoreObj->GetInfoL(KEntity,KKey,sysData)) ; |
|
1196 if(KErrNotFound == leaveCode) |
|
1197 { |
|
1198 iLog->Log(_L8("Passed..")) ; |
|
1199 } |
|
1200 else |
|
1201 { |
|
1202 returnCode = KErrGeneral ; |
|
1203 iLog->Log(_L8("Failed..")) ; |
|
1204 } |
|
1205 |
|
1206 delete CoreObj ; |
|
1207 // delete sysData ; |
|
1208 // delete attrib ; |
|
1209 |
|
1210 __UHEAP_MARKEND ; |
|
1211 return returnCode ; |
|
1212 |
|
1213 } |
|
1214 |
|
1215 |
|
1216 |
|
1217 // ----------------------------------------------------------------------------- |
|
1218 // Ctsysfeatures::WrongKey |
|
1219 // Test for wrong key input values |
|
1220 // ----------------------------------------------------------------------------- |
|
1221 // |
|
1222 TInt Ctsysfeatures::FeatSupportInfo( const TDesC& aFeature ) |
|
1223 { |
|
1224 |
|
1225 TInt featureID = 0 ; |
|
1226 |
|
1227 if( !aFeature.CompareF(KBlueTooth) ) |
|
1228 featureID = KFeatureIdBt; |
|
1229 else if( !aFeature.CompareF(KInfraRed) ) |
|
1230 featureID = KFeatureIdIrda; |
|
1231 else if( !aFeature.CompareF(KCamera) ) |
|
1232 featureID = KFeatureIdCamera; |
|
1233 else if( !aFeature.CompareF(KMemoryCard) ) |
|
1234 featureID = KFeatureIdMmc; |
|
1235 else if( !aFeature.CompareF(KFMRadio) ) |
|
1236 featureID = KFeatureIdFmRadio; |
|
1237 else if( !aFeature.CompareF(KQwerty) ) |
|
1238 featureID = KFeatureIdQwertyInput; |
|
1239 else if( !aFeature.CompareF(KWLan) ) |
|
1240 featureID = KFeatureIdProtocolWlan; |
|
1241 else if( !aFeature.CompareF(KUsb) ) |
|
1242 featureID = KFeatureIdUsb; |
|
1243 else if( !aFeature.CompareF(KPen) ) |
|
1244 featureID = KFeatureIdPenSupport; |
|
1245 else if( !aFeature.CompareF(KLED) ) |
|
1246 featureID = KFeatureIdPenSupport; |
|
1247 else if( !aFeature.CompareF(KCoverUI) ) |
|
1248 featureID = KFeatureIdCoverDisplay; |
|
1249 else if( !aFeature.CompareF(KSideVolumeKeys) ) |
|
1250 featureID = KFeatureIdSideVolumeKeys; |
|
1251 else if( !aFeature.CompareF(KVibra) ) |
|
1252 featureID = KFeatureIdVibra; |
|
1253 else |
|
1254 User::Leave(KErrNotFound); |
|
1255 |
|
1256 return(FeatureManager::FeatureSupported(featureID)); |
|
1257 } |
|
1258 // ----------------------------------------------------------------------------- |
|
1259 // Ctsysfeatures::?member_function |
|
1260 // ?implementation_description |
|
1261 // (other items were commented in a header). |
|
1262 // ----------------------------------------------------------------------------- |
|
1263 // |
|
1264 /* |
|
1265 TInt Ctsysfeatures::?member_function( |
|
1266 CItemParser& aItem ) |
|
1267 { |
|
1268 |
|
1269 ?code |
|
1270 |
|
1271 } |
|
1272 */ |
|
1273 |
|
1274 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
1275 // None |
|
1276 |
|
1277 // End of File |