os/security/crypto/weakcryptospi/test/tasymmetric/performancetest.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/crypto/weakcryptospi/test/tasymmetric/performancetest.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,89 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +
    1.24 +/**
    1.25 + @file
    1.26 +*/
    1.27 +
    1.28 +#ifndef __PERFORMANCETEST_H__
    1.29 +#define __PERFORMANCETEST_H__
    1.30 +#include <f32file.h>
    1.31 +#include "t_testaction.h"
    1.32 +#include "t_testsetup.h"
    1.33 +#include <e32std.h>
    1.34 +
    1.35 +const TInt KMaxIterations = 500;
    1.36 +
    1.37 +_LIT8(KIterationsStart, "<iterations>");
    1.38 +_LIT8(KIterationsEnd, "</iterations>");
    1.39 +_LIT8(KTypeOfCryptoStart, "<cryptotype>");
    1.40 +_LIT8(KTypeOfCryptoEnd, "</cryptotype>");
    1.41 +_LIT8(KRSAStandard, "EStandard");
    1.42 +_LIT8(KRSAStandardCRT, "EStandardCRT");
    1.43 +
    1.44 +//	This class can be used to switch on/off performance testing
    1.45 +//	It inherits from CTestAction so it can be used in the script
    1.46 +//	but otherwise doesn't carry out any test.
    1.47 +//	When in a script and enabled, the performance tester singleton
    1.48 +//	is initialised and can then be used by all following tests in
    1.49 +//	various performance operations
    1.50 +
    1.51 +class CPerformanceTest : public CTestAction
    1.52 +{
    1.53 +public:
    1.54 +	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole,
    1.55 +		Output& aOut, const TTestActionSpec& aTestActionSpec);
    1.56 +	static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
    1.57 +		Output& aOut, const TTestActionSpec& aTestActionSpec);
    1.58 +public:
    1.59 +	virtual ~CPerformanceTest();
    1.60 +	virtual void PerformAction(TRequestStatus& aStatus);
    1.61 +protected:
    1.62 +    CPerformanceTest(CConsoleBase& aConsole, Output& aOut);  
    1.63 +	virtual void ConstructL(const TTestActionSpec& aTestActionSpec);
    1.64 +	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
    1.65 +	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
    1.66 +	virtual void DoReportAction(void){};
    1.67 +	virtual void DoCheckResult(TInt){};
    1.68 +};
    1.69 +
    1.70 +//	static singleton tracks performance testing and provides
    1.71 +//	standard operations for all performance tests
    1.72 +
    1.73 +class CPerformance : public CBase
    1.74 +{
    1.75 +public:
    1.76 +	static CPerformance* NewL();
    1.77 +public:
    1.78 +	static CPerformance* PerformanceTester();
    1.79 +	static void ClosePerformanceTester();
    1.80 +public:
    1.81 +	inline void SetTestingPerformance(TBool aTestPerformance) {iTestingPerformance=aTestPerformance;};
    1.82 +	inline TBool IsTestingPerformance() const {return (iTestingPerformance);};
    1.83 +private:
    1.84 +	CPerformance();
    1.85 +	~CPerformance();
    1.86 +private:
    1.87 +	static CPerformance* iPerformanceTester;
    1.88 +private:
    1.89 +	TBool iTestingPerformance;
    1.90 +};
    1.91 +
    1.92 +#endif	//	__PERFORMANCETEST_H__