os/security/cryptoservices/certificateandkeymgmt/tasn1/main.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 1998-2010 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 * TPKIXCERTMAIN.CPP
    16 *
    17 */
    18 
    19 
    20 #include <e32base.h>
    21 #include "t_testhandler.h"
    22 #include "tasn1normaltest.h"
    23 #include "tScriptTests.h"
    24 #include "tScriptSetup.h"
    25 #include <random.h>
    26 
    27 LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
    28     {
    29     CSystemRandom *rng = CSystemRandom::NewL();
    30     SetThreadRandomLC(rng);
    31 
    32 	START_SCRIPT_LIST
    33 	SCRIPT_ITEM(CASN1NormalTest, _L8("Normal"))
    34 	END_SCRIPT_LIST
    35 	
    36 	TDriveUnit sysDrive (RFs::GetSystemDrive());
    37 	TDriveName driveName(sysDrive.Name());
    38 	TBuf<64> scriptFile (driveName);
    39 	scriptFile.Append(_L("\\tasn1\\scripts\\tasn1.txt"));
    40 	CScriptSetup::CreateAndRunTestsL(theTestTypes, scriptFile, _L("tasn1.log"));
    41 	
    42 	DestroyThreadRandom();
    43 	CleanupStack::Pop(); // Pop the cleanup item which would have reset/delete the threadrandom
    44     }
    45 
    46 GLDEF_C TInt E32Main() // main function called by E32
    47     {
    48 	__UHEAP_MARK;
    49 	CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
    50 	TRAP_IGNORE(callExampleL());
    51 	// dont panic in case its a syntax error in script.
    52 	//__ASSERT_ALWAYS(!error,User::Panic(_L("CERT"),error));
    53 	delete cleanup; // destroy clean-up stack
    54 	__UHEAP_MARKEND;
    55 	return 0;
    56     }