|
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 "cteststepusbromconfig001.h" |
|
19 #include <usbman.h> |
|
20 |
|
21 CTestStepUsbRomConfig001::~CTestStepUsbRomConfig001() |
|
22 { |
|
23 } |
|
24 |
|
25 CTestStepUsbRomConfig001::CTestStepUsbRomConfig001(CTestServer& aParent) |
|
26 : CTestStepUsbRomConfigBase(aParent) |
|
27 { |
|
28 SetTestStepName(KTestName001); |
|
29 } |
|
30 |
|
31 /** |
|
32 Static Constructor |
|
33 Note the lack of ELeave. This means that having insufficient memory will return NULL; |
|
34 */ |
|
35 CTestStepUsbRomConfig001* CTestStepUsbRomConfig001::New(CTestServer& aParent) |
|
36 { |
|
37 return new CTestStepUsbRomConfig001(aParent); |
|
38 } |
|
39 |
|
40 /** |
|
41 See USB_ROMCONFIG_001.script |
|
42 */ |
|
43 TVerdict CTestStepUsbRomConfig001::doTestStepL() |
|
44 { |
|
45 INFO_PRINTF1(\ |
|
46 _L(">>CTestStepUsbRomConfig001::doTestStepL()")); |
|
47 |
|
48 const TInt expectedError = ( iUsbExcluded ? KErrNotFound : KErrNone ); |
|
49 const TDesC* expectedErrorDesPtr = ( iUsbExcluded ? &KErrNotFoundLit : &KErrNoneLit ); |
|
50 RUsb usb; |
|
51 TInt err = usb.Connect(); |
|
52 if ( err!=expectedError ) |
|
53 { |
|
54 INFO_PRINTF4(\ |
|
55 _L("Failed: Expected %S(%d) and got %d when calling RUsb::Connect()"),\ |
|
56 expectedErrorDesPtr, expectedError, err); |
|
57 SetTestStepResult(EFail); |
|
58 } |
|
59 if ( usb.Handle() ) |
|
60 { |
|
61 usb.Close(); |
|
62 } |
|
63 |
|
64 INFO_PRINTF1(\ |
|
65 _L("<<CTestStepUsbRomConfig001::doTestStepL()")); |
|
66 CheckAndSetTestResult(); |
|
67 return TestStepResult(); |
|
68 } |
|
69 |
|
70 // EOF |