testexecmdw/tef/tef/test/regressiontest/teststep/src/leaveforever.cpp
branchRCL_3
changeset 3 9397a16b6eb8
parent 1 6edeef394eb7
equal deleted inserted replaced
1:6edeef394eb7 3:9397a16b6eb8
     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 *
       
    16 */
       
    17 
       
    18 #include "leaveforever.h"
       
    19 
       
    20 CLeaveForever::CLeaveForever()
       
    21 	{
       
    22 	SetTestStepName(KLeaveForever);
       
    23 	}
       
    24 
       
    25 CLeaveForever::~CLeaveForever()
       
    26 	{
       
    27 	}
       
    28 
       
    29 /**
       
    30  * @return - TVerdict code
       
    31  * Override of base class pure virtual
       
    32  * This step tests the behavior of TEF when leave occurs.
       
    33  */
       
    34 TVerdict CLeaveForever::doTestStepL()
       
    35 	{
       
    36 	INFO_PRINTF1(_L("This step should leave!"));
       
    37 	SetTestStepResult(EFail);
       
    38 	TInt TheInt;
       
    39 	_LIT(KLeaveNumber,"leavenum");
       
    40 	if (!GetIntFromConfig(ConfigSection(),KLeaveNumber, TheInt))
       
    41 		{
       
    42 		ERR_PRINTF2(_L("The Leave Number section \"%S\" not found"),KLeaveNumber);
       
    43 		}
       
    44 	else
       
    45 		{
       
    46 		INFO_PRINTF2(_L("The Leave Number is %d"),TheInt);
       
    47 		SetTestStepResult(EPass);
       
    48 		User::Leave(TheInt);
       
    49 		ERR_PRINTF1(_L("Test failed as there is no leave occurs!"));
       
    50 		//This line should never approach if leave occurs.
       
    51 		SetTestStepResult(EFail);
       
    52 		}
       
    53 	
       
    54 	return TestStepResult();
       
    55 	}