diff -r 26645d81f48d -r cc28652e0254 persistentstorage/centralrepository/test/testexecute/performance/src/TE_PerfTestClientOpenStep.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/persistentstorage/centralrepository/test/testexecute/performance/src/TE_PerfTestClientOpenStep.cpp Wed Sep 01 12:39:58 2010 +0100 @@ -0,0 +1,115 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "TE_PerfTestClientOpenStep.h" +#include "TE_PerfTestUtilities.h" +#include "t_cenrep_helper.h" +#include "srvreqs.h" +#include "srvdefs.h" +#include +#include "cachemgr.h" + +#ifdef __CENTREP_SERVER_CACHETEST__ + +const TInt KMaxRepositories = 5; +const TInt KIterationCount = 100; +const TUid KUidClientOpenTestRepositoryIds[KMaxRepositories] = { 0x00000106, + 0x00000107, + 0x00000108, + 0x00000109, + 0x0000010A }; +#endif //__CENTREP_SERVER_CACHETEST__ + +CPerfTestClientOpenStep::CPerfTestClientOpenStep() + { + SetTestStepName(KPerfTestClientOpenName); + } + +// doTestStepL +// This test fetches the memory data collected by +// CentRep server, processes it and reports the result. +TVerdict CPerfTestClientOpenStep::doTestStepL() + { + SetTestStepResult(EFail); + +#ifndef __CENTREP_SERVER_CACHETEST__ + WARN_PRINTF1(_L("Test macro __CENTREP_SERVER_CACHETEST__ is not defined. Unable to disable cache. Test was not run.")); +#else + CRepository* repositories[KMaxRepositories]; + TReal openResults[KMaxRepositories]; + TReal closeResults[KMaxRepositories]; + TInt res = KErrNone; + + //enable cache back. + res = SetGetParameters(TIpcArgs(EDisableCache, KDefaultEvictionTimeout, KDefaultCacheSize)); + TESTL(res == KErrNone); + + for(TInt i=0; i=0; j--) + { + startTick = User::FastCounter(); + CleanupStack::PopAndDestroy(repositories[j]); + endTick = User::FastCounter(); + closeResults[i] += endTick - startTick; + + repositories[j] = NULL; + } + } + } + + for(TInt i=0; i