sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// @file PBASE-T_USBDI-0476.cpp
|
sl@0
|
15 |
// @internalComponent
|
sl@0
|
16 |
//
|
sl@0
|
17 |
//
|
sl@0
|
18 |
|
sl@0
|
19 |
#include "PBASE-T_USBDI-0476.h"
|
sl@0
|
20 |
#include "descriptorsRawData.h"
|
sl@0
|
21 |
#include <d32usbdescriptors.h>
|
sl@0
|
22 |
#include "testpolicy.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
namespace NUnitTesting_USBDI
|
sl@0
|
25 |
{
|
sl@0
|
26 |
|
sl@0
|
27 |
_LIT(KTestCaseId,"PBASE-T_USBDI-0476");
|
sl@0
|
28 |
const TFunctorTestCase<CUT_PBASE_T_USBDI_0476,TBool> CUT_PBASE_T_USBDI_0476::iFunctor(KTestCaseId);
|
sl@0
|
29 |
|
sl@0
|
30 |
CUT_PBASE_T_USBDI_0476* CUT_PBASE_T_USBDI_0476::NewL(TBool aHostRole)
|
sl@0
|
31 |
{
|
sl@0
|
32 |
CUT_PBASE_T_USBDI_0476* self = new (ELeave) CUT_PBASE_T_USBDI_0476(aHostRole);
|
sl@0
|
33 |
CleanupStack::PushL(self);
|
sl@0
|
34 |
self->ConstructL();
|
sl@0
|
35 |
CleanupStack::Pop(self);
|
sl@0
|
36 |
return self;
|
sl@0
|
37 |
}
|
sl@0
|
38 |
|
sl@0
|
39 |
|
sl@0
|
40 |
CUT_PBASE_T_USBDI_0476::CUT_PBASE_T_USBDI_0476(TBool aHostRole)
|
sl@0
|
41 |
: CBaseTestCase(KTestCaseId,aHostRole,ETrue),
|
sl@0
|
42 |
iCaseStep(EInProgress)
|
sl@0
|
43 |
{
|
sl@0
|
44 |
}
|
sl@0
|
45 |
|
sl@0
|
46 |
|
sl@0
|
47 |
void CUT_PBASE_T_USBDI_0476::ConstructL()
|
sl@0
|
48 |
{
|
sl@0
|
49 |
LOG_FUNC
|
sl@0
|
50 |
}
|
sl@0
|
51 |
|
sl@0
|
52 |
|
sl@0
|
53 |
CUT_PBASE_T_USBDI_0476::~CUT_PBASE_T_USBDI_0476()
|
sl@0
|
54 |
{
|
sl@0
|
55 |
LOG_FUNC
|
sl@0
|
56 |
|
sl@0
|
57 |
Cancel();
|
sl@0
|
58 |
}
|
sl@0
|
59 |
|
sl@0
|
60 |
|
sl@0
|
61 |
|
sl@0
|
62 |
void CUT_PBASE_T_USBDI_0476::ExecuteHostTestCaseL()
|
sl@0
|
63 |
{
|
sl@0
|
64 |
LOG_FUNC
|
sl@0
|
65 |
TInt err(KErrNone);
|
sl@0
|
66 |
|
sl@0
|
67 |
TUsbGenericDescriptor* parsed = NULL;
|
sl@0
|
68 |
TUsbDeviceDescriptor* devDesc = 0;
|
sl@0
|
69 |
|
sl@0
|
70 |
// Parse Device Descriptor
|
sl@0
|
71 |
err = UsbDescriptorParser::Parse(KDeviceDescriptorData, parsed);
|
sl@0
|
72 |
CHECK(err == KErrNone) // KErrNone
|
sl@0
|
73 |
devDesc = TUsbDeviceDescriptor::Cast(parsed);
|
sl@0
|
74 |
CHECK(devDesc != 0)
|
sl@0
|
75 |
CHECK(err == KErrNone) // KErrNone
|
sl@0
|
76 |
|
sl@0
|
77 |
// Parse Configuration Descriptor ---------- Case 1
|
sl@0
|
78 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase1, 1) == KErrNone);
|
sl@0
|
79 |
|
sl@0
|
80 |
// Parse Configuration Descriptor ---------- Case 2
|
sl@0
|
81 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase2, 2) == KErrNone);
|
sl@0
|
82 |
|
sl@0
|
83 |
// Parse Configuration Descriptor ---------- Case 3
|
sl@0
|
84 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase3, 3) == KErrNone);
|
sl@0
|
85 |
|
sl@0
|
86 |
// Parse Configuration Descriptor ---------- Case 4
|
sl@0
|
87 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KBtDongleDescriptorTestCase4 , 4) == KErrGeneral);
|
sl@0
|
88 |
|
sl@0
|
89 |
// Parse Configuration Descriptor ---------- Case 5
|
sl@0
|
90 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase5, 5) == KErrNone);
|
sl@0
|
91 |
|
sl@0
|
92 |
// Parse Configuration Descriptor ---------- Case 6
|
sl@0
|
93 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase6, 6) == KErrNone);
|
sl@0
|
94 |
|
sl@0
|
95 |
// Parse Configuration Descriptor ---------- Case 7
|
sl@0
|
96 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase7, 7) == KErrNone);
|
sl@0
|
97 |
|
sl@0
|
98 |
// Parse Configuration Descriptor ---------- Case 8
|
sl@0
|
99 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase8, 8) == KErrNone);
|
sl@0
|
100 |
|
sl@0
|
101 |
// Parse Configuration Descriptor ---------- Case 9
|
sl@0
|
102 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase9, 9) == KErrNone);
|
sl@0
|
103 |
|
sl@0
|
104 |
// Parse Configuration Descriptor ---------- Case 10
|
sl@0
|
105 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase10, 10) == KErrNone);
|
sl@0
|
106 |
|
sl@0
|
107 |
// Parse Configuration Descriptor ---------- Case 11
|
sl@0
|
108 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase11, 11) == KErrNone);
|
sl@0
|
109 |
|
sl@0
|
110 |
// Parse Configuration Descriptor ---------- Case 12
|
sl@0
|
111 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase12, 12) == KErrNone);
|
sl@0
|
112 |
|
sl@0
|
113 |
// Parse Configuration Descriptor ---------- Case 13
|
sl@0
|
114 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase13, 13) == KErrNone);
|
sl@0
|
115 |
|
sl@0
|
116 |
// Parse Configuration Descriptor ---------- Case 14
|
sl@0
|
117 |
CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase14, 14) == KErrNone);
|
sl@0
|
118 |
|
sl@0
|
119 |
TestPassed();
|
sl@0
|
120 |
}
|
sl@0
|
121 |
|
sl@0
|
122 |
void CUT_PBASE_T_USBDI_0476::HostDoCancel()
|
sl@0
|
123 |
{
|
sl@0
|
124 |
LOG_FUNC
|
sl@0
|
125 |
}
|
sl@0
|
126 |
|
sl@0
|
127 |
|
sl@0
|
128 |
void CUT_PBASE_T_USBDI_0476::ExecuteDeviceTestCaseL()
|
sl@0
|
129 |
{
|
sl@0
|
130 |
}
|
sl@0
|
131 |
|
sl@0
|
132 |
void CUT_PBASE_T_USBDI_0476::DeviceDoCancel()
|
sl@0
|
133 |
{
|
sl@0
|
134 |
LOG_FUNC
|
sl@0
|
135 |
}
|
sl@0
|
136 |
|
sl@0
|
137 |
|
sl@0
|
138 |
void CUT_PBASE_T_USBDI_0476::HostRunL()
|
sl@0
|
139 |
{
|
sl@0
|
140 |
LOG_FUNC
|
sl@0
|
141 |
}
|
sl@0
|
142 |
|
sl@0
|
143 |
|
sl@0
|
144 |
void CUT_PBASE_T_USBDI_0476::DeviceRunL()
|
sl@0
|
145 |
{
|
sl@0
|
146 |
LOG_FUNC
|
sl@0
|
147 |
}
|
sl@0
|
148 |
|
sl@0
|
149 |
|
sl@0
|
150 |
}
|