os/security/cryptoservices/certificateandkeymgmt/tasn1/main.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/tasn1/main.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,56 @@
     1.4 +/*
     1.5 +* Copyright (c) 1998-2010 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 +* TPKIXCERTMAIN.CPP
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#include <e32base.h>
    1.24 +#include "t_testhandler.h"
    1.25 +#include "tasn1normaltest.h"
    1.26 +#include "tScriptTests.h"
    1.27 +#include "tScriptSetup.h"
    1.28 +#include <random.h>
    1.29 +
    1.30 +LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
    1.31 +    {
    1.32 +    CSystemRandom *rng = CSystemRandom::NewL();
    1.33 +    SetThreadRandomLC(rng);
    1.34 +
    1.35 +	START_SCRIPT_LIST
    1.36 +	SCRIPT_ITEM(CASN1NormalTest, _L8("Normal"))
    1.37 +	END_SCRIPT_LIST
    1.38 +	
    1.39 +	TDriveUnit sysDrive (RFs::GetSystemDrive());
    1.40 +	TDriveName driveName(sysDrive.Name());
    1.41 +	TBuf<64> scriptFile (driveName);
    1.42 +	scriptFile.Append(_L("\\tasn1\\scripts\\tasn1.txt"));
    1.43 +	CScriptSetup::CreateAndRunTestsL(theTestTypes, scriptFile, _L("tasn1.log"));
    1.44 +	
    1.45 +	DestroyThreadRandom();
    1.46 +	CleanupStack::Pop(); // Pop the cleanup item which would have reset/delete the threadrandom
    1.47 +    }
    1.48 +
    1.49 +GLDEF_C TInt E32Main() // main function called by E32
    1.50 +    {
    1.51 +	__UHEAP_MARK;
    1.52 +	CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
    1.53 +	TRAP_IGNORE(callExampleL());
    1.54 +	// dont panic in case its a syntax error in script.
    1.55 +	//__ASSERT_ALWAYS(!error,User::Panic(_L("CERT"),error));
    1.56 +	delete cleanup; // destroy clean-up stack
    1.57 +	__UHEAP_MARKEND;
    1.58 +	return 0;
    1.59 +    }