testexecfw/tef/test/regressiontest/teststep/src/readconfigstep.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 ReadConfigStep.cpp
       
    23 */
       
    24 #include "ReadConfigStep.h"
       
    25 #include "Te_RegStepTestSuiteDefs.h"
       
    26 
       
    27 CReadConfigStep::~CReadConfigStep()
       
    28 /**
       
    29  * Destructor
       
    30  */
       
    31 	{
       
    32 	}
       
    33 
       
    34 CReadConfigStep::CReadConfigStep()
       
    35 /**
       
    36  * Constructor
       
    37  */
       
    38 	{
       
    39 	// **MUST** call SetTestStepName in the constructor as the controlling
       
    40 	// framework uses the test step name immediately following construction to set
       
    41 	// up the step's unique logging ID.
       
    42 	SetTestStepName(KReadConfigStep);
       
    43 	}
       
    44 
       
    45 TVerdict CReadConfigStep::doTestStepPreambleL()
       
    46 /**
       
    47  * @return - TVerdict code
       
    48  * Override of base class virtual
       
    49  */
       
    50 	{
       
    51 	// There is no initiation work so set this result to pass.
       
    52 	SetTestStepResult(EPass);
       
    53 	return TestStepResult();
       
    54 	}
       
    55 
       
    56 
       
    57 TVerdict CReadConfigStep::doTestStepL()
       
    58 /**
       
    59  * @return - TVerdict code
       
    60  * Override of base class pure virtual
       
    61  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    62  * not leave. That being the case, the current test result value will be EPass.
       
    63  */
       
    64 	{
       
    65 	INFO_PRINTF1(_L("This step tests the function of GetXXXFromConfig."));
       
    66 	SetTestStepResult(EFail);
       
    67 	
       
    68 	TPtrC TheString;
       
    69 	TBool TheBool;
       
    70 	TInt TheInt;
       
    71 	TInt64 TheInt64;
       
    72 	if(!GetStringFromConfig(ConfigSection(),KTe_RegressionSuiteString, TheString) ||
       
    73 		!GetBoolFromConfig(ConfigSection(),KTe_RegressionSuiteBool,TheBool) ||
       
    74 		!GetIntFromConfig(ConfigSection(),KTe_RegressionSuiteInt,TheInt)||
       
    75 		!GetIntFromConfig(ConfigSection(),KTe_RegressionSuiteInt64,TheInt64)
       
    76 		)
       
    77 		{
       
    78 		// Leave if there's any error.
       
    79 		User::Leave(KErrNotFound);
       
    80 		}
       
    81 	else
       
    82 		{
       
    83 		SetTestStepResult(EPass);
       
    84 		}
       
    85 
       
    86 	return TestStepResult();
       
    87 	}
       
    88 
       
    89 
       
    90 
       
    91 TVerdict CReadConfigStep::doTestStepPostambleL()
       
    92 /**
       
    93  * @return - TVerdict code
       
    94  * Override of base class virtual
       
    95  */
       
    96 	{
       
    97 	return TestStepResult();
       
    98 	}