sl@0: /* sl@0: * Copyright (c) 2005-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: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: */ sl@0: sl@0: #ifndef __PERFORMANCETEST_H__ sl@0: #define __PERFORMANCETEST_H__ sl@0: #include sl@0: #include "t_testaction.h" sl@0: #include "t_testsetup.h" sl@0: #include sl@0: sl@0: const TInt KMaxIterations = 500; sl@0: sl@0: _LIT8(KIterationsStart, ""); sl@0: _LIT8(KIterationsEnd, ""); sl@0: _LIT8(KTypeOfCryptoStart, ""); sl@0: _LIT8(KTypeOfCryptoEnd, ""); sl@0: _LIT8(KRSAStandard, "EStandard"); sl@0: _LIT8(KRSAStandardCRT, "EStandardCRT"); sl@0: sl@0: // This class can be used to switch on/off performance testing sl@0: // It inherits from CTestAction so it can be used in the script sl@0: // but otherwise doesn't carry out any test. sl@0: // When in a script and enabled, the performance tester singleton sl@0: // is initialised and can then be used by all following tests in sl@0: // various performance operations sl@0: sl@0: class CPerformanceTest : public CTestAction sl@0: { sl@0: public: sl@0: static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, sl@0: Output& aOut, const TTestActionSpec& aTestActionSpec); sl@0: static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole, sl@0: Output& aOut, const TTestActionSpec& aTestActionSpec); sl@0: public: sl@0: virtual ~CPerformanceTest(); sl@0: virtual void PerformAction(TRequestStatus& aStatus); sl@0: protected: sl@0: CPerformanceTest(CConsoleBase& aConsole, Output& aOut); sl@0: virtual void ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: virtual void DoPerformPrerequisite(TRequestStatus& aStatus); sl@0: virtual void DoPerformPostrequisite(TRequestStatus& aStatus); sl@0: virtual void DoReportAction(void){}; sl@0: virtual void DoCheckResult(TInt){}; sl@0: }; sl@0: sl@0: // static singleton tracks performance testing and provides sl@0: // standard operations for all performance tests sl@0: sl@0: class CPerformance : public CBase sl@0: { sl@0: public: sl@0: static CPerformance* NewL(); sl@0: public: sl@0: static CPerformance* PerformanceTester(); sl@0: static void ClosePerformanceTester(); sl@0: public: sl@0: inline void SetTestingPerformance(TBool aTestPerformance) {iTestingPerformance=aTestPerformance;}; sl@0: inline TBool IsTestingPerformance() const {return (iTestingPerformance);}; sl@0: private: sl@0: CPerformance(); sl@0: ~CPerformance(); sl@0: private: sl@0: static CPerformance* iPerformanceTester; sl@0: private: sl@0: TBool iTestingPerformance; sl@0: }; sl@0: sl@0: #endif // __PERFORMANCETEST_H__