First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0477_H
2 #define __TEST_CASE_PBASE_T_USBDI_0477_H
5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
7 * This component and the accompanying materials are made available
8 * under the terms of the License "Eclipse Public License v1.0"
9 * which accompanies this distribution, and is available
10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
12 * Initial Contributors:
13 * Nokia Corporation - initial contribution.
18 * @file PBASE-T_USBDI-0477.h
27 #include "BaseTestCase.h"
28 #include "TestCaseFactory.h"
29 #include "modelleddevices.h"
31 #include <d32usbdi_hubdriver.h>
34 #include "testdebug.h"
35 #include "controltransferrequests.h"
37 namespace NUnitTesting_USBDI
43 @SYMTestCaseID PBASE-T_USBDI-0477
44 @SYMTestCaseDesc Selection of two alternate interface settings where the second selection
45 fails and the interface rolls back
48 @SYMREQ 7046 [USBD : Changing alternate interface setting]
49 7047 [USBD : Roll-back of alternate interface setting]
50 7048 [USBD : Default Alternate Interface setting]
51 7049 [USBD : Establishment of pipes]
52 7050 [USBD : Closing of pipes]
55 @SYMTestActions 1. Open interfaces on connected device
56 2. Open and close a bulk pipe on default setting 0
57 3. Select alternate interface setting 1 and establish a pipe then close it
58 4. If alternate interface selection fails, establish that the pipe previously
59 opened in step 2 can be opened again.
60 @SYMTestExpectedResults Pipes can be established in either interface setting
61 @SYMTestStatus Implemented
65 class CUT_PBASE_T_USBDI_0477 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
68 static CUT_PBASE_T_USBDI_0477* NewL(TBool aHostRole);
69 ~CUT_PBASE_T_USBDI_0477();
71 public: // From MUsbBusObserver
72 void DeviceInsertedL(TUint aDeviceHandle);
73 void DeviceRemovedL(TUint aDeviceHandle);
74 void BusErrorL(TInt aError);
75 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
76 TInt aCompletionCode);
78 public: // From MCommandObserver
79 void Ep0TransferCompleteL(TInt aCompletionCode);
82 CUT_PBASE_T_USBDI_0477(TBool aHostRole);
84 void ExecuteHostTestCaseL();
85 void ExecuteDeviceTestCaseL();
87 void DeviceDoCancel();
90 TBool CheckFirstInterfaceDescriptorDeviceA(TUsbInterfaceDescriptor& aIfDescriptor);
100 CActorFDF* iActorFDF;
101 CEp0Transfer* iClientAction;
102 RUsbInterface iUsbInterface0;
103 RUsbInterface iUsbInterface1;
107 RUsbDeviceA* iTestDevice;
111 The functor for this test case for the factory
113 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0477,TBool> iFunctor;