crypto/weakcrypto/test/tbigint/tbigintmain.cpp
changeset 0 2c201484c85f
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 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32base.h>
       
    20 #include "t_testhandler.h"
       
    21 #include "tscripttests.h"
       
    22 #include "t_testsetup.h"
       
    23 #include "t_input.h"
       
    24 #include "t_output.h"
       
    25 #include "tbigint.h"
       
    26 #include "tconstructionfb.h"
       
    27 #include "tconstructionvector.h"
       
    28 #include "tbasicmathsvector.h"
       
    29 #include "tbasicmathsfb.h"
       
    30 #include "tmontgomeryvector.h"
       
    31 #include "tmontgomeryfb.h"
       
    32 #include "tprimevector.h"
       
    33 #include "tmontgomeryperformance.h"
       
    34 #include "tprimegenperformance.h"
       
    35 #include "tprimevectorperformance.h"
       
    36 #include "tprimegen.h"
       
    37 #include "tprimegenvector.h"
       
    38 
       
    39 LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
       
    40     {
       
    41     START_SCRIPT_LIST
       
    42 	SCRIPT_ITEM(CMontgomeryPerformance,_L8("MontgomeryPerformance")),
       
    43 	SCRIPT_ITEM(CPrimeVector,_L8("PrimeVector")),
       
    44 	SCRIPT_ITEM(CConstructionFB,_L8("ConstructionFB")),
       
    45 	SCRIPT_ITEM(CConstructionVector,_L8("ConstructionVector")),
       
    46 	SCRIPT_ITEM(CBasicMathsVector,_L8("BasicMathsVector")),
       
    47 	SCRIPT_ITEM(CBasicMathsFB,_L8("BasicMathsFB")),
       
    48 	SCRIPT_ITEM(CMontgomeryVector,_L8("MontgomeryVector")),
       
    49 	SCRIPT_ITEM(CMontgomeryFB,_L8("MontgomeryFB")),
       
    50 	SCRIPT_ITEM(CPrimeGenPerformance,_L8("PrimeGenPerformance")),
       
    51 	SCRIPT_ITEM(CPrimeVectorPerformance,_L8("PrimeVectorPerformance")),
       
    52 	SCRIPT_ITEM(CPrimeGen,_L8("PrimeGen")),
       
    53 	SCRIPT_ITEM(CPrimeGenVector,_L8("PrimeGenVector"))
       
    54 	END_SCRIPT_LIST
       
    55 
       
    56 //	Either run the top level build and test script or, if running this test specifically, 
       
    57 //	uncomment the following and it'll run them all one after the other
       
    58 
       
    59 	TDriveUnit sysDrive (static_cast <TInt> (RFs::GetSystemDrive()));
       
    60 	TBuf<64> scriptFile = sysDrive.Name();
       
    61 	scriptFile.Append(_L("\\tbigint\\tbasicmathstests.txt"));
       
    62 	TBuf<64> logFile = sysDrive.Name();
       
    63 	logFile.Append(_L("\\tbigint\\tbasicmaths.log"));
       
    64 	
       
    65 	CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile);
       
    66 	
       
    67 /*	CTestSetup::CreateAndRunTestsL(theTestTypes, 
       
    68 		_L("c:\\tbigint\\tconstructiontests.txt"),
       
    69 		_L("c:\\tbigint\\tconstruction.log"));
       
    70 	CTestSetup::CreateAndRunTestsL(theTestTypes, 
       
    71 		_L("c:\\tbigint\\tprimegen.txt"),
       
    72 		_L("c:\\tbigint\\tprimegen.log"));
       
    73 	CTestSetup::CreateAndRunTestsL(theTestTypes, 
       
    74 		_L("c:\\tbigint\\tprimegenperformance.txt"),
       
    75 		_L("c:\\tbigint\\tprimegenperformance.log"));
       
    76 	CTestSetup::CreateAndRunTestsL(theTestTypes, 
       
    77 		_L("c:\\tbigint\\tmontgomerytests.txt"),
       
    78 		_L("c:\\tbigint\\tmontgomery.log"));
       
    79 	CTestSetup::CreateAndRunTestsL(theTestTypes, 
       
    80 		_L("c:\\tbigint\\tperformancetests.txt"),
       
    81 		_L("c:\\tbigint\\tperformance.log"));
       
    82 	CTestSetup::CreateAndRunTestsL(theTestTypes, 
       
    83 		_L("c:\\tbigint\\tprimetests.txt"),
       
    84 		_L("c:\\tbigint\\tprime.log"));
       
    85 	CTestSetup::CreateAndRunTestsL(theTestTypes, 
       
    86 		_L("c:\\tbigint\\tprimetests2.txt"),
       
    87 		_L("c:\\tbigint\\tprime2.log"));
       
    88 */
       
    89     }
       
    90 
       
    91 GLDEF_C TInt E32Main() // main function called by E32
       
    92     {
       
    93 	__UHEAP_MARK;
       
    94 	CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
       
    95 	TRAPD(error, callExampleL());
       
    96 	__ASSERT_ALWAYS(!error,User::Panic(_L("bigint"),error));
       
    97 	delete cleanup; // destroy clean-up stack
       
    98 	__UHEAP_MARKEND;
       
    99 	return 0;
       
   100     }