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