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