usbmgmt/usbmgr/test/cit/ROMConfig/src/cteststepusbromconfigbase.cpp
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     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 "cteststepusbromconfigbase.h"
       
    19 
       
    20 _LIT(KUsbExcludedKeyName, "UsbExcluded");
       
    21 
       
    22 CTestStepUsbRomConfigBase::~CTestStepUsbRomConfigBase()
       
    23 	{
       
    24     }
       
    25 	
       
    26 /**
       
    27 Constructor sets the default test result to inconclusive
       
    28 Up to the test to either explicitly fail the test or to 
       
    29 explicitly pass
       
    30 */
       
    31 CTestStepUsbRomConfigBase::CTestStepUsbRomConfigBase(CTestServer& aParent) 
       
    32 	: iParent(aParent)
       
    33 	{
       
    34 	SetTestStepResult(EInconclusive);
       
    35 	}
       
    36 
       
    37 /**
       
    38 The ROMConfig tests run in two configurations:
       
    39 ROM with component included
       
    40 ROM with component excluded
       
    41 By specifying the appropriate ini section, the test behaviour can be altered
       
    42 */
       
    43 TVerdict CTestStepUsbRomConfigBase::doTestStepPreambleL()
       
    44 	{
       
    45 	if ( GetBoolFromConfig(ConfigSection(),KUsbExcludedKeyName, iUsbExcluded) )
       
    46 		{
       
    47 		return EPass;
       
    48 		}
       
    49 	return EFail;	
       
    50 	}
       
    51 	
       
    52 /**
       
    53 Should be called at the end of every test
       
    54 Checks if the default (EInconclusive) result is still set
       
    55 i.e. test has NOT set the result to EFail
       
    56 If still EInconclusive, then sets the result to EPass.
       
    57 */	
       
    58 void CTestStepUsbRomConfigBase::CheckAndSetTestResult()	
       
    59 	{
       
    60 	if ( TestStepResult()==EInconclusive )
       
    61 		{
       
    62 		SetTestStepResult(EPass);
       
    63 		}
       
    64 	}
       
    65 	
       
    66 // EOF