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: * TPKIXCERTMAIN.CPP sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include "t_testhandler.h" sl@0: #include "tasn1normaltest.h" sl@0: #include "tScriptTests.h" sl@0: #include "tScriptSetup.h" sl@0: #include sl@0: sl@0: LOCAL_D void callExampleL() // initialize and call example code under cleanup stack sl@0: { sl@0: CSystemRandom *rng = CSystemRandom::NewL(); sl@0: SetThreadRandomLC(rng); sl@0: sl@0: START_SCRIPT_LIST sl@0: SCRIPT_ITEM(CASN1NormalTest, _L8("Normal")) sl@0: END_SCRIPT_LIST sl@0: sl@0: TDriveUnit sysDrive (RFs::GetSystemDrive()); sl@0: TDriveName driveName(sysDrive.Name()); sl@0: TBuf<64> scriptFile (driveName); sl@0: scriptFile.Append(_L("\\tasn1\\scripts\\tasn1.txt")); sl@0: CScriptSetup::CreateAndRunTestsL(theTestTypes, scriptFile, _L("tasn1.log")); 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: TRAP_IGNORE(callExampleL()); sl@0: // dont panic in case its a syntax error in script. sl@0: //__ASSERT_ALWAYS(!error,User::Panic(_L("CERT"),error)); sl@0: delete cleanup; // destroy clean-up stack sl@0: __UHEAP_MARKEND; sl@0: return 0; sl@0: }