diff -r f92a4f87e424 -r 012cc2ee6408 usbmgmt/usbmgr/test/cit/ROMConfig/src/cteststepusbromconfigbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbmgmt/usbmgr/test/cit/ROMConfig/src/cteststepusbromconfigbase.cpp Wed Sep 01 12:35:00 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cteststepusbromconfigbase.h" + +_LIT(KUsbExcludedKeyName, "UsbExcluded"); + +CTestStepUsbRomConfigBase::~CTestStepUsbRomConfigBase() + { + } + +/** +Constructor sets the default test result to inconclusive +Up to the test to either explicitly fail the test or to +explicitly pass +*/ +CTestStepUsbRomConfigBase::CTestStepUsbRomConfigBase(CTestServer& aParent) + : iParent(aParent) + { + SetTestStepResult(EInconclusive); + } + +/** +The ROMConfig tests run in two configurations: +ROM with component included +ROM with component excluded +By specifying the appropriate ini section, the test behaviour can be altered +*/ +TVerdict CTestStepUsbRomConfigBase::doTestStepPreambleL() + { + if ( GetBoolFromConfig(ConfigSection(),KUsbExcludedKeyName, iUsbExcluded) ) + { + return EPass; + } + return EFail; + } + +/** +Should be called at the end of every test +Checks if the default (EInconclusive) result is still set +i.e. test has NOT set the result to EFail +If still EInconclusive, then sets the result to EPass. +*/ +void CTestStepUsbRomConfigBase::CheckAndSetTestResult() + { + if ( TestStepResult()==EInconclusive ) + { + SetTestStepResult(EPass); + } + } + +// EOF