cryptoservices/certificateandkeymgmt/tx509/SyntaxTest.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 1998-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 * CSyntaxTest class implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file 
       
    24  @internalTechnology
       
    25 */
       
    26  
       
    27 #ifndef __CSyntaxTest_H
       
    28 #define __CSyntaxTest_H
       
    29 
       
    30 #include "t_testaction.h"
       
    31 #include "tcertwriter.h"
       
    32 #include "SyntaxResult.h"
       
    33 
       
    34 _LIT(KResultsFile, "Results.txt");
       
    35 
       
    36 class CSyntaxTest : public CTestAction  
       
    37 {
       
    38 public:
       
    39 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, 
       
    40 		Output& aOut, const TTestActionSpec& aTestActionSpec);
       
    41 	static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
       
    42 		Output& aOut, const TTestActionSpec& aTestActionSpec);
       
    43 	~CSyntaxTest();
       
    44 
       
    45 public:
       
    46 	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
       
    47 	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
       
    48 	virtual void PerformAction(TRequestStatus& aStatus);
       
    49 
       
    50 	virtual void DoReportAction();
       
    51 	virtual void DoCheckResult(TInt aError);
       
    52     virtual void Reset();
       
    53 
       
    54 private:
       
    55 	CSyntaxTest(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
       
    56 	void ConstructL(const TTestActionSpec& aTestActionSpec);
       
    57 	HBufC8* readCertLC(const TDesC &aFilename);
       
    58 	void ReadAndSyntaxCheckL(const TDesC &aFilename);
       
    59 	void TestInternalizeExternalizeL(CX509Certificate* aCert);
       
    60 	TBool LoadResultsL(void);
       
    61 	TBool CheckResult(const TDesC &aFilename, const TInt &aError);
       
    62 	void PrintError(const TInt &aError);
       
    63 
       
    64 private:
       
    65 	RFs& iFs;
       
    66 	CDir* iDirList;
       
    67 	TInt nFileNumber;
       
    68 	TBuf<128> iPath;
       
    69 	RFile iLogFile;
       
    70 	FileOutput* iSyntaxOut;
       
    71 	CertWriter* iWriter;
       
    72 	static TInt nInstances;
       
    73 	RPointerArray<CSyntaxResult> *iExpectedResults;
       
    74 };
       
    75 
       
    76 #endif