os/security/cryptoservices/certificateandkeymgmt/tasn1/testfactory.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/tasn1/testfactory.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,64 @@
     1.4 +/*
     1.5 +* Copyright (c) 2001-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 +* Implementation for test object factory
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#include "testfactory.h"
    1.24 +#include "testnull.h"
    1.25 +#include "testboolean.h"
    1.26 +#include "testint.h"
    1.27 +#include "testbigint.h"
    1.28 +#include "testoctetstr.h"
    1.29 +#include "testoid.h"
    1.30 +#include "testgeneralizedtime.h"
    1.31 +#include "testsequence.h"
    1.32 +#include "testexplicittag.h"
    1.33 +#include "testimplicittag.h"
    1.34 +#include "testoutput.h"
    1.35 +
    1.36 +
    1.37 +// Make different object for each index, else return 0
    1.38 +CTestBase* TTestFactory::MakeTestLC(const TInt aIndex)
    1.39 +	{
    1.40 +	switch (aIndex)
    1.41 +		{
    1.42 +		case 0:
    1.43 +			return CTestNull::NewLC();
    1.44 +		case 1: 
    1.45 +			return CTestBoolean::NewLC();
    1.46 +		case 2:
    1.47 +			return CTestInt::NewLC();
    1.48 +		case 3:
    1.49 +			return CTestBigInt::NewLC();
    1.50 +		case 4:
    1.51 +			return CTestOctetString::NewLC();
    1.52 +		case 5:
    1.53 +			return CTestOID::NewLC();
    1.54 +		case 6:
    1.55 +			return CTestGeneralizedTime::NewLC();
    1.56 +		case 7:
    1.57 +			return CTestSequence::NewLC();
    1.58 +		case 8:
    1.59 +			return CTestExplicitTag::NewLC();
    1.60 +		case 9:
    1.61 +			return CTestImplicitTag::NewLC();
    1.62 +		case 10:
    1.63 +			return CTestOutput::NewLC();
    1.64 +		default:
    1.65 +			return 0;
    1.66 +		}
    1.67 +	}