|
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 <e32cmn.h> |
|
21 #include <StifParser.h> |
|
22 #include <Stiftestinterface.h> |
|
23 #include <data_caging_path_literals.hrh> |
|
24 #include <centralrepository.h> |
|
25 |
|
26 #include "SettingsTestModule.h" |
|
27 #include "cradiosettings.h" |
|
28 #include "cradiosettingsimp.h" |
|
29 #include "mradiosettingssetter.h" |
|
30 #include "mradioapplicationsettings.h" |
|
31 #include "mradioenginesettings.h" |
|
32 #include "radiointernalcrkeys.h" |
|
33 #include "radioengineutils.h" |
|
34 |
|
35 // EXTERNAL DATA STRUCTURES |
|
36 //extern ?external_data; |
|
37 |
|
38 // EXTERNAL FUNCTION PROTOTYPES |
|
39 //extern ?external_function( ?arg_type,?arg_type ); |
|
40 |
|
41 // CONSTANTS |
|
42 //const ?type ?constant_var = ?constant; |
|
43 //_LIT( KStifScriptEmptyString, "EMPTYSTRING" ); |
|
44 //_LIT( KEmptyString, "" ); |
|
45 |
|
46 // MACROS |
|
47 //#define ?macro ?macro_def |
|
48 |
|
49 // LOCAL CONSTANTS AND MACROS |
|
50 //const ?type ?constant_var = ?constant; |
|
51 //#define ?macro_name ?macro_def |
|
52 |
|
53 // MODULE DATA STRUCTURES |
|
54 //enum ?declaration |
|
55 //typedef ?declaration |
|
56 |
|
57 // LOCAL FUNCTION PROTOTYPES |
|
58 //?type ?function_name( ?arg_type, ?arg_type ); |
|
59 |
|
60 // FORWARD DECLARATIONS |
|
61 //class ?FORWARD_CLASSNAME; |
|
62 |
|
63 // ============================= LOCAL FUNCTIONS =============================== |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // ?function_name ?description. |
|
67 // ?description |
|
68 // Returns: ?value_1: ?description |
|
69 // ?value_n: ?description_line1 |
|
70 // ?description_line2 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 /* |
|
74 ?type ?function_name( |
|
75 ?arg_type arg, // ?description |
|
76 ?arg_type arg) // ?description |
|
77 { |
|
78 |
|
79 ?code // ?comment |
|
80 |
|
81 // ?comment |
|
82 ?code |
|
83 } |
|
84 */ |
|
85 |
|
86 // ============================ MEMBER FUNCTIONS =============================== |
|
87 |
|
88 // ----------------------------------------------------------------------------- |
|
89 // CPresetUtilityTestModule::Delete |
|
90 // Delete here all resources allocated and opened from test methods. |
|
91 // Called from destructor. |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 void CSettingsTestModule::Delete() |
|
95 { |
|
96 FUNC_LOG; |
|
97 |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CSettingsTestModule::RunMethodL |
|
102 // Run specified method. Contains also table of test mothods and their names. |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 TInt CSettingsTestModule::RunMethodL( |
|
106 CStifItemParser& aItem ) |
|
107 { |
|
108 FUNC_LOG; |
|
109 |
|
110 static TStifFunctionInfo const KFunctions[] = |
|
111 { |
|
112 // Copy this line for every implemented function. |
|
113 // First string is the function name used in TestScripter script file. |
|
114 // Second is the actual implementation member function. |
|
115 ENTRY( "Example", CSettingsTestModule::ExampleL ), |
|
116 // [test cases entries] - Do not remove |
|
117 ENTRY( "CreateSettingsL", CSettingsTestModule::CreateSettingsL ), |
|
118 ENTRY( "DestroySettingsL", CSettingsTestModule::DestroySettingsL ), |
|
119 ENTRY( "IsRegionAllowed", CSettingsTestModule::IsRegionAllowed ), |
|
120 ENTRY( "ResolveDriveL", CSettingsTestModule::ResolveDriveL ), |
|
121 ENTRY( "SetFirstTimeStartPerformed", CSettingsTestModule::SetFirstTimeStartPerformed ), |
|
122 ENTRY( "IsFirstTimeStart", CSettingsTestModule::IsFirstTimeStart ), |
|
123 ENTRY( "SetUiFlags", CSettingsTestModule::SetUiFlags ), |
|
124 ENTRY( "UiFlags", CSettingsTestModule::UiFlags ), |
|
125 ENTRY( "HeadsetVolume", CSettingsTestModule::HeadsetVolume ), |
|
126 ENTRY( "SpeakerVolume", CSettingsTestModule::SpeakerVolume ), |
|
127 ENTRY( "Volume", CSettingsTestModule::Volume ), |
|
128 ENTRY( "OutputMode", CSettingsTestModule::OutputMode ), |
|
129 ENTRY( "AudioRoute", CSettingsTestModule::AudioRoute ), |
|
130 ENTRY( "IsHeadsetVolMuted", CSettingsTestModule::IsHeadsetVolMuted ), |
|
131 ENTRY( "IsSpeakerVolMuted", CSettingsTestModule::IsSpeakerVolMuted ), |
|
132 ENTRY( "IsVolMuted", CSettingsTestModule::IsVolMuted ), |
|
133 ENTRY( "IsPowerOn", CSettingsTestModule::IsPowerOn ), |
|
134 ENTRY( "TunedFrequency", CSettingsTestModule::TunedFrequency ), |
|
135 ENTRY( "DefaultMinVolumeLevel", CSettingsTestModule::DefaultMinVolumeLevel ), |
|
136 ENTRY( "CountRegions", CSettingsTestModule::CountRegions ), |
|
137 ENTRY( "Region", CSettingsTestModule::Region ), |
|
138 ENTRY( "RegionId", CSettingsTestModule::RegionId ), |
|
139 ENTRY( "FrequencyStepSize", CSettingsTestModule::FrequencyStepSize ), |
|
140 ENTRY( "MaxFrequency", CSettingsTestModule::MaxFrequency ), |
|
141 ENTRY( "MinFrequency", CSettingsTestModule::MinFrequency ), |
|
142 ENTRY( "DecimalCount", CSettingsTestModule::DecimalCount ), |
|
143 ENTRY( "DefaultRegion", CSettingsTestModule::DefaultRegion ), |
|
144 ENTRY( "NetworkId", CSettingsTestModule::NetworkId ), |
|
145 ENTRY( "CountryCode", CSettingsTestModule::CountryCode ), |
|
146 ENTRY( "SetHeadsetVolume", CSettingsTestModule::SetHeadsetVolume ), |
|
147 ENTRY( "SetSpeakerVolume", CSettingsTestModule::SetSpeakerVolume ), |
|
148 ENTRY( "SetVolume", CSettingsTestModule::SetVolume ), |
|
149 ENTRY( "SetOutputMode", CSettingsTestModule::SetOutputMode ), |
|
150 ENTRY( "SetAudioRoute", CSettingsTestModule::SetAudioRoute ), |
|
151 ENTRY( "SetHeadsetVolMuted", CSettingsTestModule::SetHeadsetVolMuted ), |
|
152 ENTRY( "SetSpeakerVolMuted", CSettingsTestModule::SetSpeakerVolMuted ), |
|
153 ENTRY( "SetVolMuted", CSettingsTestModule::SetVolMuted ), |
|
154 ENTRY( "SetPowerOn", CSettingsTestModule::SetPowerOn ), |
|
155 ENTRY( "SetTunedFrequency", CSettingsTestModule::SetTunedFrequency ), |
|
156 ENTRY( "SetRegionId", CSettingsTestModule::SetRegionId ), |
|
157 ENTRY( "SetCountryCode", CSettingsTestModule::SetCountryCode ), |
|
158 ENTRY( "SetNetworkId", CSettingsTestModule::SetNetworkId ), |
|
159 ENTRY( "tstSetRegionIdL", CSettingsTestModule::tstSetRegionIdL ), |
|
160 ENTRY( "tstResetStartCount", CSettingsTestModule::tstResetStartCount ), |
|
161 ENTRY( "ReadConfigurableKeysL", CSettingsTestModule::ReadConfigurableKeysL ) |
|
162 //ADD NEW ENTRY HERE |
|
163 |
|
164 }; |
|
165 |
|
166 const TInt count = sizeof( KFunctions ) / |
|
167 sizeof( TStifFunctionInfo ); |
|
168 |
|
169 return RunInternalL( KFunctions, count, aItem ); |
|
170 |
|
171 } |
|
172 |
|
173 // ----------------------------------------------------------------------------- |
|
174 // CSettingsTestModule::ExampleL |
|
175 // Example test method function. |
|
176 // (other items were commented in a header). |
|
177 // ----------------------------------------------------------------------------- |
|
178 // |
|
179 TInt CSettingsTestModule::ExampleL( CStifItemParser& aItem ) |
|
180 { |
|
181 FUNC_LOG; |
|
182 |
|
183 // Print to UI |
|
184 _LIT( KSettingsTestModule, "SettingsTestModule" ); |
|
185 _LIT( KExample, "In Example" ); |
|
186 TestModuleIf().Printf( 0, KSettingsTestModule, KExample ); |
|
187 // Print to log file |
|
188 iLog->Log( KExample ); |
|
189 |
|
190 TInt i = 0; |
|
191 TPtrC string; |
|
192 _LIT( KParam, "Param[%i]: %S" ); |
|
193 while ( aItem.GetNextString ( string ) == KErrNone ) |
|
194 { |
|
195 TestModuleIf().Printf( i, KSettingsTestModule, |
|
196 KParam, i, &string ); |
|
197 i++; |
|
198 } |
|
199 |
|
200 return KErrNone; |
|
201 |
|
202 } |
|
203 |
|
204 //----------------------------------------------------------------------------- |
|
205 // CPresetUtilityTest::CreateSettingsL |
|
206 //----------------------------------------------------------------------------- |
|
207 TInt CSettingsTestModule::CreateSettingsL( |
|
208 CStifItemParser& /*aItem*/ ) |
|
209 { |
|
210 FUNC_LOG; |
|
211 |
|
212 TInt err = KErrNone; |
|
213 if( !iSettings ) |
|
214 { |
|
215 RadioEngineUtils::InitializeL(); |
|
216 TRAPD( err, iSettings = CRadioSettings::NewL() ); |
|
217 if ( KErrNone == err ) |
|
218 { |
|
219 iSettings->RadioSetter().SetObserver( this ); |
|
220 } |
|
221 else |
|
222 { |
|
223 RadioEngineUtils::Release(); |
|
224 INFO_1( "CRadioSettings::NewL() failed err = %i", err ) |
|
225 User::Leave(err ); |
|
226 } |
|
227 } |
|
228 else |
|
229 { |
|
230 err = KErrArgument; |
|
231 } |
|
232 |
|
233 return err; |
|
234 } |
|
235 |
|
236 |
|
237 //----------------------------------------------------------------------------- |
|
238 // CSettingsTestModule::DestroyiSettingsL |
|
239 //----------------------------------------------------------------------------- |
|
240 TInt CSettingsTestModule::DestroySettingsL( |
|
241 CStifItemParser& /*aItem*/ ) |
|
242 { |
|
243 FUNC_LOG; |
|
244 |
|
245 delete iSettings; |
|
246 iSettings = NULL; |
|
247 RadioEngineUtils::Release(); |
|
248 return KErrNone; |
|
249 } |
|
250 |
|
251 |
|
252 // ----------------------------------------------------------------------------- |
|
253 // CSettingsTestModule::ResolveDriveL() |
|
254 // Returns: Errors. |
|
255 // ----------------------------------------------------------------------------- |
|
256 TInt CSettingsTestModule::ResolveDriveL( CStifItemParser& /*aItem*/ ) |
|
257 { |
|
258 FUNC_LOG; |
|
259 TFileName resourceFileName; |
|
260 resourceFileName.Append( KRadioSettingsResourceFile ); |
|
261 iSettings->ResolveDriveL( resourceFileName, KDC_RESOURCE_FILES_DIR ); |
|
262 return KErrNone; |
|
263 } |
|
264 |
|
265 |
|
266 // ----------------------------------------------------------------------------- |
|
267 // CSettingsTestModule::IsRegionAllowed() |
|
268 // Returns: Errors. |
|
269 // ----------------------------------------------------------------------------- |
|
270 TInt CSettingsTestModule::IsRegionAllowed( CStifItemParser& /*aItem*/ ) |
|
271 { |
|
272 FUNC_LOG; |
|
273 TRadioRegion regionId( iSettings->EngineSettings().RegionId() ); |
|
274 TUint currentAllowedStatus( iSettings->IsRegionAllowed( regionId ) ); |
|
275 TInt err( KErrNone); |
|
276 INFO_1( "Failed: currentAllowedStatus=%i", currentAllowedStatus ); |
|
277 return err; |
|
278 |
|
279 } |
|
280 |
|
281 |
|
282 // ----------------------------------------------------------------------------- |
|
283 // CSettingsTestModule::IsFirstTimeStart() |
|
284 // Returns: Errors. |
|
285 // ----------------------------------------------------------------------------- |
|
286 TInt CSettingsTestModule::IsFirstTimeStart( CStifItemParser& aItem ) |
|
287 { |
|
288 FUNC_LOG; |
|
289 TInt err( KErrNone); |
|
290 TBool expectedFirstTimeStartStatus( EFalse ); |
|
291 // read parameters |
|
292 if ( aItem.GetNextInt(expectedFirstTimeStartStatus) ) |
|
293 { |
|
294 err = KErrBadTestParameter; |
|
295 ERROR( err, "Missing Parameter: expectedFirstTimeStartStatus." ); |
|
296 } |
|
297 TBool firstTimeStartStatus( iSettings->ApplicationSettings().IsFirstTimeStart() ); |
|
298 if ( expectedFirstTimeStartStatus != firstTimeStartStatus ) |
|
299 { |
|
300 INFO_2( "Failed: firstTimeStartStatus=%i, expectedFirstTimeStartStatus=%i.", firstTimeStartStatus, expectedFirstTimeStartStatus ); |
|
301 err = KErrUnexpectedValue; |
|
302 } |
|
303 return err; |
|
304 } |
|
305 |
|
306 // ----------------------------------------------------------------------------- |
|
307 // CSettingsTestModule::SetFirstTimeStart() |
|
308 // Returns: Errors. |
|
309 // ----------------------------------------------------------------------------- |
|
310 TInt CSettingsTestModule::SetFirstTimeStartPerformed( CStifItemParser& aItem ) |
|
311 { |
|
312 FUNC_LOG; |
|
313 TInt err( KErrNone ); |
|
314 TBool firstTimeStartPerformed( EFalse ); |
|
315 // read parameters |
|
316 if ( aItem.GetNextInt( firstTimeStartPerformed ) ) |
|
317 { |
|
318 err = KErrBadTestParameter; |
|
319 ERROR( err, "Missing Parameter: firstTimeStartPerformed." ); |
|
320 } |
|
321 |
|
322 iSettings->ApplicationSettings().SetFirstTimeStartPerformed( firstTimeStartPerformed ); |
|
323 return err; |
|
324 } |
|
325 |
|
326 |
|
327 |
|
328 // ----------------------------------------------------------------------------- |
|
329 // CSettingsTestModule::SetUiFlags() |
|
330 // Returns: Errors. |
|
331 // ----------------------------------------------------------------------------- |
|
332 TInt CSettingsTestModule::SetUiFlags( CStifItemParser& aItem ) |
|
333 { |
|
334 FUNC_LOG; |
|
335 TUint uiFlags( 0 ); |
|
336 TInt err( KErrNone ); |
|
337 |
|
338 // read parameters |
|
339 if ( aItem.GetNextInt(uiFlags) ) |
|
340 { |
|
341 err = KErrBadTestParameter; |
|
342 ERROR( err, "Missing Parameter: uiFlags." ); |
|
343 } |
|
344 err = iSettings->ApplicationSettings().SetUiFlags( uiFlags ); |
|
345 return err; |
|
346 } |
|
347 |
|
348 |
|
349 // ----------------------------------------------------------------------------- |
|
350 // CSettingsTestModule::UiFlags() |
|
351 // Returns: Errors. |
|
352 // ----------------------------------------------------------------------------- |
|
353 TInt CSettingsTestModule::UiFlags( CStifItemParser& aItem ) |
|
354 { |
|
355 FUNC_LOG; |
|
356 TUint expectedUiFlags( 0 ); |
|
357 TUint currentUiFlags( 0 ); |
|
358 TInt err( KErrNone ); |
|
359 |
|
360 // read parameters |
|
361 if ( aItem.GetNextInt(expectedUiFlags) ) |
|
362 { |
|
363 err = KErrBadTestParameter; |
|
364 ERROR( err, "Missing Parameter: expectedUiFlags." ); |
|
365 } |
|
366 currentUiFlags = iSettings->ApplicationSettings().UiFlags(); |
|
367 if ( expectedUiFlags != currentUiFlags ) |
|
368 { |
|
369 INFO_2( "Failed: currentUiFlags=%i, expectedUiFlags=%i.", currentUiFlags, expectedUiFlags ); |
|
370 err = KErrUnexpectedValue; |
|
371 } |
|
372 return err; |
|
373 } |
|
374 |
|
375 |
|
376 // ----------------------------------------------------------------------------- |
|
377 // CSettingsTestModule::HeadsetVolume() |
|
378 // Returns: Errors. |
|
379 // ----------------------------------------------------------------------------- |
|
380 TInt CSettingsTestModule::HeadsetVolume( CStifItemParser& aItem ) |
|
381 { |
|
382 FUNC_LOG; |
|
383 TUint expectedVolume( 0 ); |
|
384 TUint currentVolume( 0 ); |
|
385 TInt err( KErrNone ); |
|
386 |
|
387 // read parameters |
|
388 if ( aItem.GetNextInt(expectedVolume) ) |
|
389 { |
|
390 err = KErrBadTestParameter; |
|
391 ERROR( err, "Missing Parameter: expectedVolume." ); |
|
392 } |
|
393 currentVolume = iSettings->EngineSettings().HeadsetVolume(); |
|
394 if ( expectedVolume != currentVolume ) |
|
395 { |
|
396 INFO_2( "Failed: currentVolume=%i, expectedVolume=%i.", currentVolume, expectedVolume ); |
|
397 err = KErrUnexpectedValue; |
|
398 } |
|
399 return err; |
|
400 } |
|
401 |
|
402 |
|
403 // ----------------------------------------------------------------------------- |
|
404 // CSettingsTestModule::SetHeadsetVolume() |
|
405 // Returns: Errors. |
|
406 // ----------------------------------------------------------------------------- |
|
407 TInt CSettingsTestModule::SetHeadsetVolume( CStifItemParser& aItem ) |
|
408 { |
|
409 FUNC_LOG; |
|
410 TUint volume( 0 ); |
|
411 TInt err( KErrNone ); |
|
412 // read parameters |
|
413 if ( aItem.GetNextInt(volume) ) |
|
414 { |
|
415 err = KErrBadTestParameter; |
|
416 ERROR( err, "Missing Parameter: volume." ); |
|
417 } |
|
418 err = iSettings->RadioSetter().SetHeadsetVolume( volume ); |
|
419 return err; |
|
420 } |
|
421 |
|
422 // ----------------------------------------------------------------------------- |
|
423 // CSettingsTestModule::SpeakerVolume() |
|
424 // Returns: Errors. |
|
425 // ----------------------------------------------------------------------------- |
|
426 TInt CSettingsTestModule::SpeakerVolume( CStifItemParser& aItem ) |
|
427 { |
|
428 FUNC_LOG; |
|
429 TUint expectedVolume( 0 ); |
|
430 TUint currentVolume( 0 ); |
|
431 TInt err( KErrNone ); |
|
432 |
|
433 // read parameters |
|
434 if ( aItem.GetNextInt(expectedVolume) ) |
|
435 { |
|
436 err = KErrBadTestParameter; |
|
437 ERROR( err, "Missing Parameter: expectedVolume." ); |
|
438 } |
|
439 currentVolume = iSettings->EngineSettings().SpeakerVolume(); |
|
440 if ( expectedVolume != currentVolume ) |
|
441 { |
|
442 INFO_2( "Failed: currentVolume=%i, expectedVolume=%i.", currentVolume, expectedVolume ); |
|
443 err = KErrUnexpectedValue; |
|
444 } |
|
445 return err; |
|
446 } |
|
447 |
|
448 |
|
449 // ----------------------------------------------------------------------------- |
|
450 // CSettingsTestModule::SetSpeakerVolume() |
|
451 // Returns: Errors. |
|
452 // ----------------------------------------------------------------------------- |
|
453 TInt CSettingsTestModule::SetSpeakerVolume( CStifItemParser& aItem ) |
|
454 { |
|
455 FUNC_LOG; |
|
456 TUint volume( 0 ); |
|
457 TInt err( KErrNone ); |
|
458 |
|
459 // read parameters |
|
460 if ( aItem.GetNextInt(volume) ) |
|
461 { |
|
462 err = KErrBadTestParameter; |
|
463 ERROR( err, "Missing Parameter: volume." ); |
|
464 } |
|
465 err = iSettings->RadioSetter().SetSpeakerVolume( volume ); |
|
466 return err; |
|
467 } |
|
468 |
|
469 |
|
470 // ----------------------------------------------------------------------------- |
|
471 // CSettingsTestModule::Volume() |
|
472 // Returns: Errors. |
|
473 // ----------------------------------------------------------------------------- |
|
474 TInt CSettingsTestModule::Volume( CStifItemParser& aItem ) |
|
475 { |
|
476 FUNC_LOG; |
|
477 TUint expectedVolume( 0 ); |
|
478 TUint currentVolume( 0 ); |
|
479 TInt err( KErrNone ); |
|
480 |
|
481 // read parameters |
|
482 if ( aItem.GetNextInt(expectedVolume) ) |
|
483 { |
|
484 err = KErrBadTestParameter; |
|
485 ERROR( err, "Missing Parameter: expectedVolume." ); |
|
486 } |
|
487 currentVolume = iSettings->EngineSettings().Volume(); |
|
488 if ( expectedVolume != currentVolume ) |
|
489 { |
|
490 INFO_2( "Failed: currentVolume=%i, expectedVolume=%i.", currentVolume, expectedVolume ); |
|
491 err = KErrUnexpectedValue; |
|
492 } |
|
493 return err; |
|
494 } |
|
495 |
|
496 |
|
497 // ----------------------------------------------------------------------------- |
|
498 // CSettingsTestModule::SetVolume() |
|
499 // Returns: Errors. |
|
500 // ----------------------------------------------------------------------------- |
|
501 TInt CSettingsTestModule::SetVolume( CStifItemParser& aItem ) |
|
502 { |
|
503 FUNC_LOG; |
|
504 TUint volume( 0 ); |
|
505 TInt err( KErrNone ); |
|
506 |
|
507 // read parameters |
|
508 if ( aItem.GetNextInt(volume) ) |
|
509 { |
|
510 err = KErrBadTestParameter; |
|
511 ERROR( err, "Missing Parameter: volume." ); |
|
512 } |
|
513 err = iSettings->RadioSetter().SetVolume( volume ); |
|
514 return err; |
|
515 } |
|
516 |
|
517 |
|
518 |
|
519 // ----------------------------------------------------------------------------- |
|
520 // CSettingsTestModule::OutputMode() |
|
521 // Returns: Errors. |
|
522 // ----------------------------------------------------------------------------- |
|
523 TInt CSettingsTestModule::OutputMode( CStifItemParser& aItem ) |
|
524 { |
|
525 FUNC_LOG; |
|
526 TUint expectedMode( 0 ); |
|
527 TUint currentMode( 0 ); |
|
528 TInt err( KErrNone ); |
|
529 |
|
530 // read parameters |
|
531 if ( aItem.GetNextInt(expectedMode) ) |
|
532 { |
|
533 err = KErrBadTestParameter; |
|
534 ERROR( err, "Missing Parameter: expectedMode." ); |
|
535 } |
|
536 currentMode = iSettings->EngineSettings().OutputMode(); |
|
537 if ( expectedMode != currentMode ) |
|
538 { |
|
539 INFO_2( "Failed: currentMode=%i, expectedMode=%i.", currentMode, expectedMode ); |
|
540 err = KErrUnexpectedValue; |
|
541 } |
|
542 return err; |
|
543 } |
|
544 |
|
545 |
|
546 // ----------------------------------------------------------------------------- |
|
547 // CSettingsTestModule::SetOutputMode() |
|
548 // Returns: Errors. |
|
549 // ----------------------------------------------------------------------------- |
|
550 TInt CSettingsTestModule::SetOutputMode( CStifItemParser& aItem ) |
|
551 { |
|
552 FUNC_LOG; |
|
553 TUint mode( 0 ); |
|
554 TInt err( KErrNone ); |
|
555 |
|
556 // read parameters |
|
557 if ( aItem.GetNextInt(mode) ) |
|
558 { |
|
559 err = KErrBadTestParameter; |
|
560 ERROR( err, "Missing Parameter: mode." ); |
|
561 } |
|
562 err = iSettings->RadioSetter().SetOutputMode( mode ); |
|
563 return err; |
|
564 } |
|
565 |
|
566 |
|
567 // ----------------------------------------------------------------------------- |
|
568 // CSettingsTestModule::AudioRoute() |
|
569 // Returns: Errors. |
|
570 // ----------------------------------------------------------------------------- |
|
571 TInt CSettingsTestModule::AudioRoute( CStifItemParser& aItem ) |
|
572 { |
|
573 FUNC_LOG; |
|
574 TUint expectedRoute( 0 ); |
|
575 TUint currentRoute( 0 ); |
|
576 TInt err( KErrNone ); |
|
577 |
|
578 // read parameters |
|
579 if ( aItem.GetNextInt(expectedRoute) ) |
|
580 { |
|
581 err = KErrBadTestParameter; |
|
582 ERROR( err, "Missing Parameter: expectedRoute." ); |
|
583 } |
|
584 currentRoute = iSettings->EngineSettings().AudioRoute(); |
|
585 if ( expectedRoute != currentRoute ) |
|
586 { |
|
587 INFO_2( "Failed: currentMode=%i, expectedRoute=%i.", currentRoute, expectedRoute ); |
|
588 err = KErrUnexpectedValue; |
|
589 } |
|
590 return err; |
|
591 } |
|
592 |
|
593 // ----------------------------------------------------------------------------- |
|
594 // CSettingsTestModule::SetAudioRoute() |
|
595 // Returns: Errors. |
|
596 // ----------------------------------------------------------------------------- |
|
597 TInt CSettingsTestModule::SetAudioRoute( CStifItemParser& aItem ) |
|
598 { |
|
599 FUNC_LOG; |
|
600 TUint route( 0 ); |
|
601 TInt err( KErrNone ); |
|
602 |
|
603 // read parameters |
|
604 if ( aItem.GetNextInt(route) ) |
|
605 { |
|
606 err = KErrBadTestParameter; |
|
607 ERROR( err, "Missing Parameter: route." ); |
|
608 } |
|
609 err = iSettings->RadioSetter().SetAudioRoute( route ); |
|
610 return err; |
|
611 } |
|
612 |
|
613 // ----------------------------------------------------------------------------- |
|
614 // CSettingsTestModule::IsHeadsetVolMuted() |
|
615 // Returns: Errors. |
|
616 // ----------------------------------------------------------------------------- |
|
617 TInt CSettingsTestModule::IsHeadsetVolMuted( CStifItemParser& aItem ) |
|
618 { |
|
619 FUNC_LOG; |
|
620 TInt err( KErrNone ); |
|
621 TUint expectedMuteStatus( 0 ); |
|
622 TUint currentMuteStatus( 0 ); |
|
623 |
|
624 // read parameters |
|
625 if ( aItem.GetNextInt(expectedMuteStatus) ) |
|
626 { |
|
627 err = KErrBadTestParameter; |
|
628 ERROR( err, "Missing Parameter: expectedMuteStatus." ); |
|
629 } |
|
630 currentMuteStatus = iSettings->EngineSettings().IsHeadsetVolMuted(); |
|
631 if ( currentMuteStatus != expectedMuteStatus ) |
|
632 { |
|
633 INFO_2( "Failed: currentMuteStatus=%i, expectedMuteStatus=%i.", currentMuteStatus, expectedMuteStatus ); |
|
634 err = KErrUnexpectedValue; |
|
635 } |
|
636 return err; |
|
637 } |
|
638 |
|
639 |
|
640 // ----------------------------------------------------------------------------- |
|
641 // CSettingsTestModule::SetHeadsetVolMuted() |
|
642 // Returns: Errors. |
|
643 // ----------------------------------------------------------------------------- |
|
644 TInt CSettingsTestModule::SetHeadsetVolMuted( CStifItemParser& aItem ) |
|
645 { |
|
646 FUNC_LOG; |
|
647 TUint muteStatus( 0 ); |
|
648 TInt err( KErrNone ); |
|
649 |
|
650 // read parameters |
|
651 if ( aItem.GetNextInt(muteStatus) ) |
|
652 { |
|
653 err = KErrBadTestParameter; |
|
654 ERROR( err, "Missing Parameter: muteStatus." ); |
|
655 } |
|
656 err = iSettings->RadioSetter().SetHeadsetVolMuted( muteStatus ); |
|
657 return err; |
|
658 } |
|
659 |
|
660 |
|
661 // ----------------------------------------------------------------------------- |
|
662 // CSettingsTestModule::IsSpeakerVolMuted() |
|
663 // Returns: Errors. |
|
664 // ----------------------------------------------------------------------------- |
|
665 TInt CSettingsTestModule::IsSpeakerVolMuted( CStifItemParser& aItem ) |
|
666 { |
|
667 FUNC_LOG; |
|
668 TInt err( KErrNone ); |
|
669 TUint expectedMuteStatus( 0 ); |
|
670 TUint currentMuteStatus( 0 ); |
|
671 |
|
672 // read parameters |
|
673 if ( aItem.GetNextInt(expectedMuteStatus) ) |
|
674 { |
|
675 err = KErrBadTestParameter; |
|
676 ERROR( err, "Missing Parameter: expectedMuteStatus." ); |
|
677 } |
|
678 currentMuteStatus = iSettings->EngineSettings().IsSpeakerVolMuted(); |
|
679 if ( currentMuteStatus != expectedMuteStatus ) |
|
680 { |
|
681 INFO_2( "Failed: currentMuteStatus=%i, expectedMuteStatus=%i.", currentMuteStatus, expectedMuteStatus ); |
|
682 err = KErrUnexpectedValue; |
|
683 } |
|
684 return err; |
|
685 } |
|
686 |
|
687 |
|
688 // ----------------------------------------------------------------------------- |
|
689 // CSettingsTestModule::SetSpeakerVolMuted() |
|
690 // Returns: Errors. |
|
691 // ----------------------------------------------------------------------------- |
|
692 TInt CSettingsTestModule::SetSpeakerVolMuted( CStifItemParser& aItem ) |
|
693 { |
|
694 FUNC_LOG; |
|
695 TUint muteStatus( 0 ); |
|
696 TInt err( KErrNone ); |
|
697 |
|
698 // read parameters |
|
699 if ( aItem.GetNextInt(muteStatus) ) |
|
700 { |
|
701 err = KErrBadTestParameter; |
|
702 ERROR( err, "Missing Parameter: muteStatus." ); |
|
703 } |
|
704 err = iSettings->RadioSetter().SetSpeakerVolMuted( muteStatus ); |
|
705 return err; |
|
706 } |
|
707 |
|
708 |
|
709 // ----------------------------------------------------------------------------- |
|
710 // CSettingsTestModule::IsVolMuted() |
|
711 // Returns: Errors. |
|
712 // ----------------------------------------------------------------------------- |
|
713 TInt CSettingsTestModule::IsVolMuted( CStifItemParser& aItem ) |
|
714 { |
|
715 FUNC_LOG; |
|
716 TInt err( KErrNone ); |
|
717 TUint expectedMuteStatus( 0 ); |
|
718 TUint currentMuteStatus( 0 ); |
|
719 |
|
720 // read parameters |
|
721 if ( aItem.GetNextInt(expectedMuteStatus) ) |
|
722 { |
|
723 err = KErrBadTestParameter; |
|
724 ERROR( err, "Missing Parameter: expectedMuteStatus." ); |
|
725 } |
|
726 currentMuteStatus = iSettings->EngineSettings().IsVolMuted(); |
|
727 if ( currentMuteStatus != expectedMuteStatus ) |
|
728 { |
|
729 INFO_2( "Failed: currentMuteStatus=%i, expectedMuteStatus=%i.", currentMuteStatus, expectedMuteStatus ); |
|
730 err = KErrUnexpectedValue; |
|
731 } |
|
732 return err; |
|
733 } |
|
734 |
|
735 // ----------------------------------------------------------------------------- |
|
736 // CSettingsTestModule::SetVolMuted() |
|
737 // Returns: Errors. |
|
738 // ----------------------------------------------------------------------------- |
|
739 TInt CSettingsTestModule::SetVolMuted( CStifItemParser& aItem ) |
|
740 { |
|
741 FUNC_LOG; |
|
742 TUint muteStatus( 0 ); |
|
743 TInt err( KErrNone ); |
|
744 |
|
745 // read parameters |
|
746 if ( aItem.GetNextInt(muteStatus) ) |
|
747 { |
|
748 err = KErrBadTestParameter; |
|
749 ERROR( err, "Missing Parameter: muteStatus." ); |
|
750 } |
|
751 err = iSettings->RadioSetter().SetVolMuted( muteStatus ); |
|
752 return err; |
|
753 } |
|
754 |
|
755 |
|
756 // ----------------------------------------------------------------------------- |
|
757 // CSettingsTestModule::IsPowerOn() |
|
758 // Returns: Errors. |
|
759 // ----------------------------------------------------------------------------- |
|
760 TInt CSettingsTestModule::IsPowerOn( CStifItemParser& aItem ) |
|
761 { |
|
762 FUNC_LOG; |
|
763 TInt err( KErrNone ); |
|
764 TUint expectedPowerStatus( 0 ); |
|
765 TUint currentPowerStatus( 0 ); |
|
766 |
|
767 // read parameters |
|
768 if ( aItem.GetNextInt(expectedPowerStatus) ) |
|
769 { |
|
770 err = KErrBadTestParameter; |
|
771 ERROR( err, "Missing Parameter: expectedPowerStatus." ); |
|
772 } |
|
773 currentPowerStatus = iSettings->EngineSettings().IsPowerOn(); |
|
774 if ( currentPowerStatus != expectedPowerStatus ) |
|
775 { |
|
776 INFO_2( "Failed: currentPowerStatus=%i, expectedPowerStatus=%i.", currentPowerStatus, expectedPowerStatus ); |
|
777 err = KErrUnexpectedValue; |
|
778 } |
|
779 return err; |
|
780 } |
|
781 |
|
782 |
|
783 // ----------------------------------------------------------------------------- |
|
784 // CSettingsTestModule::SetPowerOn() |
|
785 // Returns: Errors. |
|
786 // ----------------------------------------------------------------------------- |
|
787 TInt CSettingsTestModule::SetPowerOn( CStifItemParser& aItem ) |
|
788 { |
|
789 FUNC_LOG; |
|
790 TUint powerStatus( 0 ); |
|
791 TInt err( KErrNone ); |
|
792 |
|
793 // read parameters |
|
794 if ( aItem.GetNextInt(powerStatus) ) |
|
795 { |
|
796 err = KErrBadTestParameter; |
|
797 ERROR( err, "Missing Parameter: powerStatus." ); |
|
798 } |
|
799 err = iSettings->RadioSetter().SetPowerOn( powerStatus ); |
|
800 return err; |
|
801 } |
|
802 |
|
803 |
|
804 // ----------------------------------------------------------------------------- |
|
805 // CSettingsTestModule::TunedFrequency() |
|
806 // Returns: Errors. |
|
807 // ----------------------------------------------------------------------------- |
|
808 TInt CSettingsTestModule::TunedFrequency( CStifItemParser& aItem ) |
|
809 { |
|
810 FUNC_LOG; |
|
811 TInt err( KErrNone ); |
|
812 TUint expectedTunedFrequency( 0 ); |
|
813 TUint currentTunedFrequency( 0 ); |
|
814 |
|
815 // read parameters |
|
816 if ( aItem.GetNextInt(expectedTunedFrequency) ) |
|
817 { |
|
818 err = KErrBadTestParameter; |
|
819 ERROR( err, "Missing Parameter: expectedTunedFrequency." ); |
|
820 } |
|
821 currentTunedFrequency = iSettings->EngineSettings().TunedFrequency(); |
|
822 if ( currentTunedFrequency != expectedTunedFrequency ) |
|
823 { |
|
824 INFO_2( "Failed: currentTunedFrequency=%i, expectedTunedFrequency=%i.", currentTunedFrequency, expectedTunedFrequency ); |
|
825 err = KErrUnexpectedValue; |
|
826 } |
|
827 return err; |
|
828 } |
|
829 |
|
830 // ----------------------------------------------------------------------------- |
|
831 // CSettingsTestModule::SetTunedFrequency() |
|
832 // Returns: Errors. |
|
833 // ----------------------------------------------------------------------------- |
|
834 TInt CSettingsTestModule::SetTunedFrequency( CStifItemParser& aItem ) |
|
835 { |
|
836 FUNC_LOG; |
|
837 TUint tunedFrequency( 0 ); |
|
838 TInt err( KErrNone ); |
|
839 |
|
840 // read parameters |
|
841 if ( aItem.GetNextInt( tunedFrequency ) ) |
|
842 { |
|
843 err = KErrBadTestParameter; |
|
844 ERROR( err, "Missing Parameter: tunedFrequency." ); |
|
845 } |
|
846 err = iSettings->RadioSetter().SetTunedFrequency( tunedFrequency ); |
|
847 return err; |
|
848 } |
|
849 |
|
850 |
|
851 // ----------------------------------------------------------------------------- |
|
852 // CSettingsTestModule::DefaultMinVolumeLevel() |
|
853 // Returns: Errors. |
|
854 // ----------------------------------------------------------------------------- |
|
855 TInt CSettingsTestModule::DefaultMinVolumeLevel( CStifItemParser& /*aItem*/ ) |
|
856 { |
|
857 FUNC_LOG; |
|
858 TInt err( KErrNone ); |
|
859 TUint currentDefaultMinVolumeLevel( iSettings->EngineSettings().DefaultMinVolumeLevel() ); |
|
860 INFO_1( "OK currentDefaultMinVolumeLevel=%i", currentDefaultMinVolumeLevel ); |
|
861 return err; |
|
862 } |
|
863 |
|
864 |
|
865 // ----------------------------------------------------------------------------- |
|
866 // CSettingsTestModule::CountRegions() |
|
867 // Returns: Errors. |
|
868 // ----------------------------------------------------------------------------- |
|
869 TInt CSettingsTestModule::CountRegions( CStifItemParser& /*aItem*/ ) |
|
870 { |
|
871 FUNC_LOG; |
|
872 TInt err( KErrNone ); |
|
873 TUint currentRegionCount( iSettings->EngineSettings().CountRegions() ); |
|
874 INFO_1( "OK currentRegionCount=%i", currentRegionCount ); |
|
875 return err; |
|
876 } |
|
877 |
|
878 |
|
879 // ----------------------------------------------------------------------------- |
|
880 // CSettingsTestModule::Region() |
|
881 // Returns: Errors. |
|
882 // ----------------------------------------------------------------------------- |
|
883 TInt CSettingsTestModule::Region( CStifItemParser& /*aItem*/ ) |
|
884 { |
|
885 FUNC_LOG; |
|
886 TInt err( KErrNone ); |
|
887 TInt regionIndex( iSettings->EngineSettings().RegionId() ); |
|
888 //CRadioRegion& radioRegion( iSettings->EngineSettings().RegionIndexForId( regionIndex ) ); |
|
889 // 17.5.2010: Region handling has to be reimplemented anyways, so don't make any detailed tets |
|
890 // Above won't work because called function RegionIndexForId() is private one. |
|
891 |
|
892 return err; |
|
893 } |
|
894 |
|
895 |
|
896 |
|
897 // ----------------------------------------------------------------------------- |
|
898 // CSettingsTestModule::RegionId() |
|
899 // Returns: Errors. |
|
900 // ----------------------------------------------------------------------------- |
|
901 TInt CSettingsTestModule::RegionId( CStifItemParser& aItem ) |
|
902 { |
|
903 FUNC_LOG; |
|
904 TInt expectedRegionIndex( 0 ); |
|
905 TInt currentRegionIndex( 0 ); |
|
906 TInt err( KErrNone ); |
|
907 |
|
908 // read parameters |
|
909 if ( aItem.GetNextInt( expectedRegionIndex ) ) |
|
910 { |
|
911 err = KErrBadTestParameter; |
|
912 ERROR( err, "Missing Parameter: expectedRegionIndex." ); |
|
913 } |
|
914 currentRegionIndex = iSettings->EngineSettings().RegionId(); |
|
915 if ( currentRegionIndex != expectedRegionIndex ) |
|
916 { |
|
917 INFO_2( "Failed: currentRegionIndex=%i, expectedRegionIndex=%i.", currentRegionIndex, expectedRegionIndex ); |
|
918 err = KErrUnexpectedValue; |
|
919 } |
|
920 return err; |
|
921 } |
|
922 |
|
923 |
|
924 // ----------------------------------------------------------------------------- |
|
925 // CSettingsTestModule::SetRegionId() |
|
926 // Returns: Errors. |
|
927 // ----------------------------------------------------------------------------- |
|
928 TInt CSettingsTestModule::SetRegionId( CStifItemParser& aItem ) |
|
929 { |
|
930 FUNC_LOG; |
|
931 TInt regionId( 0 ); |
|
932 TInt err( KErrNone ); |
|
933 |
|
934 // read parameters |
|
935 if ( aItem.GetNextInt( regionId ) ) |
|
936 { |
|
937 err = KErrBadTestParameter; |
|
938 ERROR( err, "Missing Parameter: regionId." ); |
|
939 } |
|
940 err = iSettings->RadioSetter().SetRegionId( regionId ); |
|
941 return err; |
|
942 } |
|
943 |
|
944 |
|
945 // ----------------------------------------------------------------------------- |
|
946 // CSettingsTestModule::FrequencyStepSize() |
|
947 // Returns: Errors. |
|
948 // ----------------------------------------------------------------------------- |
|
949 TInt CSettingsTestModule::FrequencyStepSize( CStifItemParser& /*aItem*/ ) |
|
950 { |
|
951 FUNC_LOG; |
|
952 TInt err( KErrNone ); |
|
953 TUint32 currentFrequencyStepSize( iSettings->EngineSettings().FrequencyStepSize() ); |
|
954 INFO_1( "OK currentFrequencyStepSize=%i", currentFrequencyStepSize ); |
|
955 return err; |
|
956 } |
|
957 |
|
958 |
|
959 // ----------------------------------------------------------------------------- |
|
960 // CSettingsTestModule::MaxFrequency() |
|
961 // Returns: Errors. |
|
962 // ----------------------------------------------------------------------------- |
|
963 TInt CSettingsTestModule::MaxFrequency( CStifItemParser& /*aItem*/ ) |
|
964 { |
|
965 FUNC_LOG; |
|
966 TInt err( KErrNone ); |
|
967 TUint32 currentMaxFrequency( iSettings->EngineSettings().MaxFrequency() ); |
|
968 INFO_1( "OK currentMaxFrequency=%i", currentMaxFrequency ); |
|
969 return err; |
|
970 } |
|
971 |
|
972 |
|
973 // ----------------------------------------------------------------------------- |
|
974 // CSettingsTestModule::MinFrequency() |
|
975 // Returns: Errors. |
|
976 // ----------------------------------------------------------------------------- |
|
977 TInt CSettingsTestModule::MinFrequency( CStifItemParser& /*aItem*/ ) |
|
978 { |
|
979 FUNC_LOG; |
|
980 TInt err( KErrNone ); |
|
981 TUint32 currentMinFrequency( iSettings->EngineSettings().MinFrequency() ); |
|
982 INFO_1( "OK currentMinFrequency=%i", currentMinFrequency ); |
|
983 return err; |
|
984 } |
|
985 |
|
986 |
|
987 // ----------------------------------------------------------------------------- |
|
988 // CSettingsTestModule::DecimalCount() |
|
989 // Returns: Errors. |
|
990 // ----------------------------------------------------------------------------- |
|
991 TInt CSettingsTestModule::DecimalCount( CStifItemParser& /*aItem*/ ) |
|
992 { |
|
993 FUNC_LOG; |
|
994 TInt err( KErrNone ); |
|
995 TInt currentDecimalCount( iSettings->EngineSettings().DecimalCount() ); |
|
996 INFO_1( "OK currentDecimalCount=%i", currentDecimalCount ); |
|
997 return err; |
|
998 } |
|
999 |
|
1000 |
|
1001 // ----------------------------------------------------------------------------- |
|
1002 // CSettingsTestModule::DefaultRegion() |
|
1003 // Returns: Errors. |
|
1004 // ----------------------------------------------------------------------------- |
|
1005 TInt CSettingsTestModule::DefaultRegion( CStifItemParser& /*aItem*/ ) |
|
1006 { |
|
1007 FUNC_LOG; |
|
1008 TInt err( KErrNone ); |
|
1009 TRadioRegion defaultRegion( iSettings->EngineSettings().DefaultRegion() ); |
|
1010 INFO_1( "OK defaultRegion=%i", defaultRegion ); |
|
1011 return err; |
|
1012 } |
|
1013 |
|
1014 |
|
1015 // ----------------------------------------------------------------------------- |
|
1016 // CSettingsTestModule::NetworkId() |
|
1017 // Returns: Errors. |
|
1018 // ----------------------------------------------------------------------------- |
|
1019 TInt CSettingsTestModule::NetworkId( CStifItemParser& aItem ) |
|
1020 { |
|
1021 FUNC_LOG; |
|
1022 TInt err( KErrNone ); |
|
1023 TPtrC expectedNetworkId; |
|
1024 if ( aItem.GetNextString(expectedNetworkId) ) |
|
1025 { |
|
1026 err = KErrBadTestParameter; |
|
1027 ERROR( err, "Missing Parameter: expectedNetworkId." ); |
|
1028 } |
|
1029 INFO_1( "expectedNetworkId=%S.", &expectedNetworkId ); |
|
1030 TPtrC actualNetworkId( iSettings->EngineSettings().NetworkId() ); |
|
1031 if ( !actualNetworkId.Compare( expectedNetworkId ) ) |
|
1032 { |
|
1033 INFO_2( "Failed: actualNetworkId=%S, expectedNetworkId=%S.", &actualNetworkId, &expectedNetworkId ); |
|
1034 err = KErrUnexpectedValue; |
|
1035 } |
|
1036 return err; |
|
1037 } |
|
1038 |
|
1039 |
|
1040 // ----------------------------------------------------------------------------- |
|
1041 // CSettingsTestModule::CountryCode() |
|
1042 // Returns: Errors. |
|
1043 // ----------------------------------------------------------------------------- |
|
1044 TInt CSettingsTestModule::CountryCode( CStifItemParser& aItem ) |
|
1045 { |
|
1046 FUNC_LOG; |
|
1047 TInt err( KErrNone ); |
|
1048 TPtrC expectedCountryCode; |
|
1049 if ( aItem.GetNextString(expectedCountryCode) ) |
|
1050 { |
|
1051 err = KErrBadTestParameter; |
|
1052 ERROR( err, "Missing Parameter: expectedCountryCode." ); |
|
1053 } |
|
1054 INFO_1( "expectedCountryCode=%S.", &expectedCountryCode ); |
|
1055 TPtrC actualCountryCode( iSettings->EngineSettings().CountryCode() ); |
|
1056 if ( !actualCountryCode.Compare( expectedCountryCode ) ) |
|
1057 { |
|
1058 INFO_2( "Failed: actualCountryCode=%S, expectedCountryCode=%S.", &actualCountryCode, &expectedCountryCode ); |
|
1059 err = KErrUnexpectedValue; |
|
1060 } |
|
1061 return err; |
|
1062 } |
|
1063 |
|
1064 |
|
1065 // ----------------------------------------------------------------------------- |
|
1066 // CSettingsTestModule::SetNetworkId() |
|
1067 // Returns: Errors. |
|
1068 // ----------------------------------------------------------------------------- |
|
1069 TInt CSettingsTestModule::SetNetworkId( CStifItemParser& aItem ) |
|
1070 { |
|
1071 FUNC_LOG; |
|
1072 TInt err( KErrNone ); |
|
1073 TPtrC networkId; |
|
1074 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
1075 if ( aItem.GetNextString(networkId) ) |
|
1076 { |
|
1077 err = KErrBadTestParameter; |
|
1078 ERROR( err, "Missing Parameter: networkId." ); |
|
1079 } |
|
1080 err = iSettings->RadioSetter().SetNetworkId( networkId ); |
|
1081 return err; |
|
1082 } |
|
1083 |
|
1084 |
|
1085 // ----------------------------------------------------------------------------- |
|
1086 // CSettingsTestModule::SetCountryCode() |
|
1087 // Returns: Errors. |
|
1088 // ----------------------------------------------------------------------------- |
|
1089 TInt CSettingsTestModule::SetCountryCode( CStifItemParser& aItem ) |
|
1090 { |
|
1091 FUNC_LOG; |
|
1092 TInt err( KErrNone ); |
|
1093 TPtrC countryCode; |
|
1094 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
1095 if ( aItem.GetNextString(countryCode) ) |
|
1096 { |
|
1097 err = KErrBadTestParameter; |
|
1098 ERROR( err, "Missing Parameter: countryCode." ); |
|
1099 } |
|
1100 err = iSettings->RadioSetter().SetCountryCode( countryCode ); |
|
1101 return err; |
|
1102 } |
|
1103 |
|
1104 |
|
1105 // ----------------------------------------------------------------------------- |
|
1106 // CSettingsTestModule::ReadConfigurableKeysL() |
|
1107 // Returns: Errors. |
|
1108 // ----------------------------------------------------------------------------- |
|
1109 TInt CSettingsTestModule::ReadConfigurableKeysL( CStifItemParser& /*aItem*/ ) |
|
1110 { |
|
1111 FUNC_LOG; |
|
1112 TInt err( KErrNone ); |
|
1113 TInt regionAllowed( EFalse ); |
|
1114 CRepository* cr( CRepository::NewL(KRadioCRUid) ); |
|
1115 if ( cr ) |
|
1116 { |
|
1117 cr->Get( KRadioCRRegionAllowedJapan, regionAllowed ); |
|
1118 delete cr; |
|
1119 } |
|
1120 INFO_1( "KRadioCRRegionAllowedJapan status = %i", regionAllowed ); |
|
1121 return err; |
|
1122 } |
|
1123 |
|
1124 // ----------------------------------------------------------------------------- |
|
1125 // CSettingsTestModule::RdsAfSearchSettingChangedL() |
|
1126 // Returns: None. |
|
1127 // ----------------------------------------------------------------------------- |
|
1128 void CSettingsTestModule::RdsAfSearchSettingChangedL( TBool /*aEnabled*/ ) |
|
1129 { |
|
1130 FUNC_LOG; |
|
1131 } |
|
1132 |
|
1133 // ----------------------------------------------------------------------------- |
|
1134 // CSettingsTestModule::RegionSettingChangedL() |
|
1135 // Returns: None. |
|
1136 // ----------------------------------------------------------------------------- |
|
1137 void CSettingsTestModule::RegionSettingChangedL( TInt /*aRegion*/ ) |
|
1138 { |
|
1139 FUNC_LOG; |
|
1140 iRegionSettingChangeNotified = ETrue; |
|
1141 } |
|
1142 |
|
1143 // ----------------------------------------------------------------------------- |
|
1144 // CSettingsTestModule::tstSetRegionIdL() |
|
1145 // Returns: errors. |
|
1146 // ----------------------------------------------------------------------------- |
|
1147 TInt CSettingsTestModule::tstSetRegionIdL( CStifItemParser& aItem ) |
|
1148 { |
|
1149 FUNC_LOG; |
|
1150 TInt regionId( 0 ); |
|
1151 TInt err( KErrNone ); |
|
1152 |
|
1153 // read parameters |
|
1154 if ( aItem.GetNextInt( regionId ) ) |
|
1155 { |
|
1156 err = KErrBadTestParameter; |
|
1157 ERROR( err, "Missing Parameter: regionId." ); |
|
1158 } |
|
1159 CRepository* cr( CRepository::NewLC(KRadioCRUid) ); |
|
1160 User::LeaveIfError( cr->Set( KRadioCRCurrentRegion, regionId ) ); |
|
1161 CleanupStack::Pop(cr); |
|
1162 delete cr; |
|
1163 return err; |
|
1164 } |
|
1165 |
|
1166 // ----------------------------------------------------------------------------- |
|
1167 // CSettingsTestModule::tstResetStartCount() |
|
1168 // Returns: errors. |
|
1169 // ----------------------------------------------------------------------------- |
|
1170 TInt CSettingsTestModule::tstResetStartCount( CStifItemParser& /*aItem*/ ) |
|
1171 { |
|
1172 FUNC_LOG; |
|
1173 TInt countResetValue( 0 ); |
|
1174 TInt err( KErrNone ); |
|
1175 |
|
1176 CRepository* cr( CRepository::NewLC(KRadioCRUid) ); |
|
1177 User::LeaveIfError( cr->Set( KRadioCRLaunchCount, countResetValue ) ); |
|
1178 CleanupStack::Pop(cr); |
|
1179 delete cr; |
|
1180 return err; |
|
1181 } |
|
1182 |
|
1183 // ----------------------------------------------------------------------------- |
|
1184 // CSettingsTestModuleModule::?member_function |
|
1185 // ?implementation_description |
|
1186 // (other items were commented in a header). |
|
1187 // ----------------------------------------------------------------------------- |
|
1188 // |
|
1189 /* |
|
1190 TInt CSettingsTestModule::?member_function( |
|
1191 CItemParser& aItem ) |
|
1192 { |
|
1193 FUNC_LOG; |
|
1194 |
|
1195 ?code |
|
1196 |
|
1197 } |
|
1198 */ |
|
1199 |
|
1200 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
1201 // None |
|
1202 |
|
1203 // [End of File] - Do not remove |