Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #include <e32property.h>
21 #include "numberconversion.h"
22 #include "tupspropertystep.h"
24 CPropertyStep::CPropertyStep()
29 SetTestStepName(KPropertyStep);
32 CPropertyStep::~CPropertyStep()
40 TVerdict CPropertyStep::doTestStepPreambleL()
42 * @return - TVerdict code
43 * Override of base class virtual
47 SetTestStepResult(EPass);
48 return TestStepResult();
51 TVerdict CPropertyStep::doTestStepPostambleL()
53 * @return - TVerdict code
54 * Override of base class virtual
57 return TestStepResult();
60 TVerdict CPropertyStep::doTestStepL()
63 INFO_PRINTF1(_L(">> CPropertyStep::doTestStepL()"));
68 fPropertyName.Format(_L("PropertyName_%d"),index);
69 TName fPropertyCreate;
70 fPropertyCreate.Format(_L("PropertyCreate_%d"),index);
72 fPropertyKey.Format(_L("PropertyKey_%d"),index);
74 fPropertyType.Format(_L("PropertyType_%d"),index);
81 GetStringFromConfig(ConfigSection(), fPropertyName, propertyName);
82 GetBoolFromConfig(ConfigSection(),fPropertyCreate, propertyCreate);
83 GetIntFromConfig(ConfigSection(),fPropertyKey, propertyKey);
84 GetIntFromConfig(ConfigSection(),fPropertyType, propertyType);
86 // read all the property details in from the ini file
87 while (GetStringFromConfig(ConfigSection(), fPropertyName, propertyName)
88 && GetBoolFromConfig(ConfigSection(),fPropertyCreate, propertyCreate)
89 && GetIntFromConfig(ConfigSection(),fPropertyKey, propertyKey)
90 && GetIntFromConfig(ConfigSection(),fPropertyType, propertyType))
92 // INFO_PRINTF2(_L("Read test action %d"),index); // debug
96 static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
97 if (propertyType == static_cast<TInt>(RProperty::EInt))
99 RProperty::Define(propertyKey, RProperty::EInt, KAllowAllPolicy, KAllowAllPolicy);
103 RProperty::Define(propertyKey, RProperty::EByteArray, KAllowAllPolicy, KAllowAllPolicy);
108 RProperty::Delete(propertyKey);
111 fPropertyName.Format(_L("PropertyName_%d"), index);
112 fPropertyCreate.Format(_L("PropertyCreate_%d"), index);
113 fPropertyKey.Format(_L("PropertyKey_%d"), index);
114 fPropertyType.Format(_L("PropertyType_%d"), index);
116 GetStringFromConfig(ConfigSection(), fPropertyName, propertyName);
117 GetBoolFromConfig(ConfigSection(),fPropertyCreate, propertyCreate);
118 GetIntFromConfig(ConfigSection(),fPropertyKey, propertyKey);
119 GetIntFromConfig(ConfigSection(),fPropertyType, propertyType);
122 SetTestStepResult(EPass);
123 return TestStepResult();