1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/crypto/weakcrypto/test/tbigint/tbigintmain.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,100 @@
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 "t_testsetup.h"
1.26 +#include "t_input.h"
1.27 +#include "t_output.h"
1.28 +#include "tbigint.h"
1.29 +#include "tconstructionfb.h"
1.30 +#include "tconstructionvector.h"
1.31 +#include "tbasicmathsvector.h"
1.32 +#include "tbasicmathsfb.h"
1.33 +#include "tmontgomeryvector.h"
1.34 +#include "tmontgomeryfb.h"
1.35 +#include "tprimevector.h"
1.36 +#include "tmontgomeryperformance.h"
1.37 +#include "tprimegenperformance.h"
1.38 +#include "tprimevectorperformance.h"
1.39 +#include "tprimegen.h"
1.40 +#include "tprimegenvector.h"
1.41 +
1.42 +LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
1.43 + {
1.44 + START_SCRIPT_LIST
1.45 + SCRIPT_ITEM(CMontgomeryPerformance,_L8("MontgomeryPerformance")),
1.46 + SCRIPT_ITEM(CPrimeVector,_L8("PrimeVector")),
1.47 + SCRIPT_ITEM(CConstructionFB,_L8("ConstructionFB")),
1.48 + SCRIPT_ITEM(CConstructionVector,_L8("ConstructionVector")),
1.49 + SCRIPT_ITEM(CBasicMathsVector,_L8("BasicMathsVector")),
1.50 + SCRIPT_ITEM(CBasicMathsFB,_L8("BasicMathsFB")),
1.51 + SCRIPT_ITEM(CMontgomeryVector,_L8("MontgomeryVector")),
1.52 + SCRIPT_ITEM(CMontgomeryFB,_L8("MontgomeryFB")),
1.53 + SCRIPT_ITEM(CPrimeGenPerformance,_L8("PrimeGenPerformance")),
1.54 + SCRIPT_ITEM(CPrimeVectorPerformance,_L8("PrimeVectorPerformance")),
1.55 + SCRIPT_ITEM(CPrimeGen,_L8("PrimeGen")),
1.56 + SCRIPT_ITEM(CPrimeGenVector,_L8("PrimeGenVector"))
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 + TDriveUnit sysDrive (static_cast <TInt> (RFs::GetSystemDrive()));
1.63 + TBuf<64> scriptFile = sysDrive.Name();
1.64 + scriptFile.Append(_L("\\tbigint\\tbasicmathstests.txt"));
1.65 + TBuf<64> logFile = sysDrive.Name();
1.66 + logFile.Append(_L("\\tbigint\\tbasicmaths.log"));
1.67 +
1.68 + CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile);
1.69 +
1.70 +/* CTestSetup::CreateAndRunTestsL(theTestTypes,
1.71 + _L("c:\\tbigint\\tconstructiontests.txt"),
1.72 + _L("c:\\tbigint\\tconstruction.log"));
1.73 + CTestSetup::CreateAndRunTestsL(theTestTypes,
1.74 + _L("c:\\tbigint\\tprimegen.txt"),
1.75 + _L("c:\\tbigint\\tprimegen.log"));
1.76 + CTestSetup::CreateAndRunTestsL(theTestTypes,
1.77 + _L("c:\\tbigint\\tprimegenperformance.txt"),
1.78 + _L("c:\\tbigint\\tprimegenperformance.log"));
1.79 + CTestSetup::CreateAndRunTestsL(theTestTypes,
1.80 + _L("c:\\tbigint\\tmontgomerytests.txt"),
1.81 + _L("c:\\tbigint\\tmontgomery.log"));
1.82 + CTestSetup::CreateAndRunTestsL(theTestTypes,
1.83 + _L("c:\\tbigint\\tperformancetests.txt"),
1.84 + _L("c:\\tbigint\\tperformance.log"));
1.85 + CTestSetup::CreateAndRunTestsL(theTestTypes,
1.86 + _L("c:\\tbigint\\tprimetests.txt"),
1.87 + _L("c:\\tbigint\\tprime.log"));
1.88 + CTestSetup::CreateAndRunTestsL(theTestTypes,
1.89 + _L("c:\\tbigint\\tprimetests2.txt"),
1.90 + _L("c:\\tbigint\\tprime2.log"));
1.91 +*/
1.92 + }
1.93 +
1.94 +GLDEF_C TInt E32Main() // main function called by E32
1.95 + {
1.96 + __UHEAP_MARK;
1.97 + CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
1.98 + TRAPD(error, callExampleL());
1.99 + __ASSERT_ALWAYS(!error,User::Panic(_L("bigint"),error));
1.100 + delete cleanup; // destroy clean-up stack
1.101 + __UHEAP_MARKEND;
1.102 + return 0;
1.103 + }