os/security/crypto/weakcrypto/test/tasymmetric/performancetest.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
sl@0
    21
/**
sl@0
    22
 @file
sl@0
    23
*/
sl@0
    24
sl@0
    25
#ifndef __PERFORMANCETEST_H__
sl@0
    26
#define __PERFORMANCETEST_H__
sl@0
    27
#include <f32file.h>
sl@0
    28
#include "t_testaction.h"
sl@0
    29
#include "t_testsetup.h"
sl@0
    30
#include <e32std.h>
sl@0
    31
sl@0
    32
const TInt KMaxIterations = 500;
sl@0
    33
sl@0
    34
_LIT8(KIterationsStart, "<iterations>");
sl@0
    35
_LIT8(KIterationsEnd, "</iterations>");
sl@0
    36
_LIT8(KTypeOfCryptoStart, "<cryptotype>");
sl@0
    37
_LIT8(KTypeOfCryptoEnd, "</cryptotype>");
sl@0
    38
_LIT8(KRSAStandard, "EStandard");
sl@0
    39
_LIT8(KRSAStandardCRT, "EStandardCRT");
sl@0
    40
sl@0
    41
//	This class can be used to switch on/off performance testing
sl@0
    42
//	It inherits from CTestAction so it can be used in the script
sl@0
    43
//	but otherwise doesn't carry out any test.
sl@0
    44
//	When in a script and enabled, the performance tester singleton
sl@0
    45
//	is initialised and can then be used by all following tests in
sl@0
    46
//	various performance operations
sl@0
    47
sl@0
    48
class CPerformanceTest : public CTestAction
sl@0
    49
{
sl@0
    50
public:
sl@0
    51
	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole,
sl@0
    52
		Output& aOut, const TTestActionSpec& aTestActionSpec);
sl@0
    53
	static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
sl@0
    54
		Output& aOut, const TTestActionSpec& aTestActionSpec);
sl@0
    55
public:
sl@0
    56
	virtual ~CPerformanceTest();
sl@0
    57
	virtual void PerformAction(TRequestStatus& aStatus);
sl@0
    58
protected:
sl@0
    59
    CPerformanceTest(CConsoleBase& aConsole, Output& aOut);  
sl@0
    60
	virtual void ConstructL(const TTestActionSpec& aTestActionSpec);
sl@0
    61
	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
sl@0
    62
	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
sl@0
    63
	virtual void DoReportAction(void){};
sl@0
    64
	virtual void DoCheckResult(TInt){};
sl@0
    65
};
sl@0
    66
sl@0
    67
//	static singleton tracks performance testing and provides
sl@0
    68
//	standard operations for all performance tests
sl@0
    69
sl@0
    70
class CPerformance : public CBase
sl@0
    71
{
sl@0
    72
public:
sl@0
    73
	static CPerformance* NewL();
sl@0
    74
public:
sl@0
    75
	static CPerformance* PerformanceTester();
sl@0
    76
	static void ClosePerformanceTester();
sl@0
    77
public:
sl@0
    78
	inline void SetTestingPerformance(TBool aTestPerformance) {iTestingPerformance=aTestPerformance;};
sl@0
    79
	inline TBool IsTestingPerformance() const {return (iTestingPerformance);};
sl@0
    80
private:
sl@0
    81
	CPerformance();
sl@0
    82
	~CPerformance();
sl@0
    83
private:
sl@0
    84
	static CPerformance* iPerformanceTester;
sl@0
    85
private:
sl@0
    86
	TBool iTestingPerformance;
sl@0
    87
};
sl@0
    88
sl@0
    89
#endif	//	__PERFORMANCETEST_H__