persistentstorage/centralrepository/test/testexecute/performance/src/TE_PerfTestCacheEnabledStep.cpp
branchRCL_3
changeset 23 26645d81f48d
parent 21 28839de615b4
child 24 cc28652e0254
equal deleted inserted replaced
21:28839de615b4 23:26645d81f48d
     1 // Copyright (c) 2005-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 "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 #include <centralrepository.h>
       
    17 #include "srvreqs.h"
       
    18 #include "srvdefs.h"
       
    19 #include "t_cenrep_helper.h"
       
    20 #include "TE_PerfTestCacheEnabledStep.h"
       
    21 #include "cachemgr.h"
       
    22 
       
    23 //--------------------------------
       
    24 // class CPerfTestCacheEnabledStep
       
    25 //--------------------------------
       
    26 
       
    27 CPerfTestCacheEnabledStep::CPerfTestCacheEnabledStep() 
       
    28 	{
       
    29 	SetTestStepName(KPerfTestCacheEnabledStep);
       
    30 	}
       
    31 
       
    32 // doTestStepL
       
    33 // Implement the pure virtual function.
       
    34 // This accesses a small and a large repository various times when cache is 
       
    35 // enabled and disabled.
       
    36 TVerdict CPerfTestCacheEnabledStep::doTestStepL()
       
    37 	{
       
    38 #ifndef __CENTREP_SERVER_CACHETEST__
       
    39 	return EPass;
       
    40 #else	
       
    41     SetTestStepResult(EFail);	
       
    42 	
       
    43 	TInt r;
       
    44 
       
    45 	r = SetGetParameters(TIpcArgs(EEnableCache, KDefaultEvictionTimeout, KDefaultCacheSize));
       
    46 	// Shouldn't leave here if SetGetParameters is not supported (when running with old server)
       
    47 
       
    48 	TEST(r==KErrNone);
       
    49 
       
    50 	CommonTestStepL();
       
    51 
       
    52 	return TestStepResult();
       
    53 #endif	
       
    54 	}
       
    55