Update contrib.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0488_H
2 #define __TEST_CASE_PBASE_T_USBDI_0488_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-0488.h
26 #include "basetestcase.h"
27 #include "testcasefactory.h"
28 #include "modelleddevices.h"
33 #include "hosttransfers.h"
34 #include "controltransferrequests.h"
36 namespace NUnitTesting_USBDI
42 @SYMTestCaseID PBASE-T_USBDI-0488
43 @SYMTestCaseDesc Resource cleanup following panic in client.
46 @SYMREQ 7065 - [ USBD : Closing interface handles: Unclean shutdown (ie. kernel closes handle]
49 @SYMTestActions 1. Enumerate
51 3. Select alternate setting 1
52 4. Open pipe for endpoint on interface 1
53 5. Select alternate setting 0
54 6. Validate panic cause (Interface setting changed while pipe is opened on other alternate setting)
56 8. Check heap mark is equal to original mark
57 @SYMTestExpectedResults Resources successfully cleaned up following a specific panic.
58 @SYMTestStatus Implemented
62 class CUT_PBASE_T_USBDI_0488 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
65 static CUT_PBASE_T_USBDI_0488* NewL(TBool aHostRole);
66 ~CUT_PBASE_T_USBDI_0488();
68 public: // From MUsbBusObserver
69 void DeviceInsertedL(TUint aDeviceHandle);
70 void DeviceRemovedL(TUint aDeviceHandle);
71 void BusErrorL(TInt aError);
72 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
73 TInt aCompletionCode);
76 public: // From MCommandObserver
77 void Ep0TransferCompleteL(TInt aCompletionCode);
80 CUT_PBASE_T_USBDI_0488(TBool aHostRole);
82 void ExecuteHostTestCaseL();
83 void ExecuteDeviceTestCaseL();
85 void DeviceDoCancel();
99 RUsbInterface iUsbInterface1;
104 CEp0Transfer* iControlEp0;
105 CActorFDF* iActorFDF;
106 RUsbInterface iUsbInterface0;
108 // The current test case step
111 // The test device for this test case
112 RUsbDeviceA* iTestDevice;
118 The functor for this test case for the factory
120 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0488,TBool> iFunctor;
123 static method, function of spawned thread.
124 @param[in] aTestCase pointer
126 static TInt TestSelectAlternateInterfaceThenPanic(TAny* aTest);