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-0476.cpp |
|
15 |
// @internalComponent |
|
16 |
// |
|
17 |
// |
|
18 |
||
19 |
#include "PBASE-T_USBDI-0476.h" |
|
20 |
#include "descriptorsRawData.h" |
|
21 |
#include <d32usbdescriptors.h> |
|
22 |
#include "testpolicy.h" |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
23 |
#include "OstTraceDefinitions.h" |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
24 |
#ifdef OST_TRACE_COMPILER_IN_USE |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
25 |
#include "PBASE-T_USBDI-0476Traces.h" |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
#endif |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
27 |
|
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
28 |
|
0 | 29 |
|
30 |
namespace NUnitTesting_USBDI |
|
31 |
{ |
|
32 |
||
33 |
_LIT(KTestCaseId,"PBASE-T_USBDI-0476"); |
|
34 |
const TFunctorTestCase<CUT_PBASE_T_USBDI_0476,TBool> CUT_PBASE_T_USBDI_0476::iFunctor(KTestCaseId); |
|
35 |
||
36 |
CUT_PBASE_T_USBDI_0476* CUT_PBASE_T_USBDI_0476::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_0476_NEWL_ENTRY, aHostRole ); |
0 | 39 |
CUT_PBASE_T_USBDI_0476* self = new (ELeave) CUT_PBASE_T_USBDI_0476(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_0476_NEWL_EXIT, ( TUint )( self ) ); |
0 | 44 |
return self; |
45 |
} |
|
46 |
||
47 |
||
48 |
CUT_PBASE_T_USBDI_0476::CUT_PBASE_T_USBDI_0476(TBool aHostRole) |
|
49 |
: CBaseTestCase(KTestCaseId,aHostRole,ETrue), |
|
50 |
iCaseStep(EInProgress) |
|
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_0476_CUT_PBASE_T_USBDI_0476_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_0476_CUT_PBASE_T_USBDI_0476_EXIT, this ); |
0 | 54 |
} |
55 |
||
56 |
||
57 |
void CUT_PBASE_T_USBDI_0476::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_0476_CONSTRUCTL_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CONSTRUCTL_EXIT, this ); |
0 | 61 |
} |
62 |
||
63 |
||
64 |
CUT_PBASE_T_USBDI_0476::~CUT_PBASE_T_USBDI_0476() |
|
65 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
66 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY_DUP01, this ); |
0 | 67 |
|
68 |
Cancel(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
69 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT_DUP01, this ); |
0 | 70 |
} |
71 |
||
72 |
||
73 |
||
74 |
void CUT_PBASE_T_USBDI_0476::ExecuteHostTestCaseL() |
|
75 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
76 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_ENTRY, this ); |
0 | 77 |
TInt err(KErrNone); |
78 |
||
79 |
TUsbGenericDescriptor* parsed = NULL; |
|
80 |
TUsbDeviceDescriptor* devDesc = 0; |
|
81 |
||
82 |
// Parse Device Descriptor |
|
83 |
err = UsbDescriptorParser::Parse(KDeviceDescriptorData, parsed); |
|
84 |
CHECK(err == KErrNone) // KErrNone |
|
85 |
devDesc = TUsbDeviceDescriptor::Cast(parsed); |
|
86 |
CHECK(devDesc != 0) |
|
87 |
CHECK(err == KErrNone) // KErrNone |
|
88 |
||
89 |
// Parse Configuration Descriptor ---------- Case 1 |
|
90 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase1, 1) == KErrNone); |
|
91 |
||
92 |
// Parse Configuration Descriptor ---------- Case 2 |
|
93 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase2, 2) == KErrNone); |
|
94 |
||
95 |
// Parse Configuration Descriptor ---------- Case 3 |
|
96 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase3, 3) == KErrNone); |
|
97 |
||
98 |
// Parse Configuration Descriptor ---------- Case 4 |
|
99 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KBtDongleDescriptorTestCase4 , 4) == KErrGeneral); |
|
100 |
||
101 |
// Parse Configuration Descriptor ---------- Case 5 |
|
102 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase5, 5) == KErrNone); |
|
103 |
||
104 |
// Parse Configuration Descriptor ---------- Case 6 |
|
105 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase6, 6) == KErrNone); |
|
106 |
||
107 |
// Parse Configuration Descriptor ---------- Case 7 |
|
108 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase7, 7) == KErrNone); |
|
109 |
||
110 |
// Parse Configuration Descriptor ---------- Case 8 |
|
111 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase8, 8) == KErrNone); |
|
112 |
||
113 |
// Parse Configuration Descriptor ---------- Case 9 |
|
114 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase9, 9) == KErrNone); |
|
115 |
||
116 |
// Parse Configuration Descriptor ---------- Case 10 |
|
117 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase10, 10) == KErrNone); |
|
118 |
||
119 |
// Parse Configuration Descriptor ---------- Case 11 |
|
120 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase11, 11) == KErrNone); |
|
121 |
||
122 |
// Parse Configuration Descriptor ---------- Case 12 |
|
123 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase12, 12) == KErrNone); |
|
124 |
||
125 |
// Parse Configuration Descriptor ---------- Case 13 |
|
126 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase13, 13) == KErrNone); |
|
127 |
||
128 |
// Parse Configuration Descriptor ---------- Case 14 |
|
129 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase14, 14) == KErrNone); |
|
130 |
||
131 |
TestPassed(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
132 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_EXIT, this ); |
0 | 133 |
} |
134 |
||
135 |
void CUT_PBASE_T_USBDI_0476::HostDoCancel() |
|
136 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
137 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
138 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_EXIT, this ); |
0 | 139 |
} |
140 |
||
141 |
||
142 |
void CUT_PBASE_T_USBDI_0476::ExecuteDeviceTestCaseL() |
|
143 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
144 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
145 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_EXIT, this ); |
0 | 146 |
} |
147 |
||
148 |
void CUT_PBASE_T_USBDI_0476::DeviceDoCancel() |
|
149 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
150 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
151 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_EXIT, this ); |
0 | 152 |
} |
153 |
||
154 |
||
155 |
void CUT_PBASE_T_USBDI_0476::HostRunL() |
|
156 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
157 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
158 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_EXIT, this ); |
0 | 159 |
} |
160 |
||
161 |
||
162 |
void CUT_PBASE_T_USBDI_0476::DeviceRunL() |
|
163 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
164 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_EXIT, this ); |
0 | 166 |
} |
167 |
||
168 |
||
169 |
} |