os/security/cryptoservices/certificateandkeymgmt/tasn1/testfactory.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2001-2009 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 * Implementation for test object factory
    16 *
    17 */
    18 
    19 
    20 #include "testfactory.h"
    21 #include "testnull.h"
    22 #include "testboolean.h"
    23 #include "testint.h"
    24 #include "testbigint.h"
    25 #include "testoctetstr.h"
    26 #include "testoid.h"
    27 #include "testgeneralizedtime.h"
    28 #include "testsequence.h"
    29 #include "testexplicittag.h"
    30 #include "testimplicittag.h"
    31 #include "testoutput.h"
    32 
    33 
    34 // Make different object for each index, else return 0
    35 CTestBase* TTestFactory::MakeTestLC(const TInt aIndex)
    36 	{
    37 	switch (aIndex)
    38 		{
    39 		case 0:
    40 			return CTestNull::NewLC();
    41 		case 1: 
    42 			return CTestBoolean::NewLC();
    43 		case 2:
    44 			return CTestInt::NewLC();
    45 		case 3:
    46 			return CTestBigInt::NewLC();
    47 		case 4:
    48 			return CTestOctetString::NewLC();
    49 		case 5:
    50 			return CTestOID::NewLC();
    51 		case 6:
    52 			return CTestGeneralizedTime::NewLC();
    53 		case 7:
    54 			return CTestSequence::NewLC();
    55 		case 8:
    56 			return CTestExplicitTag::NewLC();
    57 		case 9:
    58 			return CTestImplicitTag::NewLC();
    59 		case 10:
    60 			return CTestOutput::NewLC();
    61 		default:
    62 			return 0;
    63 		}
    64 	}