os/security/crypto/weakcrypto/test/tasymmetric/tasymmetricmain.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/crypto/weakcrypto/test/tasymmetric/tasymmetricmain.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,88 @@
     1.4 +/*
     1.5 +* Copyright (c) 1998-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 +#include <e32base.h>
    1.23 +#include "t_testhandler.h"
    1.24 +#include "tscripttests.h"
    1.25 +#include "trsaencryptfb.h"
    1.26 +#include "trsasignfb.h"
    1.27 +#include "tdsasignfb.h"
    1.28 +#include "trsavector.h"
    1.29 +#include "tdsavector.h"
    1.30 +#include "tdsasignfb.h"
    1.31 +#include "tdsaprimegen.h"
    1.32 +#include "performancetest.h"
    1.33 +#include "tdhvector.h"
    1.34 +#include "trsaparams.h"
    1.35 +
    1.36 +LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
    1.37 +    {
    1.38 +	START_SCRIPT_LIST
    1.39 +	SCRIPT_ITEM(CRSAEncryptFB,_L8("RSAEncryptStandardAndCRTFB")),
    1.40 +	SCRIPT_ITEM(CRSASignFB,_L8("RSASignStandardAndCRTFB")),
    1.41 +	SCRIPT_ITEM(CDSASignFB,_L8("DSASignFB")),
    1.42 +	SCRIPT_ITEM(CRSAEncryptVector,_L8("RSAEncryptVector")),
    1.43 +	SCRIPT_ITEM(CRSADecryptVector,_L8("RSADecryptVector")),
    1.44 +	SCRIPT_ITEM(CRSADecryptVectorCRT,_L8("RSADecryptVectorCRT")),
    1.45 +	SCRIPT_ITEM(CRSASignVector,_L8("RSASignVector")),
    1.46 +	SCRIPT_ITEM(CRSASignVectorCRT,_L8("RSASignVectorCRT")),
    1.47 +	SCRIPT_ITEM(CRSAVerifyVector,_L8("RSAVerifyVector")),
    1.48 +	SCRIPT_ITEM(CDSASignVector,_L8("DSASignVector")),
    1.49 +	SCRIPT_ITEM(CDSAVerifyVector,_L8("DSAVerifyVector")),
    1.50 +	SCRIPT_ITEM(CDSASignFB,_L8("DSASignFB")),
    1.51 +	SCRIPT_ITEM(CDSAPrimeGen,_L8("DSAPrimeGen")),
    1.52 +	SCRIPT_ITEM(CPerformanceTest, _L8("PerformanceTestSettings")),
    1.53 +	SCRIPT_ITEM(CDHVector,_L8("DHVector")),
    1.54 +	SCRIPT_ITEM(CRSATestPublicKey,_L8("RSAPublicKeyParams")),
    1.55 +	SCRIPT_ITEM(CRSATestPrivateKey,_L8("RSAPrivateKeyParams")),
    1.56 +	SCRIPT_ITEM(CRSATestPrivateKeyCRT,_L8("RSAPrivateKeyCRTParams"))
    1.57 +	END_SCRIPT_LIST
    1.58 +
    1.59 +//	Either run the top level build and test script or, if running this test specifically, 
    1.60 +//	uncomment the following and it'll run them all one after the other
    1.61 +
    1.62 +	//get the system drive.	
    1.63 +	TDriveUnit sysDrive (RFs::GetSystemDrive());
    1.64 +	TBuf<64> scriptFile = sysDrive.Name();
    1.65 +	scriptFile.Append(_L("\\tasymmetric\\tasymmetrictests.txt"));
    1.66 +	TBuf<64> logFile = sysDrive.Name();
    1.67 +	logFile.Append(_L("\\tasymmetric\\tasymmetrictests.log"));
    1.68 +	CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile);
    1.69 +	
    1.70 +/* The test framework can't handle more than one script
    1.71 + * at a time.  If you want to run all of the asymmetric tests from the command
    1.72 + * line, uncomment this next section.
    1.73 +#ifndef _DEBUG
    1.74 +	CTestSetup::CreateAndRunTestsL(theTestTypes, _L("c:\\tasymmetric\\asymmetricPerformance.txt"),
    1.75 +		_L("c:\\tasymmetric\\asymmetricPerformance.log"));	
    1.76 +#endif
    1.77 +*/
    1.78 +    }
    1.79 +
    1.80 +GLDEF_C TInt E32Main() // main function called by E32
    1.81 +    {
    1.82 +	__UHEAP_MARK;
    1.83 +	CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
    1.84 +	CPerformance::NewL();
    1.85 +	TRAPD(error, callExampleL());
    1.86 +	CPerformance::ClosePerformanceTester();
    1.87 +	__ASSERT_ALWAYS(!error,User::Panic(_L("tasymmetricmain"),error));
    1.88 +	delete cleanup; // destroy clean-up stack
    1.89 +	__UHEAP_MARKEND;
    1.90 +	return 0;
    1.91 +    }