os/security/crypto/weakcrypto/test/thash/hashtestutils.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 /**
    22  @file
    23 */
    24 
    25 
    26 #include <e32test.h>
    27 #include <hash.h>
    28 #include <f32file.h>
    29 
    30 //TBool gMD2Test=ETrue;
    31 //TBool gMD5Test=ETrue;
    32 //TBool gSHATest=ETrue;
    33 //TBool gSHA1Test=ETrue;
    34 //TBool gHMACTest=ETrue;
    35 //TBool gErrorTest=ETrue;
    36 //TBool gPerformanceTest=ETrue;
    37 //TBool gVectorTest=ETrue;
    38 //TBool gLogging=ETrue;
    39 //TBool gFunctionalityTest=ETrue;
    40 //TBool gBugs=ETrue;
    41 //TBool gFixed=ETrue;
    42 //TBool gUnfixed=EFalse;
    43 
    44 
    45 class CTestData:public CBase
    46 
    47 	{
    48 	public:
    49 		static CTestData* NewL(const TDesC& aFilename);
    50 		enum TType { EMessage, EData, EFinished,EFileName,EError=-1 } ;
    51 		TType Type(void);
    52 		HBufC* Message(void);
    53 		HBufC8* operator [] (TInt aIndex);
    54 		~CTestData(void);
    55 	private:
    56 		CTestData(void);
    57 		TInt iCurrentPlace;
    58 		void ConstructL(const TDesC& aFilename);
    59 		HBufC8* iLine;
    60 		HBufC8* iFile;
    61 	};
    62 
    63 
    64 class CTestConsole:public CConsoleBase
    65 
    66 	{
    67 	public:
    68 		static CTestConsole* NewL(CConsoleBase* aCon);
    69 		TInt Create(const TDesC16& aTitle,TSize aSize) {return iCon->Create(aTitle,aSize);};
    70 		void Read(TRequestStatus& aStatus) {iCon->Read(aStatus);};
    71 		void ReadCancel(void) {iCon->ReadCancel();};
    72 		void Write(const TDesC16& aString);
    73 		TPoint CursorPos(void) const {return iCon->CursorPos();};
    74 		void SetCursorPosAbs(const TPoint& aPos) {iCon->SetCursorPosAbs(aPos);};
    75 		void SetCursorPosRel(const TPoint& aPos) {iCon->SetCursorPosRel(aPos);};
    76 		void SetCursorHeight(TInt aHeight) {iCon->SetCursorHeight(aHeight);};
    77 		void SetTitle(const TDesC16& aTitle) {iCon->SetTitle(aTitle);};
    78 		void ClearScreen(void) {iCon->ClearScreen();};
    79 		void ClearToEndOfLine(void) {iCon->ClearToEndOfLine();};
    80 		TSize ScreenSize(void) const {return iCon->ScreenSize();};
    81 		TKeyCode KeyCode(void) const {return iCon->KeyCode();};
    82 		TUint KeyModifiers(void) const {return iCon->KeyModifiers();};
    83 		~CTestConsole(void);
    84 		void SetLogFile(RFile* aFile);
    85 	private:
    86 		CTestConsole(void);
    87 		CConsoleBase* iCon;
    88 		RFile* iFile;
    89 	};
    90