author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 02 Sep 2010 21:54:16 +0300 | |
changeset 259 | 57b9594f5772 |
parent 0 | a41df078684a |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1 |
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 2 |
// All rights reserved. |
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// @file PBASE-T_USBDI-0480.cpp |
|
15 |
// @internalComponent |
|
16 |
// |
|
17 |
// |
|
18 |
||
19 |
#include "PBASE-T_USBDI-0480.h" |
|
20 |
#include "testpolicy.h" |
|
21 |
#include "modelleddevices.h" |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
22 |
#include "OstTraceDefinitions.h" |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
23 |
#ifdef OST_TRACE_COMPILER_IN_USE |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
24 |
#include "PBASE-T_USBDI-0480Traces.h" |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
25 |
#endif |
0 | 26 |
|
27 |
||
28 |
namespace NUnitTesting_USBDI |
|
29 |
{ |
|
30 |
||
31 |
_LIT8(KDataPayload,"DEADBEEF"); |
|
32 |
||
33 |
_LIT(KTestCaseId,"PBASE-T_USBDI-0480"); |
|
34 |
const TFunctorTestCase<CUT_PBASE_T_USBDI_0480,TBool> CUT_PBASE_T_USBDI_0480::iFunctor(KTestCaseId); |
|
35 |
||
36 |
CUT_PBASE_T_USBDI_0480* CUT_PBASE_T_USBDI_0480::NewL(TBool aHostRole) |
|
37 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
38 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_NEWL_ENTRY, aHostRole ); |
0 | 39 |
CUT_PBASE_T_USBDI_0480* self = new (ELeave) CUT_PBASE_T_USBDI_0480(aHostRole); |
40 |
CleanupStack::PushL(self); |
|
41 |
self->ConstructL(); |
|
42 |
CleanupStack::Pop(self); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
43 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_NEWL_EXIT, ( TUint )( self ) ); |
0 | 44 |
return self; |
45 |
} |
|
46 |
||
47 |
||
48 |
CUT_PBASE_T_USBDI_0480::CUT_PBASE_T_USBDI_0480(TBool aHostRole) |
|
49 |
: CBaseTestCase(KTestCaseId,aHostRole), |
|
50 |
iPtrTemp(NULL,0) |
|
51 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
52 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
53 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT, this ); |
0 | 54 |
} |
55 |
||
56 |
||
57 |
void CUT_PBASE_T_USBDI_0480::ConstructL() |
|
58 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_CONSTRUCTL_ENTRY, this ); |
0 | 60 |
iTestDevice = new RUsbDeviceA(this); |
61 |
BaseConstructL(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CONSTRUCTL_EXIT, this ); |
0 | 63 |
} |
64 |
||
65 |
||
66 |
CUT_PBASE_T_USBDI_0480::~CUT_PBASE_T_USBDI_0480() |
|
67 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
68 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY_DUP01, this ); |
0 | 69 |
|
70 |
Cancel(); |
|
71 |
||
72 |
// Close pipe before interface |
|
73 |
iUsbInterface1.Close(); |
|
74 |
iUsbInterface0.Close(); |
|
75 |
||
76 |
delete iTemp; |
|
77 |
delete iControlEp0; |
|
78 |
delete iActorFDF; |
|
79 |
if(!IsHost() && iTestDevice) |
|
80 |
{ |
|
81 |
iTestDevice->Close(); |
|
82 |
} |
|
83 |
delete iTestDevice; |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT_DUP01, this ); |
0 | 85 |
} |
86 |
||
87 |
void CUT_PBASE_T_USBDI_0480::ExecuteHostTestCaseL() |
|
88 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
89 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_ENTRY, this ); |
0 | 90 |
|
91 |
iActorFDF = CActorFDF::NewL(*this); |
|
92 |
iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0); |
|
93 |
iActorFDF->Monitor(); |
|
94 |
||
95 |
TimeoutIn(30); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
96 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_EXIT, this ); |
0 | 97 |
} |
98 |
||
99 |
void CUT_PBASE_T_USBDI_0480::HostDoCancel() |
|
100 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
101 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_ENTRY, this ); |
0 | 102 |
|
103 |
CancelTimeout(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
104 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_EXIT, this ); |
0 | 105 |
} |
106 |
||
107 |
||
108 |
void CUT_PBASE_T_USBDI_0480::ExecuteDeviceTestCaseL() |
|
109 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_ENTRY, this ); |
0 | 111 |
|
112 |
iTestDevice->OpenL(TestCaseId()); |
|
113 |
iTestDevice->SubscribeToReports(iStatus); |
|
114 |
SetActive(); |
|
115 |
iTestDevice->SoftwareConnect(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
116 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_EXIT, this ); |
0 | 117 |
} |
118 |
||
119 |
void CUT_PBASE_T_USBDI_0480::DeviceDoCancel() |
|
120 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
121 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_ENTRY, this ); |
0 | 122 |
|
123 |
// Cancel the device |
|
124 |
iTestDevice->CancelSubscriptionToReports(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
125 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_EXIT, this ); |
0 | 126 |
} |
127 |
||
128 |
||
129 |
void CUT_PBASE_T_USBDI_0480::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState, |
|
130 |
RUsbDevice::TDeviceState aNewState,TInt aCompletionCode) |
|
131 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
132 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_ENTRY, this ); |
0 | 133 |
|
134 |
Cancel(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
135 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_EXIT, this ); |
0 | 136 |
} |
137 |
||
138 |
||
139 |
void CUT_PBASE_T_USBDI_0480::DeviceInsertedL(TUint aDeviceHandle) |
|
140 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
141 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_ENTRY, this ); |
0 | 142 |
|
143 |
Cancel(); |
|
144 |
TInt err(KErrNone); |
|
145 |
||
146 |
// Validate that device is as expected |
|
147 |
CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle); |
|
148 |
if(testDevice.SerialNumber().Compare(TestCaseId()) != 0) |
|
149 |
{ |
|
150 |
// Incorrect device for this test case |
|
151 |
||
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
152 |
OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)", |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
153 |
KErrNotFound,testDevice.SerialNumber(),TestCaseId()); |
0 | 154 |
|
155 |
// Start the connection timeout again |
|
156 |
TimeoutIn(30); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
157 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT, this ); |
0 | 158 |
return; |
159 |
} |
|
160 |
||
161 |
TUint32 token0,token1; |
|
162 |
||
163 |
err = testDevice.Device().GetTokenForInterface(0,token0); |
|
164 |
if(err != KErrNone) |
|
165 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
166 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err); |
0 | 167 |
return TestFailed(err); |
168 |
} |
|
169 |
err = iUsbInterface0.Open(token0); // Default interface setting 0 |
|
170 |
if(err != KErrNone) |
|
171 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
172 |
OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0); |
0 | 173 |
return TestFailed(err); |
174 |
} |
|
175 |
||
176 |
err = testDevice.Device().GetTokenForInterface(1,token1); |
|
177 |
if(err != KErrNone) |
|
178 |
{ |
|
179 |
TBuf<64> msg; |
|
180 |
msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
181 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP03, msg); |
0 | 182 |
iCaseStep = EFailed; |
183 |
TTestCaseFailed request(err,msg); |
|
184 |
iControlEp0->SendRequest(request,this); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
185 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP01, this ); |
0 | 186 |
return; |
187 |
} |
|
188 |
err = iUsbInterface1.Open(token1); |
|
189 |
if(err != KErrNone) |
|
190 |
{ |
|
191 |
TBuf<256> msg; |
|
192 |
msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
193 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP04, msg); |
0 | 194 |
iCaseStep = EFailed; |
195 |
TTestCaseFailed request(err,msg); |
|
196 |
iControlEp0->SendRequest(request,this); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
197 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP02, this ); |
0 | 198 |
return; |
199 |
} |
|
200 |
||
201 |
// Get the endpoint descriptor |
|
202 |
TUsbEndpointDescriptor endpointDescriptor; |
|
203 |
||
204 |
err = iUsbInterface1.GetEndpointDescriptor(0,1,endpointDescriptor); |
|
205 |
if(err != KErrNone) |
|
206 |
{ |
|
207 |
TBuf<256> msg; |
|
208 |
msg.Format(_L("<Error %d> Descriptor for endpoint 0 cannot be obtained"),err); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
209 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP05, msg); |
0 | 210 |
iCaseStep = EFailed; |
211 |
TTestCaseFailed request(err,msg); |
|
212 |
iControlEp0->SendRequest(request,this); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
213 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP03, this ); |
0 | 214 |
return; |
215 |
} |
|
216 |
TUint16 maxPacketSize(endpointDescriptor.MaxPacketSize()); |
|
217 |
||
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
218 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP06, "Maximum packet size for endpoint 1 on interface 1 setting 0 is: %d",maxPacketSize); |
0 | 219 |
|
220 |
// Perform a device directed control transfer |
|
221 |
User::After(1000000); |
|
222 |
iCaseStep = EEmptyDeviceXfer; |
|
223 |
TEmptyDeviceRequest request; |
|
224 |
iControlEp0->SendRequest(request,this); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
225 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP04, this ); |
0 | 226 |
} |
227 |
||
228 |
||
229 |
void CUT_PBASE_T_USBDI_0480::Ep0TransferCompleteL(TInt aCompletionCode) |
|
230 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
231 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_ENTRY, this ); |
0 | 232 |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
233 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode); |
0 | 234 |
|
235 |
if(aCompletionCode != KErrNone) |
|
236 |
{ |
|
237 |
if(iCaseStep == EFailed) |
|
238 |
{ |
|
239 |
} |
|
240 |
else |
|
241 |
{ |
|
242 |
TBuf<256> msg; |
|
243 |
msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
244 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP01, msg); |
0 | 245 |
iCaseStep = EFailed; |
246 |
TTestCaseFailed request(aCompletionCode,msg); |
|
247 |
iControlEp0->SendRequest(request,this); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT, this ); |
0 | 249 |
return; |
250 |
} |
|
251 |
} |
|
252 |
||
253 |
switch(iCaseStep) |
|
254 |
{ |
|
255 |
// Test case passed |
|
256 |
case EPassed: |
|
257 |
TestPassed(); |
|
258 |
break; |
|
259 |
||
260 |
// Test case failed |
|
261 |
case EFailed: |
|
262 |
TestFailed(KErrCompletion); |
|
263 |
break; |
|
264 |
||
265 |
// Send an empty interface directed request |
|
266 |
case EEmptyDeviceXfer: |
|
267 |
{ |
|
268 |
iCaseStep = EEmptyInterfaceXfer; |
|
269 |
TEmptyInterfaceRequest request(1); // Direct at interface 1 |
|
270 |
iControlEp0->SendRequest(request,this); |
|
271 |
} |
|
272 |
break; |
|
273 |
||
274 |
// Send a test payload request to device directed |
|
275 |
case EEmptyInterfaceXfer: |
|
276 |
{ |
|
277 |
iCaseStep = EDataPutDeviceXfer; |
|
278 |
TDevicePutPayloadRequest request(KDataPayload); |
|
279 |
iControlEp0->SendRequest(request,this); |
|
280 |
} |
|
281 |
break; |
|
282 |
||
283 |
// Send a test payload request to interface directed |
|
284 |
case EDataPutDeviceXfer: |
|
285 |
{ |
|
286 |
iCaseStep = EDataPutInterfaceXfer; |
|
287 |
TInterfacePutPayloadRequest request(1,KDataPayload); // Direct at interface 1 |
|
288 |
iControlEp0->SendRequest(request,this); |
|
289 |
} |
|
290 |
break; |
|
291 |
||
292 |
// Test case passed |
|
293 |
case EDataPutInterfaceXfer: |
|
294 |
{ |
|
295 |
iCaseStep = EPassed; |
|
296 |
User::After(1000000); |
|
297 |
TTestCasePassed request; |
|
298 |
iControlEp0->SendRequest(request,this); |
|
299 |
} |
|
300 |
break; |
|
301 |
||
302 |
default: |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
303 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP02, "<Error> Unknown test step"); |
0 | 304 |
TestFailed(KErrUnknown); |
305 |
break; |
|
306 |
} |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
307 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this ); |
0 | 308 |
} |
309 |
||
310 |
||
311 |
void CUT_PBASE_T_USBDI_0480::DeviceRemovedL(TUint aDeviceHandle) |
|
312 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
313 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_ENTRY, this ); |
0 | 314 |
|
315 |
// The test device should not be removed until the test case has passed |
|
316 |
// so this test case has not completed, and state this event as an error |
|
317 |
TestFailed(KErrDisconnected); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
318 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_EXIT, this ); |
0 | 319 |
} |
320 |
||
321 |
||
322 |
void CUT_PBASE_T_USBDI_0480::BusErrorL(TInt aError) |
|
323 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
324 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_BUSERRORL_ENTRY, this ); |
0 | 325 |
|
326 |
// This test case handles no failiures on the bus |
|
327 |
TestFailed(KErrGeneral); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
328 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_BUSERRORL_EXIT, this ); |
0 | 329 |
} |
330 |
||
331 |
void CUT_PBASE_T_USBDI_0480::HostRunL() |
|
332 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
333 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_HOSTRUNL_ENTRY, this ); |
0 | 334 |
|
335 |
// Obtain the completion code |
|
336 |
TInt completionCode(iStatus.Int()); |
|
337 |
||
338 |
if(completionCode == KErrNone) |
|
339 |
{ |
|
340 |
// Action timeout |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
341 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_HOSTRUNL, "<Error> Action timeout"); |
0 | 342 |
TestFailed(KErrTimedOut); |
343 |
} |
|
344 |
else |
|
345 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
346 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode); |
0 | 347 |
TestFailed(completionCode); |
348 |
} |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
349 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_HOSTRUNL_EXIT, this ); |
0 | 350 |
} |
351 |
||
352 |
void CUT_PBASE_T_USBDI_0480::DeviceRunL() |
|
353 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
354 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_DEVICERUNL_ENTRY, this ); |
0 | 355 |
|
356 |
// Disconnect the device |
|
357 |
iTestDevice->SoftwareDisconnect(); |
|
358 |
||
359 |
// Complete the test case request |
|
360 |
TestPolicy().SignalTestComplete(iStatus.Int()); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
361 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICERUNL_EXIT, this ); |
0 | 362 |
} |
363 |
||
364 |
||
365 |
} |