|
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0496_H |
|
2 #define __TEST_CASE_PBASE_T_USBDI_0496_H |
|
3 |
|
4 /* |
|
5 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
6 * All rights reserved. |
|
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". |
|
11 * |
|
12 * Initial Contributors: |
|
13 * Nokia Corporation - initial contribution. |
|
14 * |
|
15 * Contributors: |
|
16 * |
|
17 * Description: |
|
18 * @file PBASE-T_USBDI-0496.h |
|
19 * @internalComponent |
|
20 * |
|
21 * |
|
22 */ |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 #include "BaseBulkTestCase.h" |
|
28 |
|
29 |
|
30 namespace NUnitTesting_USBDI |
|
31 { |
|
32 const TUint8 KNumInitialRequests = 4; |
|
33 /** |
|
34 |
|
35 |
|
36 @SYMTestCaseID PBASE-T_USBDI-0496 |
|
37 @SYMTestCaseDesc Test use of two queued bulk IN transfers to retrieve large amount of data |
|
38 @SYMFssID |
|
39 @SYMPREQ 1305 |
|
40 @SYMREQ 7055 [USBD : Bulk transfers] |
|
41 @SYMTestType UT |
|
42 @SYMTestPriority 1 |
|
43 @SYMTestActions 1. Open interfaces to connected device |
|
44 2. Request two bulk IN transfers |
|
45 3. When each completes request another one until specified number of bytes read |
|
46 4. Validate data as it is read |
|
47 @SYMTestExpectedResults Round trip transfer data is not corrupt |
|
48 @SYMTestStatus Draft |
|
49 |
|
50 |
|
51 */ |
|
52 |
|
53 class CUT_PBASE_T_USBDI_0496 : public CBaseBulkTestCase, |
|
54 public MTransferObserver, |
|
55 public MCommandObserver |
|
56 |
|
57 { |
|
58 public: |
|
59 static CUT_PBASE_T_USBDI_0496* NewL(TBool aHostRole); |
|
60 ~CUT_PBASE_T_USBDI_0496(); |
|
61 |
|
62 public: // From MUsbBusObserver |
|
63 void DeviceInsertedL(TUint aDeviceHandle); |
|
64 |
|
65 public: // From MCommandObserver |
|
66 void Ep0TransferCompleteL(TInt aCompletionCode); |
|
67 |
|
68 public: // From MTransferObserver |
|
69 void TransferCompleteL(TInt aTransferId,TInt aCompletionCode); |
|
70 |
|
71 private: |
|
72 CUT_PBASE_T_USBDI_0496(TBool aHostRole); |
|
73 void ConstructL(); |
|
74 void KillTransfers(); |
|
75 TUint8 Index(TUint8 aTransferId); |
|
76 TInt ValidatePreviousAndPerformNextTransfers(TInt aTransferId); |
|
77 |
|
78 private: |
|
79 |
|
80 enum TCaseStep |
|
81 { |
|
82 EInProgress, |
|
83 EPassed, |
|
84 EFailed, |
|
85 ERequestRepeatedWrite, |
|
86 ETransfer |
|
87 }; |
|
88 |
|
89 TUint iNumBytesExpected[KMaxNumInTransfers]; |
|
90 TUint iValidationStringStartPointTransfer[KMaxNumInTransfers]; |
|
91 TInt iExpectedNextTransferNumber; |
|
92 TUint iNumBytesRequestedSoFar; |
|
93 TBool iIsValid; |
|
94 TBool iIsTransferError; |
|
95 TCaseStep iCaseStep; |
|
96 TInt iCountWaitForRequestShortfall; |
|
97 |
|
98 private: |
|
99 /** |
|
100 The functor for this test case |
|
101 */ |
|
102 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0496,TBool> iFunctor; |
|
103 }; |
|
104 |
|
105 } //end namespace |
|
106 |
|
107 #endif |