sl@0: /* sl@0: * Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include "t_testhandler.h" sl@0: #include "tScriptTests.h" sl@0: #include "t_testsetup.h" sl@0: #include "t_input.h" sl@0: #include "t_output.h" sl@0: #include "tbigint.h" sl@0: #include "tconstructionfb.h" sl@0: #include "tconstructionvector.h" sl@0: #include "tbasicmathsvector.h" sl@0: #include "tbasicmathsfb.h" sl@0: #include "tmontgomeryvector.h" sl@0: #include "tmontgomeryfb.h" sl@0: #include "tprimevector.h" sl@0: #include "tmontgomeryperformance.h" sl@0: #include "tprimegenperformance.h" sl@0: #include "tprimevectorperformance.h" sl@0: #include "tprimegen.h" sl@0: #include "tprimegenvector.h" sl@0: #include sl@0: sl@0: LOCAL_D void callExampleL() // initialize and call example code under cleanup stack sl@0: { sl@0: START_SCRIPT_LIST sl@0: SCRIPT_ITEM(CMontgomeryPerformance,_L8("MontgomeryPerformance")), sl@0: SCRIPT_ITEM(CPrimeVector,_L8("PrimeVector")), sl@0: SCRIPT_ITEM(CConstructionFB,_L8("ConstructionFB")), sl@0: SCRIPT_ITEM(CConstructionVector,_L8("ConstructionVector")), sl@0: SCRIPT_ITEM(CBasicMathsVector,_L8("BasicMathsVector")), sl@0: SCRIPT_ITEM(CBasicMathsFB,_L8("BasicMathsFB")), sl@0: SCRIPT_ITEM(CMontgomeryVector,_L8("MontgomeryVector")), sl@0: SCRIPT_ITEM(CMontgomeryFB,_L8("MontgomeryFB")), sl@0: SCRIPT_ITEM(CPrimeGenPerformance,_L8("PrimeGenPerformance")), sl@0: SCRIPT_ITEM(CPrimeVectorPerformance,_L8("PrimeVectorPerformance")), sl@0: SCRIPT_ITEM(CPrimeGen,_L8("PrimeGen")), sl@0: SCRIPT_ITEM(CPrimeGenVector,_L8("PrimeGenVector")) sl@0: END_SCRIPT_LIST sl@0: sl@0: // Either run the top level build and test script or, if running this test specifically, sl@0: // uncomment the following and it'll run them all one after the other sl@0: sl@0: CSystemRandom *rng = CSystemRandom::NewL(); sl@0: SetThreadRandomLC(rng); sl@0: sl@0: TDriveUnit sysDrive (static_cast (RFs::GetSystemDrive())); sl@0: TBuf<64> scriptFile = sysDrive.Name(); sl@0: scriptFile.Append(_L("\\tbigint\\tbasicmathstests.txt")); sl@0: TBuf<64> logFile = sysDrive.Name(); sl@0: logFile.Append(_L("\\tbigint\\tbasicmaths.log")); sl@0: sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile); sl@0: sl@0: /* CTestSetup::CreateAndRunTestsL(theTestTypes, sl@0: _L("c:\\tbigint\\tconstructiontests.txt"), sl@0: _L("c:\\tbigint\\tconstruction.log")); sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, sl@0: _L("c:\\tbigint\\tprimegen.txt"), sl@0: _L("c:\\tbigint\\tprimegen.log")); sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, sl@0: _L("c:\\tbigint\\tprimegenperformance.txt"), sl@0: _L("c:\\tbigint\\tprimegenperformance.log")); sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, sl@0: _L("c:\\tbigint\\tmontgomerytests.txt"), sl@0: _L("c:\\tbigint\\tmontgomery.log")); sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, sl@0: _L("c:\\tbigint\\tperformancetests.txt"), sl@0: _L("c:\\tbigint\\tperformance.log")); sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, sl@0: _L("c:\\tbigint\\tprimetests.txt"), sl@0: _L("c:\\tbigint\\tprime.log")); sl@0: CTestSetup::CreateAndRunTestsL(theTestTypes, sl@0: _L("c:\\tbigint\\tprimetests2.txt"), sl@0: _L("c:\\tbigint\\tprime2.log")); sl@0: */ sl@0: sl@0: DestroyThreadRandom(); sl@0: CleanupStack::Pop(); // Pop the cleanup item which would have reset/delete the threadrandom sl@0: } sl@0: sl@0: GLDEF_C TInt E32Main() // main function called by E32 sl@0: { sl@0: __UHEAP_MARK; sl@0: CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack sl@0: TRAPD(error, callExampleL()); sl@0: __ASSERT_ALWAYS(!error,User::Panic(_L("bigint"),error)); sl@0: delete cleanup; // destroy clean-up stack sl@0: __UHEAP_MARKEND; sl@0: return 0; sl@0: }