usbmgmt/usbmgr/test/cit/ROMConfig/src/cteststepusbromconfig002.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 "cteststepusbromconfig002.h"
       
    19 
       
    20 #ifndef __WINS__
       
    21 _LIT(KUsbLddName, "EUSBC");
       
    22 #else
       
    23 _LIT(KUsbLddName, "TESTUSBC");
       
    24 #endif
       
    25 
       
    26 CTestStepUsbRomConfig002::~CTestStepUsbRomConfig002()
       
    27 	{
       
    28     }
       
    29 	
       
    30 CTestStepUsbRomConfig002::CTestStepUsbRomConfig002
       
    31 	(CTestServer& aParent) 
       
    32 	: CTestStepUsbRomConfigBase(aParent)
       
    33 	{
       
    34 	SetTestStepName(KTestName002);
       
    35 	}
       
    36 
       
    37 /**
       
    38 Static Constructor
       
    39 Note the lack of ELeave. This means that having insufficient memory will return NULL;
       
    40 */
       
    41 CTestStepUsbRomConfig002* CTestStepUsbRomConfig002::New
       
    42 	(CTestServer& aParent)
       
    43 	{
       
    44 	return new CTestStepUsbRomConfig002(aParent); 
       
    45 	}
       
    46 
       
    47 /**
       
    48 See USB_ROMCONFIG_002.script
       
    49 */
       
    50 TVerdict CTestStepUsbRomConfig002::doTestStepL()
       
    51 	{
       
    52 	INFO_PRINTF1(\
       
    53 		_L(">>CTestStepUsbRomConfig002::doTestStepL()"));
       
    54 	
       
    55 	const TInt expectedError = ( iUsbExcluded ? KErrNotFound : KErrNone );
       
    56 	const TDesC* expectedErrorDesPtr = ( iUsbExcluded ? &KErrNotFoundLit : &KErrNoneLit );
       
    57 	
       
    58 	TInt err = User::LoadLogicalDevice(KUsbLddName);
       
    59 	if ( (expectedError==KErrNone && err!=KErrNone && err!=KErrAlreadyExists) || 
       
    60 		(expectedError!=KErrNone && err!=expectedError) )
       
    61 		{
       
    62 		INFO_PRINTF5(\
       
    63 			_L("Failed: Expected %S(%d) and got %d when calling LoadLogicalDevice(%S)"),\
       
    64 			expectedErrorDesPtr, expectedError, err, &KUsbLddName);
       
    65 		SetTestStepResult(EFail);
       
    66 		}
       
    67 	
       
    68 	INFO_PRINTF1(\
       
    69 		_L("<<CTestStepUsbRomConfig002::doTestStepL()"));
       
    70 	CheckAndSetTestResult();
       
    71 	return TestStepResult(); 
       
    72 	}
       
    73 
       
    74 // EOF