!475 新接口测试用例修i该

Merge pull request !475 from hechaofan/master
This commit is contained in:
openharmony_ci 2024-06-16 05:14:26 +00:00 committed by Gitee
commit 6e5a1ab075
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -226,7 +226,7 @@ HWTEST_F(UsbManageInterfaceTest, ManageInterfaceStorage002, TestSize.Level1)
EXPECT_TRUE(ret == 0);
InterfaceType interfaceType = InterfaceType::TYPE_HID;
if (devi.size() > 0) {
for (auto iter = typeMapInfo.begin(); iter != typeMapInfo.end(); iter ++) {
for (auto iter = g_typeMap.begin(); iter != g_typeMap.end(); iter ++) {
if (devi.at(0).GetClass() == iter->second[0] &&
(devi.at(0).GetSubclass() == iter->second[1] || iter->second[1] == -1) &&
(devi.at(0).GetProtocol() == iter->second[2] || iter->second[2] == -1)) {
@ -273,20 +273,12 @@ HWTEST_F(UsbManageInterfaceTest, ManageInterfaceType001, TestSize.Level1)
auto ret = client.GetDevices(devi);
EXPECT_TRUE(ret == 0);
vector<UsbDeviceType> disableType;
if (devi.size() > 0) {
for (auto iter = g_typeMap.begin(); iter != g_typeMap.end(); iter ++) {
if (devi.at(0).GetClass() == iter->second[0] &&
(devi.at(0).GetSubclass() == iter->second[1] || iter->second[1] == -1) &&
(devi.at(0).GetProtocol() == iter->second[2] || iter->second[2] == -1)) {
UsbDeviceType usbDeviceType;
usbDeviceType.baseClass = devi.at(0).GetClass();
usbDeviceType.subClass = devi.at(0).GetSubclass();
usbDeviceType.protocal = devi.at(0).GetProtocol();
usbDeviceType.isDevicetype = 0;
disableType.emplace_back(usbDeviceType);
}
}
}
UsbDeviceType usbDeviceType;
usbDeviceType.baseClass = 3;
usbDeviceType.subClass = 1;
usbDeviceType.protocal = 2;
usbDeviceType.isDeviceType = 0;
disableType.emplace_back(usbDeviceType);
ret = client.ManageInterfaceType(disableType, true);
ASSERT_EQ(ret, 0);
USB_HILOGI(MODULE_USB_SERVICE, "Case End : ManageInterfaceType001 : ManageInterfaceType");
@ -300,20 +292,12 @@ HWTEST_F(UsbManageInterfaceTest, ManageInterfaceType002, TestSize.Level1)
auto ret = client.GetDevices(devi);
EXPECT_TRUE(ret == 0);
vector<UsbDeviceType> disableType;
if (devi.size() > 0) {
for (auto iter = g_typeMap.begin(); iter != g_typeMap.end(); iter ++) {
if (devi.at(0).GetClass() == iter->second[0] &&
(devi.at(0).GetSubclass() == iter->second[1] || iter->second[1] == -1) &&
(devi.at(0).GetProtocol() == iter->second[2] || iter->second[2] == -1)) {
UsbDeviceType usbDeviceType;
usbDeviceType.baseClass = devi.at(0).GetClass();
usbDeviceType.subClass = devi.at(0).GetSubclass();
usbDeviceType.protocal = devi.at(0).GetProtocol();
usbDeviceType.isDevicetype = 0;
disableType.emplace_back(usbDeviceType);
}
}
}
UsbDeviceType usbDeviceType;
usbDeviceType.baseClass = 3;
usbDeviceType.subClass = 1;
usbDeviceType.protocal = 2;
usbDeviceType.isDeviceType = 0;
disableType.emplace_back(usbDeviceType);
ret = client.ManageInterfaceType(disableType, false);
ASSERT_EQ(ret, 0);
USB_HILOGI(MODULE_USB_SERVICE, "Case End : ManageInterfaceType002 : ManageInterfaceType");