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