1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
18 |
18 |
19 #include "PBASE-T_USBDI-0476.h" |
19 #include "PBASE-T_USBDI-0476.h" |
20 #include "descriptorsRawData.h" |
20 #include "descriptorsRawData.h" |
21 #include <d32usbdescriptors.h> |
21 #include <d32usbdescriptors.h> |
22 #include "testpolicy.h" |
22 #include "testpolicy.h" |
|
23 #include "OstTraceDefinitions.h" |
|
24 #ifdef OST_TRACE_COMPILER_IN_USE |
|
25 #include "PBASE-T_USBDI-0476Traces.h" |
|
26 #endif |
|
27 |
|
28 |
23 |
29 |
24 namespace NUnitTesting_USBDI |
30 namespace NUnitTesting_USBDI |
25 { |
31 { |
26 |
32 |
27 _LIT(KTestCaseId,"PBASE-T_USBDI-0476"); |
33 _LIT(KTestCaseId,"PBASE-T_USBDI-0476"); |
28 const TFunctorTestCase<CUT_PBASE_T_USBDI_0476,TBool> CUT_PBASE_T_USBDI_0476::iFunctor(KTestCaseId); |
34 const TFunctorTestCase<CUT_PBASE_T_USBDI_0476,TBool> CUT_PBASE_T_USBDI_0476::iFunctor(KTestCaseId); |
29 |
35 |
30 CUT_PBASE_T_USBDI_0476* CUT_PBASE_T_USBDI_0476::NewL(TBool aHostRole) |
36 CUT_PBASE_T_USBDI_0476* CUT_PBASE_T_USBDI_0476::NewL(TBool aHostRole) |
31 { |
37 { |
|
38 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_NEWL_ENTRY, aHostRole ); |
32 CUT_PBASE_T_USBDI_0476* self = new (ELeave) CUT_PBASE_T_USBDI_0476(aHostRole); |
39 CUT_PBASE_T_USBDI_0476* self = new (ELeave) CUT_PBASE_T_USBDI_0476(aHostRole); |
33 CleanupStack::PushL(self); |
40 CleanupStack::PushL(self); |
34 self->ConstructL(); |
41 self->ConstructL(); |
35 CleanupStack::Pop(self); |
42 CleanupStack::Pop(self); |
|
43 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_NEWL_EXIT, ( TUint )( self ) ); |
36 return self; |
44 return self; |
37 } |
45 } |
38 |
46 |
39 |
47 |
40 CUT_PBASE_T_USBDI_0476::CUT_PBASE_T_USBDI_0476(TBool aHostRole) |
48 CUT_PBASE_T_USBDI_0476::CUT_PBASE_T_USBDI_0476(TBool aHostRole) |
41 : CBaseTestCase(KTestCaseId,aHostRole,ETrue), |
49 : CBaseTestCase(KTestCaseId,aHostRole,ETrue), |
42 iCaseStep(EInProgress) |
50 iCaseStep(EInProgress) |
43 { |
51 { |
|
52 OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY, this ); |
|
53 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT, this ); |
44 } |
54 } |
45 |
55 |
46 |
56 |
47 void CUT_PBASE_T_USBDI_0476::ConstructL() |
57 void CUT_PBASE_T_USBDI_0476::ConstructL() |
48 { |
58 { |
49 LOG_FUNC |
59 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_CONSTRUCTL_ENTRY, this ); |
|
60 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CONSTRUCTL_EXIT, this ); |
50 } |
61 } |
51 |
62 |
52 |
63 |
53 CUT_PBASE_T_USBDI_0476::~CUT_PBASE_T_USBDI_0476() |
64 CUT_PBASE_T_USBDI_0476::~CUT_PBASE_T_USBDI_0476() |
54 { |
65 { |
55 LOG_FUNC |
66 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY_DUP01, this ); |
56 |
67 |
57 Cancel(); |
68 Cancel(); |
|
69 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT_DUP01, this ); |
58 } |
70 } |
59 |
71 |
60 |
72 |
61 |
73 |
62 void CUT_PBASE_T_USBDI_0476::ExecuteHostTestCaseL() |
74 void CUT_PBASE_T_USBDI_0476::ExecuteHostTestCaseL() |
63 { |
75 { |
64 LOG_FUNC |
76 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_ENTRY, this ); |
65 TInt err(KErrNone); |
77 TInt err(KErrNone); |
66 |
78 |
67 TUsbGenericDescriptor* parsed = NULL; |
79 TUsbGenericDescriptor* parsed = NULL; |
68 TUsbDeviceDescriptor* devDesc = 0; |
80 TUsbDeviceDescriptor* devDesc = 0; |
69 |
81 |
115 |
127 |
116 // Parse Configuration Descriptor ---------- Case 14 |
128 // Parse Configuration Descriptor ---------- Case 14 |
117 CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase14, 14) == KErrNone); |
129 CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase14, 14) == KErrNone); |
118 |
130 |
119 TestPassed(); |
131 TestPassed(); |
|
132 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_EXIT, this ); |
120 } |
133 } |
121 |
134 |
122 void CUT_PBASE_T_USBDI_0476::HostDoCancel() |
135 void CUT_PBASE_T_USBDI_0476::HostDoCancel() |
123 { |
136 { |
124 LOG_FUNC |
137 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_ENTRY, this ); |
|
138 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_EXIT, this ); |
125 } |
139 } |
126 |
140 |
127 |
141 |
128 void CUT_PBASE_T_USBDI_0476::ExecuteDeviceTestCaseL() |
142 void CUT_PBASE_T_USBDI_0476::ExecuteDeviceTestCaseL() |
129 { |
143 { |
|
144 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_ENTRY, this ); |
|
145 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_EXIT, this ); |
130 } |
146 } |
131 |
147 |
132 void CUT_PBASE_T_USBDI_0476::DeviceDoCancel() |
148 void CUT_PBASE_T_USBDI_0476::DeviceDoCancel() |
133 { |
149 { |
134 LOG_FUNC |
150 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_ENTRY, this ); |
|
151 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_EXIT, this ); |
135 } |
152 } |
136 |
153 |
137 |
154 |
138 void CUT_PBASE_T_USBDI_0476::HostRunL() |
155 void CUT_PBASE_T_USBDI_0476::HostRunL() |
139 { |
156 { |
140 LOG_FUNC |
157 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_ENTRY, this ); |
|
158 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_EXIT, this ); |
141 } |
159 } |
142 |
160 |
143 |
161 |
144 void CUT_PBASE_T_USBDI_0476::DeviceRunL() |
162 void CUT_PBASE_T_USBDI_0476::DeviceRunL() |
145 { |
163 { |
146 LOG_FUNC |
164 OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_ENTRY, this ); |
|
165 OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_EXIT, this ); |
147 } |
166 } |
148 |
167 |
149 |
168 |
150 } |
169 } |