sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * tpropertystep.cpp sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include "numberconversion.h" sl@0: #include "tupspropertystep.h" sl@0: sl@0: CPropertyStep::CPropertyStep() sl@0: /** sl@0: * Constructor sl@0: */ sl@0: { sl@0: SetTestStepName(KPropertyStep); sl@0: } sl@0: sl@0: CPropertyStep::~CPropertyStep() sl@0: /** sl@0: * Destructor sl@0: */ sl@0: { sl@0: __UHEAP_MARKEND; sl@0: } sl@0: sl@0: TVerdict CPropertyStep::doTestStepPreambleL() sl@0: /** sl@0: * @return - TVerdict code sl@0: * Override of base class virtual sl@0: */ sl@0: { sl@0: __UHEAP_MARK; sl@0: SetTestStepResult(EPass); sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: TVerdict CPropertyStep::doTestStepPostambleL() sl@0: /** sl@0: * @return - TVerdict code sl@0: * Override of base class virtual sl@0: */ sl@0: { sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: TVerdict CPropertyStep::doTestStepL() sl@0: { sl@0: sl@0: INFO_PRINTF1(_L(">> CPropertyStep::doTestStepL()")); sl@0: sl@0: TInt index = 1; sl@0: sl@0: TName fPropertyName; sl@0: fPropertyName.Format(_L("PropertyName_%d"),index); sl@0: TName fPropertyCreate; sl@0: fPropertyCreate.Format(_L("PropertyCreate_%d"),index); sl@0: TName fPropertyKey; sl@0: fPropertyKey.Format(_L("PropertyKey_%d"),index); sl@0: TName fPropertyType; sl@0: fPropertyType.Format(_L("PropertyType_%d"),index); sl@0: sl@0: TPtrC propertyName; sl@0: TBool propertyCreate; sl@0: TInt propertyKey; sl@0: TInt propertyType; sl@0: sl@0: GetStringFromConfig(ConfigSection(), fPropertyName, propertyName); sl@0: GetBoolFromConfig(ConfigSection(),fPropertyCreate, propertyCreate); sl@0: GetIntFromConfig(ConfigSection(),fPropertyKey, propertyKey); sl@0: GetIntFromConfig(ConfigSection(),fPropertyType, propertyType); sl@0: sl@0: // read all the property details in from the ini file sl@0: while (GetStringFromConfig(ConfigSection(), fPropertyName, propertyName) sl@0: && GetBoolFromConfig(ConfigSection(),fPropertyCreate, propertyCreate) sl@0: && GetIntFromConfig(ConfigSection(),fPropertyKey, propertyKey) sl@0: && GetIntFromConfig(ConfigSection(),fPropertyType, propertyType)) sl@0: { sl@0: // INFO_PRINTF2(_L("Read test action %d"),index); // debug sl@0: sl@0: if (propertyCreate) sl@0: { sl@0: static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); sl@0: if (propertyType == static_cast(RProperty::EInt)) sl@0: { sl@0: RProperty::Define(propertyKey, RProperty::EInt, KAllowAllPolicy, KAllowAllPolicy); sl@0: } sl@0: else sl@0: { sl@0: RProperty::Define(propertyKey, RProperty::EByteArray, KAllowAllPolicy, KAllowAllPolicy); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: RProperty::Delete(propertyKey); sl@0: } sl@0: ++index; sl@0: fPropertyName.Format(_L("PropertyName_%d"), index); sl@0: fPropertyCreate.Format(_L("PropertyCreate_%d"), index); sl@0: fPropertyKey.Format(_L("PropertyKey_%d"), index); sl@0: fPropertyType.Format(_L("PropertyType_%d"), index); sl@0: sl@0: GetStringFromConfig(ConfigSection(), fPropertyName, propertyName); sl@0: GetBoolFromConfig(ConfigSection(),fPropertyCreate, propertyCreate); sl@0: GetIntFromConfig(ConfigSection(),fPropertyKey, propertyKey); sl@0: GetIntFromConfig(ConfigSection(),fPropertyType, propertyType); sl@0: sl@0: } sl@0: SetTestStepResult(EPass); sl@0: return TestStepResult(); sl@0: }