748
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
872
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
748
|
5 |
// which accompanies this distribution, and is available
|
872
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
748
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// @file ctlbsstep_createverifymoduledata.cpp
|
|
15 |
// This is the class implementation for the Notify Position Update Tests
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
#include "ctlbsstepcreateverifymoduledata.h"
|
|
20 |
|
|
21 |
#include "tlbsutils.h"
|
|
22 |
|
|
23 |
/**
|
|
24 |
"module_data_file" = name of the .ini file containing the module data items including
|
|
25 |
position info array entries, module stauts, module update options.
|
|
26 |
|
|
27 |
If the file name is not present the module data will contain default items.
|
|
28 |
See tlbsutils.cpp for details of support ini file commands.
|
|
29 |
*/
|
|
30 |
_LIT(KModuleDataFile, "module_data_file");
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Constructor
|
|
34 |
*/
|
|
35 |
CT_LbsStep_CreateVerifyModuleData::CT_LbsStep_CreateVerifyModuleData(CT_LbsServer& aParent) : CT_LbsStep(aParent)
|
|
36 |
{
|
|
37 |
SetTestStepName(KLbsStep_CreateVerifyModuleData);
|
|
38 |
}
|
|
39 |
|
|
40 |
|
|
41 |
/**
|
|
42 |
Static Constructor
|
|
43 |
*/
|
|
44 |
CT_LbsStep_CreateVerifyModuleData* CT_LbsStep_CreateVerifyModuleData::New(CT_LbsServer& aParent)
|
|
45 |
{
|
|
46 |
return new CT_LbsStep_CreateVerifyModuleData(aParent);
|
|
47 |
// Note the lack of ELeave.
|
|
48 |
// This means that having insufficient memory will return NULL;
|
|
49 |
}
|
|
50 |
|
|
51 |
|
|
52 |
/**
|
|
53 |
* @return - TVerdict code
|
|
54 |
* Override of base class pure virtual
|
|
55 |
* Our implementation only gets called if the base class doTestStepPreambleL() did
|
|
56 |
* not leave. That being the case, the current test result value will be EPass.
|
|
57 |
*/
|
|
58 |
TVerdict CT_LbsStep_CreateVerifyModuleData::doTestStepL()
|
|
59 |
{
|
|
60 |
// Helper test step used to Create the Verify Position Information Array.
|
|
61 |
INFO_PRINTF1(_L(">>CT_LbsStep_CreateVerifyModuleData::doTestStepL()"));
|
|
62 |
|
|
63 |
if (TestStepResult() == EPass)
|
|
64 |
{
|
|
65 |
TPtrC configFileName;
|
|
66 |
GetStringFromConfig(ConfigSection(), KModuleDataFile, configFileName);
|
|
67 |
|
|
68 |
// Access the verify pos array and pass to utils func to be populated.
|
|
69 |
RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
|
|
70 |
TPositionUpdateOptions& updateOpts = iParent.iSharedData->iVerifyUpdateOpts;
|
|
71 |
TPositionModuleStatus& modStatus = iParent.iSharedData->iVerifyModuleStatus;
|
|
72 |
T_LbsUtils utils;
|
|
73 |
|
|
74 |
// Populate the shared data items.
|
|
75 |
utils.GetConfigured_PosInfosL(configFileName, ConfigSection(), posInfoArr); // Note previous entries will be cleared.
|
|
76 |
utils.GetConfigured_ModuleStatusL(configFileName, ConfigSection(), modStatus);
|
|
77 |
utils.GetConfigured_ModuleUpdateOptionsL(configFileName, ConfigSection(), updateOpts);
|
|
78 |
// remove aove module does not know abot update options...
|
|
79 |
|
|
80 |
// Notify the test module that it's required to update it's test data.
|
|
81 |
TPtrC modType;
|
|
82 |
GetStringFromConfig(ConfigSection(), KLbsModuleType, modType);
|
|
83 |
if (modType != KLbsModuleType_Real)
|
|
84 |
{
|
|
85 |
|
|
86 |
TModuleDataIn modDataIn;
|
|
87 |
|
|
88 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestConfig;
|
|
89 |
modDataIn.iConfigFileName = configFileName;
|
|
90 |
modDataIn.iConfigSection = ConfigSection();
|
|
91 |
|
|
92 |
// Now publish the ini file and section name to the test module - will block.
|
|
93 |
utils.NotifyModuleOfConfigChangeL(modDataIn);
|
|
94 |
}
|
|
95 |
else
|
|
96 |
{
|
|
97 |
iParent.iSharedData->iTestModuleInUse = EFalse; // Indicate to test harness the real A-GPS integration module is being used.
|
|
98 |
}
|
|
99 |
}
|
|
100 |
|
|
101 |
INFO_PRINTF1(_L("<<CT_LbsStep_CreateVerifyModuleData::doTestStepL()"));
|
|
102 |
|
|
103 |
return TestStepResult();
|
|
104 |
}
|