persistentstorage/centralrepository/test/testexecute/BUR/src/modifyPMAStep.cpp
changeset 55 44f437012c90
equal deleted inserted replaced
51:7d4490026038 55:44f437012c90
       
     1 // Copyright (c) 2010 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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 #include "modifyPMAStep.h"
       
    20 #include "Te_centrep_BURSuiteDefs.h"
       
    21 
       
    22 CmodifyPMAStep::~CmodifyPMAStep()
       
    23 /**
       
    24  * Destructor
       
    25  */
       
    26 	{
       
    27 	}
       
    28 
       
    29 CmodifyPMAStep::CmodifyPMAStep()
       
    30 /**
       
    31  * Constructor
       
    32  */
       
    33 	{
       
    34 	// **MUST** call SetTestStepName in the constructor as the controlling
       
    35 	// framework uses the test step name immediately following construction to set
       
    36 	// up the step's unique logging ID.
       
    37 	SetTestStepName(KmodifyPMAStep);
       
    38 	}
       
    39 
       
    40 TVerdict CmodifyPMAStep::doTestStepL()
       
    41 /**
       
    42  * @return - TVerdict code
       
    43  * Override of base class pure virtual
       
    44  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    45  * not leave. That being the case, the current test result value will be EPass.
       
    46  */
       
    47 	{
       
    48     SetTestStepResult(EFail);	
       
    49 	
       
    50 #if defined(SYMBIAN_INCLUDE_APP_CENTRIC)
       
    51     CRepository* repository;
       
    52     TInt r;
       
    53 	
       
    54     INFO_PRINTF2(_L("Start PMA ModifyPMAStep repos id: 0x%x"), KUidBURTestPMARepository);
       
    55 	repository = CRepository::NewLC(KUidBURTestPMARepository);
       
    56     // Modify current entries
       
    57     r = repository->Set(KPMAIntKey, KPMAIntModifiedValue);
       
    58     TESTL(r==KErrNone);
       
    59     
       
    60     r = repository->Set(KPMARealKey, KPMARealModifiedValue);
       
    61     TESTL(r==KErrNone);
       
    62     
       
    63     r = repository->Set(KPMABinKey, KPMABinModifiedValue);
       
    64     TESTL(r==KErrNone);
       
    65     
       
    66     r = repository->Set(KPMAStrKey, KPMAStrModifiedValue);
       
    67     TESTL(r==KErrNone);
       
    68         
       
    69 
       
    70     // Delete keys
       
    71     r = repository->Delete(KPMADeleteIntKey);
       
    72     TESTL(r==KErrNone);
       
    73     
       
    74     r = repository->Create(KPMACreateIntKey, KPMACreateIntValue);
       
    75     TESTL(r==KErrNone);
       
    76     
       
    77     
       
    78     // Modify current entries
       
    79     r = repository->Set(KPMAInitIntKey, KPMAInitIntModifiedValue);
       
    80     TESTL(r==KErrNone);
       
    81     
       
    82     r = repository->Set(KPMAInitRealKey, KPMAInitRealModifiedValue);
       
    83     TESTL(r==KErrNone);
       
    84     
       
    85     r = repository->Set(KPMAInitBinKey, KPMAInitBinModifiedValue);
       
    86     TESTL(r==KErrNone);
       
    87     
       
    88     r = repository->Set(KPMAInitStrKey, KPMAInitStrModifiedValue);
       
    89     TESTL(r==KErrNone);
       
    90 
       
    91     CleanupStack::PopAndDestroy(repository);
       
    92 #endif //defined(SYMBIAN_INCLUDE_APP_CENTRIC)
       
    93 
       
    94     SetTestStepResult(EPass);
       
    95     
       
    96 	return TestStepResult();
       
    97 	}