os/security/cryptoservices/certificateandkeymgmt/tx509/SyntaxTest.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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  @file 
    22  @internalTechnology
    23 */
    24  
    25 #ifndef __CSyntaxTest_H
    26 #define __CSyntaxTest_H
    27 
    28 #include "t_testaction.h"
    29 #include "tcertwriter.h"
    30 #include "SyntaxResult.h"
    31 
    32 _LIT(KResultsFile, "Results.txt");
    33 
    34 class CSyntaxTest : public CTestAction  
    35 {
    36 public:
    37 	static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole, 
    38 		Output& aOut, const TTestActionSpec& aTestActionSpec);
    39 	static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
    40 		Output& aOut, const TTestActionSpec& aTestActionSpec);
    41 	~CSyntaxTest();
    42 
    43 public:
    44 	virtual void DoPerformPrerequisite(TRequestStatus& aStatus);
    45 	virtual void DoPerformPostrequisite(TRequestStatus& aStatus);
    46 	virtual void PerformAction(TRequestStatus& aStatus);
    47 
    48 	virtual void DoReportAction();
    49 	virtual void DoCheckResult(TInt aError);
    50     virtual void Reset();
    51 
    52 private:
    53 	CSyntaxTest(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
    54 	void ConstructL(const TTestActionSpec& aTestActionSpec);
    55 	HBufC8* readCertLC(const TDesC &aFilename);
    56 	void ReadAndSyntaxCheckL(const TDesC &aFilename);
    57 	void TestInternalizeExternalizeL(CX509Certificate* aCert);
    58 	TBool LoadResultsL(void);
    59 	TBool CheckResult(const TDesC &aFilename, const TInt &aError);
    60 	void PrintError(const TInt &aError);
    61 
    62 private:
    63 	RFs& iFs;
    64 	CDir* iDirList;
    65 	TInt nFileNumber;
    66 	TBuf<128> iPath;
    67 	RFile iLogFile;
    68 	FileOutput* iSyntaxOut;
    69 	CertWriter* iWriter;
    70 	static TInt nInstances;
    71 	RPointerArray<CSyntaxResult> *iExpectedResults;
    72 };
    73 
    74 #endif