lbs/common/src/ctlbsstepcreateverifyposinfos.cpp
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     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
       
     4 // under the terms of the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // @file ctlbsstep_createverifyposinfos.cpp
       
    15 // This is the class implementation for the Notify Position Update Tests
       
    16 // 
       
    17 //
       
    18  
       
    19 #include "ctlbsstepcreateverifyposinfos.h"
       
    20 
       
    21 #include "tlbsutils.h"
       
    22 
       
    23 /**
       
    24 	"pos_infos_file" = name of the .ini file containing the position info array entries.
       
    25 
       
    26 	If the file name is not present the array will contain a single default TPositionInfo entry.
       
    27 	See tlbsutils.cpp for details of support ini file commands.
       
    28 */
       
    29 _LIT(KPosInfosFile, "pos_infos_file");
       
    30 
       
    31 /**
       
    32  * Constructor
       
    33  */
       
    34 CT_LbsStep_CreateVerifyPosInfos::CT_LbsStep_CreateVerifyPosInfos(CT_LbsServer& aParent) : CT_LbsStep(aParent)
       
    35 	{
       
    36 	SetTestStepName(KLbsStep_CreateVerifyPosInfos);
       
    37 	}
       
    38 
       
    39 
       
    40 /**
       
    41 Static Constructor
       
    42 */
       
    43 CT_LbsStep_CreateVerifyPosInfos* CT_LbsStep_CreateVerifyPosInfos::New(CT_LbsServer& aParent)
       
    44 	{
       
    45 	return new CT_LbsStep_CreateVerifyPosInfos(aParent);
       
    46 	// Note the lack of ELeave.
       
    47 	// This means that having insufficient memory will return NULL;
       
    48 	}
       
    49 
       
    50 
       
    51 /**
       
    52  * @return - TVerdict code
       
    53  * Override of base class pure virtual
       
    54  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    55  * not leave. That being the case, the current test result value will be EPass.
       
    56  */
       
    57 TVerdict CT_LbsStep_CreateVerifyPosInfos::doTestStepL()
       
    58 	{
       
    59 	// Helper test step used to Create the Verify Position Information Array.
       
    60 	INFO_PRINTF1(_L(">>CT_LbsStep_CreateVerifyPosInfos::doTestStepL()"));
       
    61 
       
    62 	if (TestStepResult() == EPass)
       
    63 		{
       
    64 		TPtrC configFileName;
       
    65 		GetStringFromConfig(ConfigSection(), KPosInfosFile, configFileName);
       
    66 
       
    67 		// Access the verify pos array and pass to utils func to be populated.
       
    68 		RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
       
    69 		T_LbsUtils utils;
       
    70 
       
    71 		utils.GetConfigured_PosInfosL(configFileName, ConfigSection(), posInfoArr); // Note previous entries will be cleared.
       
    72 
       
    73 		// Notify the test module that it's required to update it's test data.
       
    74 		TPtrC modType;
       
    75 		GetStringFromConfig(ConfigSection(), KLbsModuleType, modType);
       
    76 		if (modType != KLbsModuleType_Real)
       
    77 			{
       
    78 			
       
    79 			TModuleDataIn modDataIn;
       
    80 			
       
    81 			modDataIn.iRequestType = TModuleDataIn::EModuleRequestConfig;
       
    82 			modDataIn.iConfigFileName = configFileName;
       
    83 			modDataIn.iConfigSection = ConfigSection();
       
    84 
       
    85 			// Now publish the ini file and section name to the test module - will block.
       
    86 			utils.NotifyModuleOfConfigChangeL(modDataIn);
       
    87 			}
       
    88 		else
       
    89 			{
       
    90 			iParent.iSharedData->iTestModuleInUse = EFalse;	// Indicate to test harness the real A-GPS integration module is being used.			
       
    91 			}
       
    92 		}
       
    93 
       
    94 	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_CreateVerifyPosInfos::doTestStepL()"));
       
    95 
       
    96 	return TestStepResult();
       
    97 	}