1 /*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <iostream>
17 #include <vector>
18
19 #include "hdf_log.h"
20 #include "usbd_request_test.h"
21 #include "v1_0/iusb_interface.h"
22 #include "v1_0/usb_types.h"
23
24 const int SLEEP_TIME = 3;
25 const uint8_t BUS_NUM_INVALID = 255;
26 const uint8_t DEV_ADDR_INVALID = 255;
27 const uint8_t INTERFACEID_OK = 1;
28 const uint8_t INTERFACEID_INVALID = 255;
29 const uint8_t INVALID_NUM = 222;
30 const uint8_t STRING_ID_INVALID = 233;
31 const uint32_t MAX_BUFFER_LENGTH = 255;
32 const uint8_t CONFIG_ID_INVALID = 222;
33 const uint8_t INDEX_1 = 1;
34
35 using namespace testing::ext;
36 using namespace OHOS;
37 using namespace OHOS::USB;
38 using namespace std;
39 using namespace OHOS::HDI::Usb::V1_0;
40
41 UsbDev UsbdRequestTestAdditional::dev_ = {0, 0};
42 sptr<UsbSubscriberTest> UsbdRequestTestAdditional::subscriber_ = nullptr;
43
44 namespace {
45 sptr<IUsbInterface> g_usbInterface = nullptr;
46
SwitchErrCode(int32_t ret)47 int32_t SwitchErrCode(int32_t ret)
48 {
49 return ret == HDF_ERR_NOT_SUPPORT ? HDF_SUCCESS : ret;
50 }
51
SetUpTestCase(void)52 void UsbdRequestTestAdditional::SetUpTestCase(void)
53 {
54 g_usbInterface = IUsbInterface::Get();
55 if (g_usbInterface == nullptr) {
56 HDF_LOGE("%{public}s:IUsbInterface::Get() failed.", __func__);
57 exit(0);
58 }
59 auto ret = g_usbInterface->SetPortRole(1, 1, 1);
60 sleep(SLEEP_TIME);
61 HDF_LOGI("UsbdRequestTestAdditional::[Device] %{public}d SetPortRole=%{public}d", __LINE__, ret);
62 ret = SwitchErrCode(ret);
63 ASSERT_EQ(0, ret);
64 if (ret != 0) {
65 exit(0);
66 }
67
68 subscriber_ = new UsbSubscriberTest();
69 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) {
70 HDF_LOGE("%{public}s: bind usbd subscriber_ failed", __func__);
71 exit(0);
72 }
73
74 std::cout << "please connect device, press enter to continue" << std::endl;
75 int c;
76 while ((c = getchar()) != '\n' && c != EOF) {
77 }
78 dev_ = {subscriber_->busNum_, subscriber_->devAddr_};
79
80 ret = g_usbInterface->OpenDevice(dev_);
81 HDF_LOGI("UsbdRequestTestAdditional:: %{public}d OpenDevice=%{public}d", __LINE__, ret);
82 ASSERT_EQ(0, ret);
83 }
84
TearDownTestCase(void)85 void UsbdRequestTestAdditional::TearDownTestCase(void)
86 {
87 g_usbInterface->UnbindUsbdSubscriber(subscriber_);
88 dev_ = {subscriber_->busNum_, subscriber_->devAddr_};
89 auto ret = g_usbInterface->CloseDevice(dev_);
90 HDF_LOGI("UsbdRequestTestAdditional:: %{public}d Close=%{public}d", __LINE__, ret);
91 ASSERT_EQ(0, ret);
92 }
93
SetUp(void)94 void UsbdRequestTestAdditional::SetUp(void) {}
95
TearDown(void)96 void UsbdRequestTestAdditional::TearDown(void) {}
97
98 /**
99 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_0900
100 * @tc.name: testHdiUsbRequestTestClaimInterface001
101 * @tc.desc: Claims a USB interface. ({255, 0}, 1, 0).
102 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface001, TestSize.Level2)103 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface001, TestSize.Level2)
104 {
105 uint8_t interfaceId = INTERFACEID_OK;
106 struct UsbDev dev = dev_;
107 dev.busNum = BUS_NUM_INVALID;
108 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
109 ASSERT_NE(ret, 0);
110 }
111
112 /**
113 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1000
114 * @tc.name: testHdiUsbRequestTestClaimInterface002
115 * @tc.desc: Claims a USB interface. ({255, 0}, 1, 255).
116 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface002, TestSize.Level2)117 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface002, TestSize.Level2)
118 {
119 uint8_t interfaceId = INTERFACEID_OK;
120 struct UsbDev dev = dev_;
121 dev.busNum = BUS_NUM_INVALID;
122 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
123 ASSERT_NE(ret, 0);
124 }
125
126 /**
127 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1100
128 * @tc.name: testHdiUsbRequestTestClaimInterface003
129 * @tc.desc: Claims a USB interface. ({255, 0}, 0, 0).
130 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface003, TestSize.Level2)131 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface003, TestSize.Level2)
132 {
133 uint8_t interfaceId = 0;
134 struct UsbDev dev = dev_;
135 dev.busNum = BUS_NUM_INVALID;
136 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
137 ASSERT_NE(ret, 0);
138 }
139
140 /**
141 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1200
142 * @tc.name: testHdiUsbRequestTestClaimInterface004
143 * @tc.desc: Claims a USB interface. ({255, 0}, 0, 1).
144 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface004, TestSize.Level2)145 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface004, TestSize.Level2)
146 {
147 uint8_t interfaceId = 0;
148 struct UsbDev dev = dev_;
149 dev.busNum = BUS_NUM_INVALID;
150 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
151 ASSERT_NE(ret, 0);
152 }
153
154 /**
155 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1300
156 * @tc.name: testHdiUsbRequestTestClaimInterface005
157 * @tc.desc: Claims a USB interface. ({255, 0}, 0, 255).
158 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface005, TestSize.Level2)159 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface005, TestSize.Level2)
160 {
161 uint8_t interfaceId = 0;
162 struct UsbDev dev = dev_;
163 dev.busNum = BUS_NUM_INVALID;
164 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
165 ASSERT_NE(ret, 0);
166 }
167
168 /**
169 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1400
170 * @tc.name: testHdiUsbRequestTestClaimInterface006
171 * @tc.desc: Claims a USB interface. ({255, 0}, 255, 0).
172 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface006, TestSize.Level2)173 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface006, TestSize.Level2)
174 {
175 uint8_t interfaceId = 255;
176 struct UsbDev dev = dev_;
177 dev.busNum = BUS_NUM_INVALID;
178 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
179 ASSERT_NE(ret, 0);
180 }
181
182 /**
183 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1500
184 * @tc.name: testHdiUsbRequestTestClaimInterface007
185 * @tc.desc: Claims a USB interface. ({255, 0}, 255, 1).
186 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface007, TestSize.Level2)187 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface007, TestSize.Level2)
188 {
189 uint8_t interfaceId = 255;
190 struct UsbDev dev = dev_;
191 dev.busNum = BUS_NUM_INVALID;
192 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
193 ASSERT_NE(ret, 0);
194 }
195
196 /**
197 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1600
198 * @tc.name: testHdiUsbRequestTestClaimInterface008
199 * @tc.desc: Claims a USB interface. ({255, 0}, 255, 255).
200 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface008, TestSize.Level2)201 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface008, TestSize.Level2)
202 {
203 uint8_t interfaceId = 255;
204 struct UsbDev dev = dev_;
205 dev.busNum = BUS_NUM_INVALID;
206 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
207 ASSERT_NE(ret, 0);
208 }
209
210 /**
211 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1700
212 * @tc.name: testHdiUsbRequestTestClaimInterface009
213 * @tc.desc: Claims a USB interface. ({200, 255}, 1, 0).
214 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface009, TestSize.Level2)215 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface009, TestSize.Level2)
216 {
217 uint8_t interfaceId = INTERFACEID_OK;
218 struct UsbDev dev = {200, DEV_ADDR_INVALID};
219 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
220 ASSERT_NE(ret, 0);
221 }
222
223 /**
224 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1800
225 * @tc.name: testHdiUsbRequestTestClaimInterface010
226 * @tc.desc: Claims a USB interface. ({200, 255}, 1, 1).
227 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface010, TestSize.Level2)228 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface010, TestSize.Level2)
229 {
230 uint8_t interfaceId = INTERFACEID_OK;
231 struct UsbDev dev = {200, DEV_ADDR_INVALID};
232 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
233 ASSERT_NE(ret, 0);
234 }
235
236 /**
237 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_1900
238 * @tc.name: testHdiUsbRequestTestClaimInterface011
239 * @tc.desc: Claims a USB interface. ({100, 0}, 1, 255).
240 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface011, TestSize.Level2)241 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface011, TestSize.Level2)
242 {
243 uint8_t interfaceId = INTERFACEID_OK;
244 struct UsbDev dev = dev_;
245 dev.busNum = 100;
246 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
247 ASSERT_NE(ret, 0);
248 }
249
250 /**
251 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2000
252 * @tc.name: testHdiUsbRequestTestClaimInterface012
253 * @tc.desc: Claims a USB interface. ({200, 255}, 0, 0)
254 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface012, TestSize.Level2)255 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface012, TestSize.Level2)
256 {
257 uint8_t interfaceId = 0;
258 struct UsbDev dev = {200, DEV_ADDR_INVALID};
259 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
260 ASSERT_NE(ret, 0);
261 }
262
263 /**
264 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2100
265 * @tc.name: testHdiUsbRequestTestClaimInterface013
266 * @tc.desc: Claims a USB interface. ({200, 255}, 0, 1).
267 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface013, TestSize.Level2)268 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface013, TestSize.Level2)
269 {
270 uint8_t interfaceId = 0;
271 struct UsbDev dev = {200, DEV_ADDR_INVALID};
272 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
273 ASSERT_NE(ret, 0);
274 }
275
276 /**
277 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2200
278 * @tc.name: testHdiUsbRequestTestClaimInterface014
279 * @tc.desc: Claims a USB interface. ({100, 0}, 0, 255).
280 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface014, TestSize.Level2)281 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface014, TestSize.Level2)
282 {
283 uint8_t interfaceId = 0;
284 struct UsbDev dev = dev_;
285 dev.busNum = 100;
286 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
287 ASSERT_NE(ret, 0);
288 }
289
290 /**
291 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2300
292 * @tc.name: testHdiUsbRequestTestClaimInterface015
293 * @tc.desc: Claims a USB interface. ({100, 0}, 255, 0).
294 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface015, TestSize.Level2)295 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface015, TestSize.Level2)
296 {
297 uint8_t interfaceId = 255;
298 struct UsbDev dev = dev_;
299 dev.busNum = 100;
300 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
301 ASSERT_NE(ret, 0);
302 }
303
304 /**
305 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2400
306 * @tc.name: testHdiUsbRequestTestClaimInterface016
307 * @tc.desc: Claims a USB interface. ({100, 0}, 255, 1).
308 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface016, TestSize.Level2)309 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface016, TestSize.Level2)
310 {
311 uint8_t interfaceId = 255;
312 struct UsbDev dev = dev_;
313 dev.busNum = 100;
314 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
315 ASSERT_NE(ret, 0);
316 }
317
318 /**
319 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2500
320 * @tc.name: testHdiUsbRequestTestClaimInterface017
321 * @tc.desc: Claims a USB interface. ({100, 0}, 255, 255).
322 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface017, TestSize.Level2)323 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface017, TestSize.Level2)
324 {
325 uint8_t interfaceId = 255;
326 struct UsbDev dev = dev_;
327 dev.busNum = 100;
328 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
329 ASSERT_NE(ret, 0);
330 }
331
332 /**
333 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2600
334 * @tc.name: testHdiUsbRequestTestClaimInterface018
335 * @tc.desc: Claims a USB interface. ({255, 200}, 1, 0).
336 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface018, TestSize.Level2)337 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface018, TestSize.Level2)
338 {
339 uint8_t interfaceId = INTERFACEID_OK;
340 struct UsbDev dev = {DEV_ADDR_INVALID, 200};
341 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
342 ASSERT_NE(ret, 0);
343 }
344
345 /**
346 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2700
347 * @tc.name: testHdiUsbRequestTestClaimInterface019
348 * @tc.desc: Claims a USB interface. ({255, 200}, 1, 1).
349 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface019, TestSize.Level2)350 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface019, TestSize.Level2)
351 {
352 uint8_t interfaceId = INTERFACEID_OK;
353 struct UsbDev dev = {DEV_ADDR_INVALID, 200};
354 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
355 ASSERT_NE(ret, 0);
356 }
357
358 /**
359 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2800
360 * @tc.name: testHdiUsbRequestTestClaimInterface020
361 * @tc.desc: Claims a USB interface. ({1, 0}, 1, 255).
362 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface020, TestSize.Level2)363 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface020, TestSize.Level2)
364 {
365 uint8_t interfaceId = INTERFACEID_OK;
366 struct UsbDev dev = dev_;
367 dev.busNum = 1;
368 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
369 ASSERT_NE(ret, 0);
370 }
371
372 /**
373 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_2900
374 * @tc.name: testHdiUsbRequestTestClaimInterface021
375 * @tc.desc: Claims a USB interface. ({255, 200}, 0, 0).
376 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface021, TestSize.Level2)377 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface021, TestSize.Level2)
378 {
379 uint8_t interfaceId = 0;
380 struct UsbDev dev = {DEV_ADDR_INVALID, 200};
381 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
382 ASSERT_NE(ret, 0);
383 }
384
385 /**
386 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3000
387 * @tc.name: testHdiUsbRequestTestClaimInterface022
388 * @tc.desc: Claims a USB interface. ({255, 200}, 0, 1).
389 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface022, TestSize.Level2)390 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface022, TestSize.Level2)
391 {
392 uint8_t interfaceId = 0;
393 struct UsbDev dev = {DEV_ADDR_INVALID, 200};
394 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
395 ASSERT_NE(ret, 0);
396 }
397
398 /**
399 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3100
400 * @tc.name: testHdiUsbRequestTestClaimInterface023
401 * @tc.desc: Claims a USB interface. ({1, 0}, 0, 255).
402 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface023, TestSize.Level2)403 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface023, TestSize.Level2)
404 {
405 uint8_t interfaceId = 0;
406 struct UsbDev dev = dev_;
407 dev.busNum = 1;
408 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
409 ASSERT_NE(ret, 0);
410 }
411
412 /**
413 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3200
414 * @tc.name: testHdiUsbRequestTestClaimInterface024
415 * @tc.desc: Claims a USB interface. ({1, 0}, 255, 0).
416 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface024, TestSize.Level2)417 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface024, TestSize.Level2)
418 {
419 uint8_t interfaceId = 255;
420 struct UsbDev dev = dev_;
421 dev.busNum = 1;
422 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
423 ASSERT_NE(ret, 0);
424 }
425
426 /**
427 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3300
428 * @tc.name: testHdiUsbRequestTestClaimInterface025
429 * @tc.desc: Claims a USB interface. ({1, 0}, 255, 1).
430 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface025, TestSize.Level2)431 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface025, TestSize.Level2)
432 {
433 uint8_t interfaceId = 255;
434 struct UsbDev dev = dev_;
435 dev.busNum = 1;
436 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
437 ASSERT_NE(ret, 0);
438 }
439
440 /**
441 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3400
442 * @tc.name: testHdiUsbRequestTestClaimInterface026
443 * @tc.desc: Claims a USB interface. ({1, 0}, 255, 255).
444 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface026, TestSize.Level2)445 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface026, TestSize.Level2)
446 {
447 uint8_t interfaceId = 255;
448 struct UsbDev dev = dev_;
449 dev.busNum = 1;
450 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
451 ASSERT_NE(ret, 0);
452 }
453
454 /**
455 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3500
456 * @tc.name: testHdiUsbRequestTestClaimInterface027
457 * @tc.desc: Claims a USB interface. ({0, 255}, 1, 0).
458 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface027, TestSize.Level2)459 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface027, TestSize.Level2)
460 {
461 uint8_t interfaceId = INTERFACEID_OK;
462 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
463 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
464 ASSERT_NE(ret, 0);
465 }
466
467 /**
468 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3600
469 * @tc.name: testHdiUsbRequestTestClaimInterface028
470 * @tc.desc: Claims a USB interface. ({0, 255}, 1, 255).
471 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface028, TestSize.Level2)472 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface028, TestSize.Level2)
473 {
474 uint8_t interfaceId = INTERFACEID_OK;
475 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
476 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
477 ASSERT_NE(ret, 0);
478 }
479
480 /**
481 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3700
482 * @tc.name: testHdiUsbRequestTestClaimInterface029
483 * @tc.desc: Claims a USB interface. ({0, 255}, 0, 0).
484 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface029, TestSize.Level2)485 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface029, TestSize.Level2)
486 {
487 uint8_t interfaceId = 0;
488 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
489 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
490 ASSERT_NE(ret, 0);
491 }
492
493 /**
494 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3800
495 * @tc.name: testHdiUsbRequestTestClaimInterface030
496 * @tc.desc: Claims a USB interface. ({0, 255}, 0, 1).
497 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface030, TestSize.Level2)498 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface030, TestSize.Level2)
499 {
500 uint8_t interfaceId = 0;
501 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
502 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
503 ASSERT_NE(ret, 0);
504 }
505
506 /**
507 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_3900
508 * @tc.name: testHdiUsbRequestTestClaimInterface031
509 * @tc.desc: Claims a USB interface. ({0, 255}, 0, 255).
510 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface031, TestSize.Level2)511 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface031, TestSize.Level2)
512 {
513 uint8_t interfaceId = 0;
514 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
515 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
516 ASSERT_NE(ret, 0);
517 }
518
519 /**
520 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4000
521 * @tc.name: testHdiUsbRequestTestClaimInterface032
522 * @tc.desc: Claims a USB interface. ({0, 255}, 255, 0).
523 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface032, TestSize.Level2)524 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface032, TestSize.Level2)
525 {
526 uint8_t interfaceId = 255;
527 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
528 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
529 ASSERT_NE(ret, 0);
530 }
531
532 /**
533 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4100
534 * @tc.name: testHdiUsbRequestTestClaimInterface033
535 * @tc.desc: Claims a USB interface. ({0, 255}, 255, 255).
536 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface033, TestSize.Level2)537 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface033, TestSize.Level2)
538 {
539 uint8_t interfaceId = 255;
540 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
541 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
542 ASSERT_NE(ret, 0);
543 }
544
545 /**
546 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4200
547 * @tc.name: testHdiUsbRequestTestClaimInterface034
548 * @tc.desc: Claims a USB interface. ({150, 255}, 1, 0).
549 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface034, TestSize.Level2)550 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface034, TestSize.Level2)
551 {
552 uint8_t interfaceId = INTERFACEID_OK;
553 struct UsbDev dev = {150, DEV_ADDR_INVALID};
554 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
555 ASSERT_NE(ret, 0);
556 }
557
558 /**
559 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4300
560 * @tc.name: testHdiUsbRequestTestClaimInterface035
561 * @tc.desc: Claims a USB interface. ({150, 255}, 1, 1).
562 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface035, TestSize.Level2)563 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface035, TestSize.Level2)
564 {
565 uint8_t interfaceId = INTERFACEID_OK;
566 struct UsbDev dev = {150, DEV_ADDR_INVALID};
567 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
568 ASSERT_NE(ret, 0);
569 }
570
571 /**
572 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4400
573 * @tc.name: testHdiUsbRequestTestClaimInterface036
574 * @tc.desc: Claims a USB interface. ({0, 100}, 1, 255).
575 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface036, TestSize.Level2)576 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface036, TestSize.Level2)
577 {
578 uint8_t interfaceId = INTERFACEID_OK;
579 struct UsbDev dev = {dev_.busNum, 100};
580 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
581 ASSERT_NE(ret, 0);
582 }
583
584 /**
585 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4500
586 * @tc.name: testHdiUsbRequestTestClaimInterface037
587 * @tc.desc: Claims a USB interface. ({150, 255}, 0, 0).
588 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface037, TestSize.Level2)589 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface037, TestSize.Level2)
590 {
591 uint8_t interfaceId = 0;
592 struct UsbDev dev = {150, DEV_ADDR_INVALID};
593 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
594 ASSERT_NE(ret, 0);
595 }
596
597 /**
598 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4600
599 * @tc.name: testHdiUsbRequestTestClaimInterface038
600 * @tc.desc: Claims a USB interface. ({150, 255}, 0, 1).
601 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface038, TestSize.Level2)602 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface038, TestSize.Level2)
603 {
604 uint8_t interfaceId = 0;
605 struct UsbDev dev = {150, DEV_ADDR_INVALID};
606 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
607 ASSERT_NE(ret, 0);
608 }
609
610 /**
611 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4700
612 * @tc.name: testHdiUsbRequestTestClaimInterface039
613 * @tc.desc: Claims a USB interface. ({0, 100}, 0, 255).
614 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface039, TestSize.Level2)615 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface039, TestSize.Level2)
616 {
617 uint8_t interfaceId = 0;
618 struct UsbDev dev = {dev_.busNum, 100};
619 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
620 ASSERT_NE(ret, 0);
621 }
622
623 /**
624 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4800
625 * @tc.name: testHdiUsbRequestTestClaimInterface040
626 * @tc.desc: Claims a USB interface. ({0, 100}, 255, 0).
627 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface040, TestSize.Level2)628 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface040, TestSize.Level2)
629 {
630 uint8_t interfaceId = INTERFACEID_INVALID;
631 struct UsbDev dev = {dev_.busNum, 100};
632 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
633 ASSERT_NE(ret, 0);
634 }
635
636 /**
637 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_4900
638 * @tc.name: testHdiUsbRequestTestClaimInterface041
639 * @tc.desc: Claims a USB interface. ({0, 100}, 255, 1).
640 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface041, TestSize.Level2)641 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface041, TestSize.Level2)
642 {
643 uint8_t interfaceId = INTERFACEID_INVALID;
644 struct UsbDev dev = {dev_.busNum, 100};
645 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
646 ASSERT_NE(ret, 0);
647 }
648
649 /**
650 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5000
651 * @tc.name: testHdiUsbRequestTestClaimInterface042
652 * @tc.desc: Claims a USB interface. ({0, 100}, 255, 255).
653 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface042, TestSize.Level2)654 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface042, TestSize.Level2)
655 {
656 uint8_t interfaceId = INTERFACEID_INVALID;
657 struct UsbDev dev = {dev_.busNum, 100};
658 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
659 ASSERT_NE(ret, 0);
660 }
661
662 /**
663 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5100
664 * @tc.name: testHdiUsbRequestTestClaimInterface043
665 * @tc.desc: Claims a USB interface. ({0, 255}, 0, 0).
666 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface043, TestSize.Level2)667 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface043, TestSize.Level2)
668 {
669 uint8_t interfaceId = 0;
670 struct UsbDev dev = {dev_.busNum, DEV_ADDR_INVALID};
671 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
672 ASSERT_NE(ret, 0);
673 }
674
675 /**
676 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5200
677 * @tc.name: testHdiUsbRequestTestClaimInterface044
678 * @tc.desc: Claims a USB interface. ({255, 0}, 100, 0).
679 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface044, TestSize.Level2)680 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface044, TestSize.Level2)
681 {
682 uint8_t interfaceId = 100;
683 struct UsbDev dev = {DEV_ADDR_INVALID, dev_.devAddr};
684 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
685 ASSERT_NE(ret, 0);
686 }
687
688 /**
689 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5300
690 * @tc.name: testHdiUsbRequestTestClaimInterface045
691 * @tc.desc: Claims a USB interface. ({255, 0}, 100, 1).
692 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface045, TestSize.Level2)693 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface045, TestSize.Level2)
694 {
695 uint8_t interfaceId = 100;
696 struct UsbDev dev = {DEV_ADDR_INVALID, dev_.devAddr};
697 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
698 ASSERT_NE(ret, 0);
699 }
700
701 /**
702 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5400
703 * @tc.name: testHdiUsbRequestTestClaimInterface046
704 * @tc.desc: Claims a USB interface. ({255, 0}, 100, 255).
705 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface046, TestSize.Level2)706 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface046, TestSize.Level2)
707 {
708 uint8_t interfaceId = 100;
709 struct UsbDev dev = {DEV_ADDR_INVALID, dev_.devAddr};
710 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
711 ASSERT_NE(ret, 0);
712 }
713
714 /**
715 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5500
716 * @tc.name: testHdiUsbRequestTestClaimInterface047
717 * @tc.desc: Claims a USB interface. ({255, 0}, 1, 100).
718 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface047, TestSize.Level2)719 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface047, TestSize.Level2)
720 {
721 uint8_t interfaceId = 1;
722 struct UsbDev dev = {DEV_ADDR_INVALID, dev_.devAddr};
723 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 100);
724 ASSERT_NE(ret, 0);
725 }
726
727 /**
728 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5600
729 * @tc.name: testHdiUsbRequestTestClaimInterface048
730 * @tc.desc: Claims a USB interface. ({255, 100}, 1, 1).
731 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface048, TestSize.Level2)732 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface048, TestSize.Level2)
733 {
734 uint8_t interfaceId = 1;
735 struct UsbDev dev = {DEV_ADDR_INVALID, 100};
736 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
737 ASSERT_NE(ret, 0);
738 }
739
740 /**
741 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5700
742 * @tc.name: testHdiUsbRequestTestClaimInterface049
743 * @tc.desc: Claims a USB interface. ({255, 100}, 1, 255).
744 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface049, TestSize.Level2)745 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface049, TestSize.Level2)
746 {
747 uint8_t interfaceId = 1;
748 struct UsbDev dev = {DEV_ADDR_INVALID, 100};
749 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
750 ASSERT_NE(ret, 0);
751 }
752
753 /**
754 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5800
755 * @tc.name: testHdiUsbRequestTestClaimInterface050
756 * @tc.desc: Claims a USB interface. ({255, 100}, 255, 0).
757 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface050, TestSize.Level2)758 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface050, TestSize.Level2)
759 {
760 uint8_t interfaceId = 255;
761 struct UsbDev dev = {DEV_ADDR_INVALID, 100};
762 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
763 ASSERT_NE(ret, 0);
764 }
765
766 /**
767 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_5900
768 * @tc.name: testHdiUsbRequestTestClaimInterface051
769 * @tc.desc: Claims a USB interface. ({255, 100}, 255, 255).
770 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface051, TestSize.Level2)771 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface051, TestSize.Level2)
772 {
773 uint8_t interfaceId = 255;
774 struct UsbDev dev = {DEV_ADDR_INVALID, 100};
775 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
776 ASSERT_NE(ret, 0);
777 }
778
779 /**
780 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_6000
781 * @tc.name: testHdiUsbRequestTestClaimInterface052
782 * @tc.desc: Claims a USB interface. ({255, 255},0, 0).
783 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface052, TestSize.Level2)784 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface052, TestSize.Level2)
785 {
786 uint8_t interfaceId = 0;
787 struct UsbDev dev = {255, 255};
788 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
789 ASSERT_NE(ret, 0);
790 }
791
792 /**
793 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_6100
794 * @tc.name: testHdiUsbRequestTestClaimInterface053
795 * @tc.desc: Claims a USB interface. ({255, 255},0, 1).
796 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface053, TestSize.Level2)797 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface053, TestSize.Level2)
798 {
799 uint8_t interfaceId = 0;
800 struct UsbDev dev = {255, 255};
801 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1);
802 ASSERT_NE(ret, 0);
803 }
804
805 /**
806 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_6200
807 * @tc.name: testHdiUsbRequestTestClaimInterface054
808 * @tc.desc: Claims a USB interface. ({255, 255},0, 255).
809 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface054, TestSize.Level2)810 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface054, TestSize.Level2)
811 {
812 uint8_t interfaceId = 0;
813 struct UsbDev dev = {255, 255};
814 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
815 ASSERT_NE(ret, 0);
816 }
817
818 /**
819 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_6300
820 * @tc.name: testHdiUsbRequestTestClaimInterface055
821 * @tc.desc: Claims a USB interface. ({255, 255},1, 0).
822 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface055, TestSize.Level2)823 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface055, TestSize.Level2)
824 {
825 uint8_t interfaceId = 1;
826 struct UsbDev dev = {255, 255};
827 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
828 ASSERT_NE(ret, 0);
829 }
830
831 /**
832 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_6400
833 * @tc.name: testHdiUsbRequestTestClaimInterface056
834 * @tc.desc: Claims a USB interface. ({255, 255},1, 255).
835 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface056, TestSize.Level2)836 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface056, TestSize.Level2)
837 {
838 uint8_t interfaceId = 1;
839 struct UsbDev dev = {255, 255};
840 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
841 ASSERT_NE(ret, 0);
842 }
843
844 /**
845 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_6500
846 * @tc.name: testHdiUsbRequestTestClaimInterface057
847 * @tc.desc: Claims a USB interface. ({255, 255},255, 0).
848 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface057, TestSize.Level2)849 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface057, TestSize.Level2)
850 {
851 uint8_t interfaceId = 255;
852 struct UsbDev dev = {255, 255};
853 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 0);
854 ASSERT_NE(ret, 0);
855 }
856
857 /**
858 * @tc.number: SUB_Driver_Usb_RequestTest_ClaimInterface_6600
859 * @tc.name: testHdiUsbRequestTestClaimInterface058
860 * @tc.desc: Claims a USB interface. ({255, 255},255, 255).
861 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface058, TestSize.Level2)862 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestClaimInterface058, TestSize.Level2)
863 {
864 uint8_t interfaceId = 255;
865 struct UsbDev dev = {255, 255};
866 auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 255);
867 ASSERT_NE(ret, 0);
868 }
869
870 /**
871 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_0900
872 * @tc.name: testHdiUsbRequestTestSetConfig001
873 * @tc.desc: Sets the configuration information of a USB device. ({100, 255},0).
874 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig001, TestSize.Level2)875 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig001, TestSize.Level2)
876 {
877 uint8_t configIndex = 0;
878 struct UsbDev dev = dev_;
879 dev = {100, 255};
880 auto ret = g_usbInterface->SetConfig(dev, configIndex);
881 ASSERT_NE(ret, 0);
882 }
883
884 /**
885 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1000
886 * @tc.name: testHdiUsbRequestTestSetConfig002
887 * @tc.desc: Sets the configuration information of a USB device. ({100, 255},1).
888 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig002, TestSize.Level2)889 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig002, TestSize.Level2)
890 {
891 uint8_t configIndex = 1;
892 struct UsbDev dev = dev_;
893 dev = {100, 255};
894 auto ret = g_usbInterface->SetConfig(dev, configIndex);
895 ASSERT_NE(ret, 0);
896 }
897
898 /**
899 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1100
900 * @tc.name: testHdiUsbRequestTestSetConfig003
901 * @tc.desc: Sets the configuration information of a USB device. ({100, 255},255).
902 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig003, TestSize.Level2)903 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig003, TestSize.Level2)
904 {
905 uint8_t configIndex = 255;
906 struct UsbDev dev = dev_;
907 dev = {100, 255};
908 auto ret = g_usbInterface->SetConfig(dev, configIndex);
909 ASSERT_NE(ret, 0);
910 }
911
912 /**
913 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1200
914 * @tc.name: testHdiUsbRequestTestSetConfig004
915 * @tc.desc: Sets the configuration information of a USB device. ({1, 0},255).
916 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig004, TestSize.Level2)917 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig004, TestSize.Level2)
918 {
919 uint8_t configIndex = 255;
920 struct UsbDev dev = dev_;
921 dev = {1, 0};
922 auto ret = g_usbInterface->SetConfig(dev, configIndex);
923 ASSERT_NE(ret, 0);
924 }
925
926 /**
927 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1300
928 * @tc.name: testHdiUsbRequestTestSetConfig005
929 * @tc.desc: Sets the configuration information of a USB device. ({255, 100},0).
930 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig005, TestSize.Level2)931 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig005, TestSize.Level2)
932 {
933 uint8_t configIndex = 0;
934 struct UsbDev dev = dev_;
935 dev = {255, 100};
936 auto ret = g_usbInterface->SetConfig(dev, configIndex);
937 ASSERT_NE(ret, 0);
938 }
939
940 /**
941 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1400
942 * @tc.name: testHdiUsbRequestTestSetConfig006
943 * @tc.desc: Sets the configuration information of a USB device. ({255, 100},1).
944 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig006, TestSize.Level2)945 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig006, TestSize.Level2)
946 {
947 uint8_t configIndex = 1;
948 struct UsbDev dev = dev_;
949 dev = {255, 100};
950 auto ret = g_usbInterface->SetConfig(dev, configIndex);
951 ASSERT_NE(ret, 0);
952 }
953
954 /**
955 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1500
956 * @tc.name: testHdiUsbRequestTestSetConfig007
957 * @tc.desc: Sets the configuration information of a USB device. ({0, 1},255).
958 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig007, TestSize.Level2)959 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig007, TestSize.Level2)
960 {
961 uint8_t configIndex = 255;
962 struct UsbDev dev = dev_;
963 dev = {0, 1};
964 auto ret = g_usbInterface->SetConfig(dev, configIndex);
965 ASSERT_NE(ret, 0);
966 }
967
968 /**
969 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1600
970 * @tc.name: testHdiUsbRequestTestSetConfig008
971 * @tc.desc: Sets the configuration information of a USB device. ({255, 0},0).
972 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig008, TestSize.Level2)973 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig008, TestSize.Level2)
974 {
975 uint8_t configIndex = 0;
976 struct UsbDev dev = dev_;
977 dev = {255, 0};
978 auto ret = g_usbInterface->SetConfig(dev, configIndex);
979 ASSERT_NE(ret, 0);
980 }
981
982 /**
983 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1700
984 * @tc.name: testHdiUsbRequestTestSetConfig009
985 * @tc.desc: Sets the configuration information of a USB device. ({255, 1},0).
986 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig009, TestSize.Level2)987 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig009, TestSize.Level2)
988 {
989 uint8_t configIndex = 0;
990 struct UsbDev dev = dev_;
991 dev = {255, 1};
992 auto ret = g_usbInterface->SetConfig(dev, configIndex);
993 ASSERT_NE(ret, 0);
994 }
995
996 /**
997 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1800
998 * @tc.name: testHdiUsbRequestTestSetConfig010
999 * @tc.desc: Sets the configuration information of a USB device. ({255, 1},1).
1000 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig010, TestSize.Level2)1001 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig010, TestSize.Level2)
1002 {
1003 uint8_t configIndex = 1;
1004 struct UsbDev dev = dev_;
1005 dev = {255, 1};
1006 auto ret = g_usbInterface->SetConfig(dev, configIndex);
1007 ASSERT_NE(ret, 0);
1008 }
1009
1010 /**
1011 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_1900
1012 * @tc.name: testHdiUsbRequestTestSetConfig011
1013 * @tc.desc: Sets the configuration information of a USB device. ({255, 1},255).
1014 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig011, TestSize.Level2)1015 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig011, TestSize.Level2)
1016 {
1017 uint8_t configIndex = 255;
1018 struct UsbDev dev = dev_;
1019 dev = {255, 1};
1020 auto ret = g_usbInterface->SetConfig(dev, configIndex);
1021 ASSERT_NE(ret, 0);
1022 }
1023
1024 /**
1025 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_2000
1026 * @tc.name: testHdiUsbRequestTestSetConfig012
1027 * @tc.desc: Sets the configuration information of a USB device. ({0, 255},0).
1028 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig012, TestSize.Level2)1029 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig012, TestSize.Level2)
1030 {
1031 uint8_t configIndex = 0;
1032 struct UsbDev dev = dev_;
1033 dev = {0, 255};
1034 auto ret = g_usbInterface->SetConfig(dev, configIndex);
1035 ASSERT_NE(ret, 0);
1036 }
1037
1038 /**
1039 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_2100
1040 * @tc.name: testHdiUsbRequestTestSetConfig013
1041 * @tc.desc: Sets the configuration information of a USB device. ({1, 255},0).
1042 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig013, TestSize.Level2)1043 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig013, TestSize.Level2)
1044 {
1045 uint8_t configIndex = 0;
1046 struct UsbDev dev = dev_;
1047 dev = {1, 255};
1048 auto ret = g_usbInterface->SetConfig(dev, configIndex);
1049 ASSERT_NE(ret, 0);
1050 }
1051
1052 /**
1053 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_2200
1054 * @tc.name: testHdiUsbRequestTestSetConfig014
1055 * @tc.desc: Sets the configuration information of a USB device. ({1, 255},1).
1056 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig014, TestSize.Level2)1057 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig014, TestSize.Level2)
1058 {
1059 uint8_t configIndex = 1;
1060 struct UsbDev dev = dev_;
1061 dev = {1, 255};
1062 auto ret = g_usbInterface->SetConfig(dev, configIndex);
1063 ASSERT_NE(ret, 0);
1064 }
1065
1066 /**
1067 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_2300
1068 * @tc.name: testHdiUsbRequestTestSetConfig015
1069 * @tc.desc: Sets the configuration information of a USB device. ({1, 255},255).
1070 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig015, TestSize.Level2)1071 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig015, TestSize.Level2)
1072 {
1073 uint8_t configIndex = 255;
1074 struct UsbDev dev = dev_;
1075 dev = {1, 255};
1076 auto ret = g_usbInterface->SetConfig(dev, configIndex);
1077 ASSERT_NE(ret, 0);
1078 }
1079
1080 /**
1081 * @tc.number: SUB_Driver_Usb_RequestTest_SetConfig_2400
1082 * @tc.name: testHdiUsbRequestTestSetConfig016
1083 * @tc.desc: Sets the configuration information of a USB device. ({255, 255},0).
1084 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig016, TestSize.Level2)1085 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestSetConfig016, TestSize.Level2)
1086 {
1087 uint8_t configIndex = 0;
1088 struct UsbDev dev = dev_;
1089 dev = {255, 255};
1090 auto ret = g_usbInterface->SetConfig(dev, configIndex);
1091 ASSERT_NE(ret, 0);
1092 }
1093
1094 /**
1095 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_0900
1096 * @tc.name: testHdiUsbRequestTestReleaseInterface001
1097 * @tc.desc: Releases a USB interface. ({100, 255},0).
1098 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface001, TestSize.Level2)1099 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface001, TestSize.Level2)
1100 {
1101 int32_t interfaceId = 0;
1102 struct UsbDev dev = {100, 255};
1103 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1104 ASSERT_NE(ret, 0);
1105 }
1106
1107 /**
1108 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1000
1109 * @tc.name: testHdiUsbRequestTestReleaseInterface002
1110 * @tc.desc: Releases a USB interface. ({100, 255},1).
1111 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface002, TestSize.Level2)1112 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface002, TestSize.Level2)
1113 {
1114 int32_t interfaceId = 1;
1115 struct UsbDev dev = {100, 255};
1116 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1117 ASSERT_NE(ret, 0);
1118 }
1119
1120 /**
1121 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1100
1122 * @tc.name: testHdiUsbRequestTestReleaseInterface003
1123 * @tc.desc: Releases a USB interface. ({100, 255},255).
1124 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface003, TestSize.Level2)1125 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface003, TestSize.Level2)
1126 {
1127 int32_t interfaceId = 255;
1128 struct UsbDev dev = {100, 255};
1129 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1130 ASSERT_NE(ret, 0);
1131 }
1132
1133 /**
1134 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1200
1135 * @tc.name: testHdiUsbRequestTestReleaseInterface004
1136 * @tc.desc: Releases a USB interface. ({1, 0},255).
1137 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface004, TestSize.Level2)1138 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface004, TestSize.Level2)
1139 {
1140 int32_t interfaceId = 255;
1141 struct UsbDev dev = {1, 0};
1142 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1143 ASSERT_NE(ret, 0);
1144 }
1145
1146 /**
1147 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1300
1148 * @tc.name: testHdiUsbRequestTestReleaseInterface005
1149 * @tc.desc: Releases a USB interface. ({255, 100},0).
1150 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface005, TestSize.Level2)1151 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface005, TestSize.Level2)
1152 {
1153 int32_t interfaceId = 0;
1154 struct UsbDev dev = {255, 100};
1155 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1156 ASSERT_NE(ret, 0);
1157 }
1158
1159 /**
1160 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1400
1161 * @tc.name: testHdiUsbRequestTestReleaseInterface006
1162 * @tc.desc: Releases a USB interface. ({255, 100},1).
1163 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface006, TestSize.Level2)1164 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface006, TestSize.Level2)
1165 {
1166 int32_t interfaceId = 1;
1167 struct UsbDev dev = {255, 100};
1168 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1169 ASSERT_NE(ret, 0);
1170 }
1171
1172 /**
1173 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1500
1174 * @tc.name: testHdiUsbRequestTestReleaseInterface007
1175 * @tc.desc: Releases a USB interface. ({0, 1},255).
1176 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface007, TestSize.Level2)1177 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface007, TestSize.Level2)
1178 {
1179 int32_t interfaceId = 255;
1180 struct UsbDev dev = {0, 1};
1181 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1182 ASSERT_NE(ret, 0);
1183 }
1184
1185 /**
1186 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1600
1187 * @tc.name: testHdiUsbRequestTestReleaseInterface008
1188 * @tc.desc: Releases a USB interface. ({255, 0},0).
1189 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface008, TestSize.Level2)1190 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface008, TestSize.Level2)
1191 {
1192 int32_t interfaceId = 0;
1193 struct UsbDev dev = {255, 0};
1194 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1195 ASSERT_NE(ret, 0);
1196 }
1197
1198 /**
1199 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1700
1200 * @tc.name: testHdiUsbRequestTestReleaseInterface009
1201 * @tc.desc: Releases a USB interface. ({255, 1},0).
1202 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface009, TestSize.Level2)1203 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface009, TestSize.Level2)
1204 {
1205 int32_t interfaceId = 0;
1206 struct UsbDev dev = {255, 1};
1207 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1208 ASSERT_NE(ret, 0);
1209 }
1210
1211 /**
1212 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1800
1213 * @tc.name: testHdiUsbRequestTestReleaseInterface010
1214 * @tc.desc: Releases a USB interface. ({255, 1},1).
1215 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface010, TestSize.Level2)1216 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface010, TestSize.Level2)
1217 {
1218 int32_t interfaceId = 1;
1219 struct UsbDev dev = {255, 1};
1220 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1221 ASSERT_NE(ret, 0);
1222 }
1223
1224 /**
1225 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_1900
1226 * @tc.name: testHdiUsbRequestTestReleaseInterface011
1227 * @tc.desc: Releases a USB interface. ({255, 1},255).
1228 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface011, TestSize.Level2)1229 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface011, TestSize.Level2)
1230 {
1231 int32_t interfaceId = 255;
1232 struct UsbDev dev = {255, 1};
1233 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1234 ASSERT_NE(ret, 0);
1235 }
1236
1237 /**
1238 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_2000
1239 * @tc.name: testHdiUsbRequestTestReleaseInterface012
1240 * @tc.desc: Releases a USB interface. ({0, 255},0).
1241 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface012, TestSize.Level2)1242 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface012, TestSize.Level2)
1243 {
1244 int32_t interfaceId = 0;
1245 struct UsbDev dev = {0, 255};
1246 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1247 ASSERT_NE(ret, 0);
1248 }
1249
1250 /**
1251 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_2100
1252 * @tc.name: testHdiUsbRequestTestReleaseInterface013
1253 * @tc.desc: Releases a USB interface. ({1, 255},0).
1254 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface013, TestSize.Level2)1255 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface013, TestSize.Level2)
1256 {
1257 int32_t interfaceId = 0;
1258 struct UsbDev dev = {1, 255};
1259 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1260 ASSERT_NE(ret, 0);
1261 }
1262
1263 /**
1264 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_2200
1265 * @tc.name: testHdiUsbRequestTestReleaseInterface014
1266 * @tc.desc: Releases a USB interface. ({1, 255},1).
1267 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface014, TestSize.Level2)1268 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface014, TestSize.Level2)
1269 {
1270 int32_t interfaceId = 1;
1271 struct UsbDev dev = {1, 255};
1272 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1273 ASSERT_NE(ret, 0);
1274 }
1275
1276 /**
1277 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_2300
1278 * @tc.name: testHdiUsbRequestTestReleaseInterface015
1279 * @tc.desc: Releases a USB interface. ({1, 255},255).
1280 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface015, TestSize.Level2)1281 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface015, TestSize.Level2)
1282 {
1283 int32_t interfaceId = 255;
1284 struct UsbDev dev = {1, 255};
1285 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1286 ASSERT_NE(ret, 0);
1287 }
1288
1289 /**
1290 * @tc.number: SUB_Driver_Usb_RequestTest_ReleaseInterface_2400
1291 * @tc.name: testHdiUsbRequestTestReleaseInterface016
1292 * @tc.desc: Releases a USB interface. ({255, 255},0).
1293 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface016, TestSize.Level2)1294 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestReleaseInterface016, TestSize.Level2)
1295 {
1296 int32_t interfaceId = 0;
1297 struct UsbDev dev = {255, 255};
1298 auto ret = g_usbInterface->ReleaseInterface(dev, interfaceId);
1299 ASSERT_NE(ret, 0);
1300 }
1301
1302 /**
1303 * @tc.number: SUB_Driver_Usb_RequestTest_GetDeviceDescriptor_0900
1304 * @tc.name: testHdiUsbRequestTestGetDeviceDescriptor001
1305 * @tc.desc: Obtains the USB device descriptor dev(255, 1).
1306 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetDeviceDescriptor001, TestSize.Level2)1307 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetDeviceDescriptor001, TestSize.Level2)
1308 {
1309 struct UsbDev dev = {255, 1};
1310 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1311 auto ret = g_usbInterface->GetDeviceDescriptor(dev, devData);
1312 ASSERT_NE(ret, 0);
1313 }
1314
1315 /**
1316 * @tc.number: SUB_Driver_Usb_RequestTest_GetDeviceDescriptor_1000
1317 * @tc.name: testHdiUsbRequestTestGetDeviceDescriptor002
1318 * @tc.desc: Obtains the USB device descriptor dev(1, 255).
1319 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetDeviceDescriptor002, TestSize.Level2)1320 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetDeviceDescriptor002, TestSize.Level2)
1321 {
1322 struct UsbDev dev = {1, 255};
1323 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1324 auto ret = g_usbInterface->GetDeviceDescriptor(dev, devData);
1325 ASSERT_NE(ret, 0);
1326 }
1327
1328 /**
1329 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_0900
1330 * @tc.name: testHdiUsbRequestTestGetStringDescriptor001
1331 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(0, 255) stringId = 1.
1332 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor001, TestSize.Level2)1333 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor001, TestSize.Level2)
1334 {
1335 uint8_t stringId = 1;
1336 struct UsbDev dev = {0, 255};
1337 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1338 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1339 ASSERT_NE(ret, 0);
1340 }
1341
1342 /**
1343 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1000
1344 * @tc.name: testHdiUsbRequestTestGetStringDescriptor002
1345 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(0, 255) stringId =
1346 * INVALID_NUM.
1347 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor002, TestSize.Level2)1348 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor002, TestSize.Level2)
1349 {
1350 uint8_t stringId = INVALID_NUM;
1351 struct UsbDev dev = {0, 255};
1352 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1353 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1354 ASSERT_NE(ret, 0);
1355 }
1356
1357 /**
1358 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1100
1359 * @tc.name: testHdiUsbRequestTestGetStringDescriptor003
1360 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(0, 255) stringId = 255.
1361 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor003, TestSize.Level2)1362 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor003, TestSize.Level2)
1363 {
1364 uint8_t stringId = 255;
1365 struct UsbDev dev = {0, 255};
1366 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1367 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1368 ASSERT_NE(ret, 0);
1369 }
1370
1371 /**
1372 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1200
1373 * @tc.name: testHdiUsbRequestTestGetStringDescriptor004
1374 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 0) stringId = 1.
1375 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor004, TestSize.Level2)1376 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor004, TestSize.Level2)
1377 {
1378 uint8_t stringId = 1;
1379 struct UsbDev dev = {255, 0};
1380 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1381 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1382 ASSERT_NE(ret, 0);
1383 }
1384
1385 /**
1386 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1300
1387 * @tc.name: testHdiUsbRequestTestGetStringDescriptor005
1388 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 0) stringId =
1389 * INVALID_NUM.
1390 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor005, TestSize.Level2)1391 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor005, TestSize.Level2)
1392 {
1393 uint8_t stringId = INVALID_NUM;
1394 struct UsbDev dev = {255, 0};
1395 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1396 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1397 ASSERT_NE(ret, 0);
1398 }
1399
1400 /**
1401 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1400
1402 * @tc.name: testHdiUsbRequestTestGetStringDescriptor006
1403 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 0) stringId =
1404 * STRING_ID_INVALID.
1405 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor006, TestSize.Level2)1406 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor006, TestSize.Level2)
1407 {
1408 uint8_t stringId = STRING_ID_INVALID;
1409 struct UsbDev dev = {255, 0};
1410 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1411 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1412 ASSERT_NE(ret, 0);
1413 }
1414
1415 /**
1416 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1500
1417 * @tc.name: testHdiUsbRequestTestGetStringDescriptor007
1418 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 0) stringId = 255.
1419 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor007, TestSize.Level2)1420 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor007, TestSize.Level2)
1421 {
1422 uint8_t stringId = 255;
1423 struct UsbDev dev = {255, 0};
1424 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1425 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1426 ASSERT_NE(ret, 0);
1427 }
1428
1429 /**
1430 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1600
1431 * @tc.name: testHdiUsbRequestTestGetStringDescriptor008
1432 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(1, 255) stringId = 0.
1433 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor008, TestSize.Level2)1434 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor008, TestSize.Level2)
1435 {
1436 uint8_t stringId = 0;
1437 struct UsbDev dev = {1, 255};
1438 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1439 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1440 ASSERT_NE(ret, 0);
1441 }
1442
1443 /**
1444 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1700
1445 * @tc.name: testHdiUsbRequestTestGetStringDescriptor009
1446 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(1, 255) stringId = 1.
1447 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor009, TestSize.Level2)1448 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor009, TestSize.Level2)
1449 {
1450 uint8_t stringId = 1;
1451 struct UsbDev dev = {1, 255};
1452 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1453 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1454 ASSERT_NE(ret, 0);
1455 }
1456
1457 /**
1458 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1800
1459 * @tc.name: testHdiUsbRequestTestGetStringDescriptor010
1460 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(1, 255) stringId =
1461 * INVALID_NUM.
1462 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor010, TestSize.Level2)1463 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor010, TestSize.Level2)
1464 {
1465 uint8_t stringId = INVALID_NUM;
1466 struct UsbDev dev = {1, 255};
1467 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1468 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1469 ASSERT_NE(ret, 0);
1470 }
1471
1472 /**
1473 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_1900
1474 * @tc.name: testHdiUsbRequestTestGetStringDescriptor011
1475 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(1, 255) stringId =
1476 * STRING_ID_INVALID.
1477 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor011, TestSize.Level2)1478 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor011, TestSize.Level2)
1479 {
1480 uint8_t stringId = STRING_ID_INVALID;
1481 struct UsbDev dev = {1, 255};
1482 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1483 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1484 ASSERT_NE(ret, 0);
1485 }
1486
1487 /**
1488 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2000
1489 * @tc.name: testHdiUsbRequestTestGetStringDescriptor012
1490 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(1, 255) stringId = 255.
1491 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor012, TestSize.Level2)1492 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor012, TestSize.Level2)
1493 {
1494 uint8_t stringId = 255;
1495 struct UsbDev dev = {1, 255};
1496 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1497 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1498 ASSERT_NE(ret, 0);
1499 }
1500
1501 /**
1502 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2100
1503 * @tc.name: testHdiUsbRequestTestGetStringDescriptor013
1504 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 1) stringId = 0.
1505 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor013, TestSize.Level2)1506 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor013, TestSize.Level2)
1507 {
1508 uint8_t stringId = 0;
1509 struct UsbDev dev = {255, 1};
1510 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1511 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1512 ASSERT_NE(ret, 0);
1513 }
1514
1515 /**
1516 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2200
1517 * @tc.name: testHdiUsbRequestTestGetStringDescriptor014
1518 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 1) stringId = 1.
1519 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor014, TestSize.Level2)1520 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor014, TestSize.Level2)
1521 {
1522 uint8_t stringId = 1;
1523 struct UsbDev dev = {255, 1};
1524 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1525 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1526 ASSERT_NE(ret, 0);
1527 }
1528
1529 /**
1530 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2300
1531 * @tc.name: testHdiUsbRequestTestGetStringDescriptor015
1532 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 1) stringId =
1533 * INVALID_NUM.
1534 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor015, TestSize.Level2)1535 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor015, TestSize.Level2)
1536 {
1537 uint8_t stringId = INVALID_NUM;
1538 struct UsbDev dev = {255, 1};
1539 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1540 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1541 ASSERT_NE(ret, 0);
1542 }
1543
1544 /**
1545 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2400
1546 * @tc.name: testHdiUsbRequestTestGetStringDescriptor016
1547 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 1) stringId =
1548 * STRING_ID_INVALID.
1549 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor016, TestSize.Level2)1550 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor016, TestSize.Level2)
1551 {
1552 uint8_t stringId = STRING_ID_INVALID;
1553 struct UsbDev dev = {255, 1};
1554 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1555 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1556 ASSERT_NE(ret, 0);
1557 }
1558
1559 /**
1560 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2500
1561 * @tc.name: testHdiUsbRequestTestGetStringDescriptor017
1562 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 1) stringId = 255.
1563 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor017, TestSize.Level2)1564 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor017, TestSize.Level2)
1565 {
1566 uint8_t stringId = 255;
1567 struct UsbDev dev = {255, 1};
1568 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1569 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1570 ASSERT_NE(ret, 0);
1571 }
1572
1573 /**
1574 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2600
1575 * @tc.name: testHdiUsbRequestTestGetStringDescriptor018
1576 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 255) stringId = 1.
1577 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor018, TestSize.Level2)1578 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor018, TestSize.Level2)
1579 {
1580 uint8_t stringId = 1;
1581 struct UsbDev dev = {255, 255};
1582 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1583 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1584 ASSERT_NE(ret, 0);
1585 }
1586
1587 /**
1588 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2700
1589 * @tc.name: testHdiUsbRequestTestGetStringDescriptor019
1590 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 255) stringId =
1591 * INVALID_NUM.
1592 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor019, TestSize.Level2)1593 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor019, TestSize.Level2)
1594 {
1595 uint8_t stringId = INVALID_NUM;
1596 struct UsbDev dev = {255, 255};
1597 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1598 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1599 ASSERT_NE(ret, 0);
1600 }
1601
1602 /**
1603 * @tc.number: SUB_Driver_Usb_RequestTest_GetStringDescriptor_2800
1604 * @tc.name: testHdiUsbRequestTestGetStringDescriptor020
1605 * @tc.desc: Obtains the string descriptor of a USB device based on the specified string ID. dev(255, 255) stringId =
1606 * 255.
1607 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor020, TestSize.Level2)1608 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetStringDescriptor020, TestSize.Level2)
1609 {
1610 uint8_t stringId = 255;
1611 struct UsbDev dev = {255, 255};
1612 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1613 auto ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData);
1614 ASSERT_NE(ret, 0);
1615 }
1616
1617 /**
1618 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_0900
1619 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor001
1620 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(0, 255)
1621 * configId = 1.
1622 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor001, TestSize.Level2)1623 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor001, TestSize.Level2)
1624 {
1625 uint8_t configId = 1;
1626 struct UsbDev dev = {0, 255};
1627 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1628 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1629 ASSERT_NE(ret, 0);
1630 }
1631
1632 /**
1633 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1000
1634 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor002
1635 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(0, 255)
1636 * configId = 255.
1637 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor002, TestSize.Level2)1638 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor002, TestSize.Level2)
1639 {
1640 uint8_t configId = 255;
1641 struct UsbDev dev = {0, 255};
1642 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1643 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1644 ASSERT_NE(ret, 0);
1645 }
1646
1647 /**
1648 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1100
1649 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor003
1650 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(1, 255)
1651 * configId = 0.
1652 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor003, TestSize.Level2)1653 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor003, TestSize.Level2)
1654 {
1655 uint8_t configId = 0;
1656 struct UsbDev dev = {1, 255};
1657 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1658 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1659 ASSERT_NE(ret, 0);
1660 }
1661
1662 /**
1663 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1200
1664 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor004
1665 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(1, 255)
1666 * configId = 1.
1667 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor004, TestSize.Level2)1668 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor004, TestSize.Level2)
1669 {
1670 uint8_t configId = 1;
1671 struct UsbDev dev = {1, 255};
1672 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1673 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1674 ASSERT_NE(ret, 0);
1675 }
1676
1677 /**
1678 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1300
1679 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor005
1680 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(1, 255)
1681 * configId = CONFIG_ID_INVALID.
1682 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor005, TestSize.Level2)1683 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor005, TestSize.Level2)
1684 {
1685 uint8_t configId = CONFIG_ID_INVALID;
1686 struct UsbDev dev = {1, 255};
1687 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1688 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1689 ASSERT_NE(ret, 0);
1690 }
1691
1692 /**
1693 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1400
1694 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor006
1695 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(1, 255)
1696 * configId = 255.
1697 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor006, TestSize.Level2)1698 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor006, TestSize.Level2)
1699 {
1700 uint8_t configId = 255;
1701 struct UsbDev dev = {1, 255};
1702 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1703 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1704 ASSERT_NE(ret, 0);
1705 }
1706
1707 /**
1708 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1500
1709 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor007
1710 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 0)
1711 * configId = 1.
1712 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor007, TestSize.Level2)1713 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor007, TestSize.Level2)
1714 {
1715 uint8_t configId = 1;
1716 struct UsbDev dev = {255, 0};
1717 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1718 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1719 ASSERT_NE(ret, 0);
1720 }
1721
1722 /**
1723 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1600
1724 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor008
1725 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 0)
1726 * configId = 255.
1727 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor008, TestSize.Level2)1728 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor008, TestSize.Level2)
1729 {
1730 uint8_t configId = 255;
1731 struct UsbDev dev = {255, 0};
1732 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1733 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1734 ASSERT_NE(ret, 0);
1735 }
1736
1737 /**
1738 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1700
1739 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor009
1740 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 1)
1741 * configId = 0.
1742 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor009, TestSize.Level2)1743 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor009, TestSize.Level2)
1744 {
1745 uint8_t configId = 0;
1746 struct UsbDev dev = {255, 1};
1747 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1748 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1749 ASSERT_NE(ret, 0);
1750 }
1751
1752 /**
1753 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1800
1754 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor010
1755 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 1)
1756 * configId = 1.
1757 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor010, TestSize.Level2)1758 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor010, TestSize.Level2)
1759 {
1760 uint8_t configId = 1;
1761 struct UsbDev dev = {255, 1};
1762 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1763 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1764 ASSERT_NE(ret, 0);
1765 }
1766
1767 /**
1768 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_1900
1769 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor011
1770 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 1)
1771 * configId = CONFIG_ID_INVALID.
1772 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor011, TestSize.Level2)1773 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor011, TestSize.Level2)
1774 {
1775 uint8_t configId = CONFIG_ID_INVALID;
1776 struct UsbDev dev = {255, 1};
1777 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1778 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1779 ASSERT_NE(ret, 0);
1780 }
1781
1782 /**
1783 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_2000
1784 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor012
1785 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 1)
1786 * configId = 255.
1787 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor012, TestSize.Level2)1788 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor012, TestSize.Level2)
1789 {
1790 uint8_t configId = 255;
1791 struct UsbDev dev = {255, 1};
1792 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1793 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1794 ASSERT_NE(ret, 0);
1795 }
1796
1797 /**
1798 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_2100
1799 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor013
1800 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 255)
1801 * configId = 1.
1802 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor013, TestSize.Level2)1803 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor013, TestSize.Level2)
1804 {
1805 uint8_t configId = 1;
1806 struct UsbDev dev = {255, 255};
1807 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1808 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1809 ASSERT_NE(ret, 0);
1810 }
1811
1812 /**
1813 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfigDescriptor_2200
1814 * @tc.name: testHdiUsbRequestTestGetConfigDescriptor014
1815 * @tc.desc: Obtains the configuration descriptor of a USB device based on the specified config ID. dev(255, 255)
1816 * configId = 255.
1817 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor014, TestSize.Level2)1818 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfigDescriptor014, TestSize.Level2)
1819 {
1820 uint8_t configId = 255;
1821 struct UsbDev dev = {255, 255};
1822 std::vector<uint8_t> devData(MAX_BUFFER_LENGTH);
1823 auto ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData);
1824 ASSERT_NE(ret, 0);
1825 }
1826
1827 /**
1828 * @tc.number: SUB_Driver_Usb_RequestTest_GetRawDescriptor_0400
1829 * @tc.name: testHdiUsbRequestTestGetRawDescriptor001
1830 * @tc.desc: Obtains the raw descriptor. dev(1, 255).
1831 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetRawDescriptor001, TestSize.Level2)1832 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetRawDescriptor001, TestSize.Level2)
1833 {
1834 struct UsbDev dev = {1, 255};
1835 std::vector<uint8_t> rawData;
1836 auto ret = g_usbInterface->GetRawDescriptor(dev, rawData);
1837 ASSERT_NE(ret, 0);
1838 }
1839
1840 /**
1841 * @tc.number: SUB_Driver_Usb_RequestTest_GetRawDescriptor_0500
1842 * @tc.name: testHdiUsbRequestTestGetRawDescriptor002
1843 * @tc.desc: Obtains the raw descriptor. dev(255, 1).
1844 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetRawDescriptor002, TestSize.Level2)1845 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetRawDescriptor002, TestSize.Level2)
1846 {
1847 struct UsbDev dev = {255, 1};
1848 std::vector<uint8_t> rawData;
1849 auto ret = g_usbInterface->GetRawDescriptor(dev, rawData);
1850 ASSERT_NE(ret, 0);
1851 }
1852
1853 /**
1854 * @tc.number: SUB_Driver_Usb_RequestTest_GetRawDescriptor_0600
1855 * @tc.name: testHdiUsbRequestTestGetRawDescriptor003
1856 * @tc.desc: Obtains the raw descriptor. dev(255, 255).
1857 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetRawDescriptor003, TestSize.Level2)1858 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetRawDescriptor003, TestSize.Level2)
1859 {
1860 struct UsbDev dev = {255, 255};
1861 std::vector<uint8_t> rawData;
1862 auto ret = g_usbInterface->GetRawDescriptor(dev, rawData);
1863 ASSERT_NE(ret, 0);
1864 }
1865
1866 /**
1867 * @tc.number: SUB_Driver_Usb_RequestTest_GetFileDescriptor_0500
1868 * @tc.name: testHdiUsbRequestTestGetFileDescriptor001
1869 * @tc.desc: Obtains the file descriptor. dev(1, 255).
1870 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetFileDescriptor001, TestSize.Level2)1871 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetFileDescriptor001, TestSize.Level2)
1872 {
1873 struct UsbDev dev = {1, 255};
1874 int32_t fd = MAX_BUFFER_LENGTH;
1875 auto ret = g_usbInterface->GetFileDescriptor(dev, fd);
1876 ASSERT_NE(ret, 0);
1877 }
1878
1879 /**
1880 * @tc.number: SUB_Driver_Usb_RequestTest_GetFileDescriptor_0600
1881 * @tc.name: testHdiUsbRequestTestGetFileDescriptor002
1882 * @tc.desc: Obtains the file descriptor. dev(255, 1).
1883 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetFileDescriptor002, TestSize.Level2)1884 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetFileDescriptor002, TestSize.Level2)
1885 {
1886 struct UsbDev dev = {255, 1};
1887 int32_t fd = MAX_BUFFER_LENGTH;
1888 auto ret = g_usbInterface->GetFileDescriptor(dev, fd);
1889 ASSERT_NE(ret, 0);
1890 }
1891
1892 /**
1893 * @tc.number: SUB_Driver_Usb_RequestTest_GetFileDescriptor_0700
1894 * @tc.name: testHdiUsbRequestTestGetFileDescriptor003
1895 * @tc.desc: Obtains the file descriptor. dev(255, 255).
1896 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetFileDescriptor003, TestSize.Level2)1897 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetFileDescriptor003, TestSize.Level2)
1898 {
1899 struct UsbDev dev = {255, 255};
1900 int32_t fd = MAX_BUFFER_LENGTH;
1901 auto ret = g_usbInterface->GetFileDescriptor(dev, fd);
1902 ASSERT_NE(ret, 0);
1903 }
1904
1905 /**
1906 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfig_0500
1907 * @tc.name: testHdiUsbRequestTestGetConfig001
1908 * @tc.desc: Obtains the configuration information of a USB device. dev(1, 255).
1909 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfig001, TestSize.Level2)1910 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfig001, TestSize.Level2)
1911 {
1912 uint8_t configIndex = INDEX_1;
1913 struct UsbDev dev = {1, 255};
1914 auto ret = g_usbInterface->GetConfig(dev, configIndex);
1915 ASSERT_NE(ret, 0);
1916 }
1917
1918 /**
1919 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfig_0600
1920 * @tc.name: testHdiUsbRequestTestGetConfig002
1921 * @tc.desc: Obtains the configuration information of a USB device. dev(255, 1).
1922 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfig002, TestSize.Level2)1923 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfig002, TestSize.Level2)
1924 {
1925 uint8_t configIndex = INDEX_1;
1926 struct UsbDev dev = {255, 1};
1927 auto ret = g_usbInterface->GetConfig(dev, configIndex);
1928 ASSERT_NE(ret, 0);
1929 }
1930
1931 /**
1932 * @tc.number: SUB_Driver_Usb_RequestTest_GetConfig_0700
1933 * @tc.name: testHdiUsbRequestTestGetConfig003
1934 * @tc.desc: Obtains the configuration information of a USB device. dev(255, 255).
1935 */
HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfig003, TestSize.Level2)1936 HWTEST_F(UsbdRequestTestAdditional, testHdiUsbRequestTestGetConfig003, TestSize.Level2)
1937 {
1938 uint8_t configIndex = INDEX_1;
1939 struct UsbDev dev = {255, 255};
1940 auto ret = g_usbInterface->GetConfig(dev, configIndex);
1941 ASSERT_NE(ret, 0);
1942 }
1943
1944 } // namespace
1945