testexecfw/tef/test/regressiontest/teststep/src/oomteststep.cpp
changeset 0 3e07fef1e154
equal deleted inserted replaced
-1:000000000000 0:3e07fef1e154
       
     1 /*
       
     2 * Copyright (c) 2005-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 "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 * Example CTestStep derived implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file WriteStringStep.cpp
       
    23 */
       
    24 #include "OOMStep.h"
       
    25 #include "Te_RegStepTestSuiteDefs.h"
       
    26 
       
    27 _LIT(KIterationCount, "IterationCount");
       
    28 
       
    29 COOMTestStep::~COOMTestStep()
       
    30 /**
       
    31  * Destructor
       
    32  */
       
    33 	{
       
    34 	}
       
    35 
       
    36 COOMTestStep::COOMTestStep()
       
    37 /**
       
    38  * Constructor
       
    39  */
       
    40 	{
       
    41 	SetTestStepName(KOOMTestStep);
       
    42 	}
       
    43 
       
    44 TVerdict COOMTestStep::doTestStepPreambleL()
       
    45 /**
       
    46  * @return - TVerdict code
       
    47  * Override of base class virtual
       
    48  */
       
    49 	{
       
    50 	SetTestStepResult(EFail);
       
    51 	if (GetIntFromConfig(ConfigSection(), KIterationCount, iIterationCount))
       
    52 		{
       
    53 		SetTestStepResult(EPass);
       
    54 		}
       
    55 	
       
    56 	return TestStepResult();
       
    57 	}
       
    58 
       
    59 
       
    60 TVerdict COOMTestStep::doTestStepL()
       
    61 /**
       
    62  * @return - TVerdict code
       
    63  * Override of base class pure virtual
       
    64  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    65  * not leave. That being the case, the current test result value will be EPass.
       
    66  */
       
    67 	{
       
    68 	SetTestStepResult(EFail);
       
    69 	iIterationIndex++;
       
    70 	for (TInt i=0; i<iIterationCount; i++)
       
    71 		{
       
    72 		TInt* testVar = new (ELeave) TInt;
       
    73 		delete testVar;
       
    74 		}
       
    75 	
       
    76 	if (iIterationIndex == iIterationCount+2)
       
    77 		{
       
    78 		SetTestStepResult(EPass);
       
    79 		}
       
    80 	
       
    81 	return TestStepResult();
       
    82 	}
       
    83 
       
    84 
       
    85 
       
    86 TVerdict COOMTestStep::doTestStepPostambleL()
       
    87 /**
       
    88  * @return - TVerdict code
       
    89  * Override of base class virtual
       
    90  */
       
    91 	{
       
    92 	return TestStepResult();
       
    93 	}