|
|
@ -77,7 +77,7 @@ static int32_t InitAshmemOne(sptr<Ashmem> &asmptr, int32_t asmSize, uint8_t rflg
|
|
|
|
|
|
|
|
|
|
|
|
void UsbBulkcallbackTest::SetUpTestCase(void)
|
|
|
|
void UsbBulkcallbackTest::SetUpTestCase(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
UsbCommonTest::SetTestCaseHapApply();
|
|
|
|
UsbCommonTest::GrantPermissionSysNative();
|
|
|
|
auto &srvClient = UsbSrvClient::GetInstance();
|
|
|
|
auto &srvClient = UsbSrvClient::GetInstance();
|
|
|
|
auto ret = srvClient.SetPortRole(1, 1, 1);
|
|
|
|
auto ret = srvClient.SetPortRole(1, 1, 1);
|
|
|
|
sleep(SLEEP_TIME);
|
|
|
|
sleep(SLEEP_TIME);
|
|
|
@ -125,8 +125,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback001, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback001 %{public}d OpenDevice=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback001 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().front();
|
|
|
|
USBEndpoint point = interface.GetEndpoints().front();
|
|
|
@ -145,8 +145,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback001, TestSize.Level1)
|
|
|
|
__LINE__, ret);
|
|
|
|
__LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback001 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback001 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback001 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback001 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -173,8 +173,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback002, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback002 %{public}d OpenDevice=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback002 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
@ -193,8 +193,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback002, TestSize.Level1)
|
|
|
|
__LINE__, ret);
|
|
|
|
__LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback002 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback002 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback002 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback002 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -221,8 +221,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback003, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback003 %{public}d OpenDevice=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback003 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
@ -243,8 +243,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback003, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback003 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback003 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback003 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback003 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -271,8 +271,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback004, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback004 %{public}d OpenDevice=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback004 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
@ -293,8 +293,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback004, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback004 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback004 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback004 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback004 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -321,8 +321,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback005, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback005 %{public}d OpenDevice=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback005 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(0);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(0);
|
|
|
@ -343,8 +343,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback005, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback005 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback005 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback005 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback005 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -371,8 +371,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback006, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback006 %{public}d OpenDevice=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback006 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(0);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(0);
|
|
|
@ -393,8 +393,8 @@ HWTEST_F(UsbBulkcallbackTest, RegBulkCallback006, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback006 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::RegBulkCallback006 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback006 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : RegBulkCallback006 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -429,19 +429,19 @@ HWTEST_F(UsbBulkcallbackTest, BulkRead001, TestSize.Level1)
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d point=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d point=%{public}d", __LINE__,
|
|
|
|
point.GetInterfaceId());
|
|
|
|
point.GetInterfaceId());
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d ClaimInterface=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d ClaimInterface=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d RegBulkCallback=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d UnRegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d UnRegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead001 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
@ -482,19 +482,19 @@ HWTEST_F(UsbBulkcallbackTest, BulkRead002, TestSize.Level1)
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d point=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d point=%{public}d", __LINE__,
|
|
|
|
point.GetInterfaceId());
|
|
|
|
point.GetInterfaceId());
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d ClaimInterface=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d ClaimInterface=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d RegBulkCallback=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d UnRegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d UnRegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead002 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
@ -535,12 +535,12 @@ HWTEST_F(UsbBulkcallbackTest, BulkRead003, TestSize.Level1)
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d point=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d point=%{public}d", __LINE__,
|
|
|
|
point.GetInterfaceId());
|
|
|
|
point.GetInterfaceId());
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d ClaimInterface=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d ClaimInterface=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d RegBulkCallback=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
pipe.SetBusNum(BUFFER_SIZE);
|
|
|
|
pipe.SetBusNum(BUFFER_SIZE);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
@ -548,8 +548,8 @@ HWTEST_F(UsbBulkcallbackTest, BulkRead003, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d UnRegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d UnRegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead003 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
@ -590,12 +590,12 @@ HWTEST_F(UsbBulkcallbackTest, BulkRead004, TestSize.Level1)
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d point=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d point=%{public}d", __LINE__,
|
|
|
|
point.GetInterfaceId());
|
|
|
|
point.GetInterfaceId());
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d ClaimInterface=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d ClaimInterface=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d RegBulkCallback=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
pipe.SetDevAddr(BUFFER_SIZE);
|
|
|
|
pipe.SetDevAddr(BUFFER_SIZE);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
@ -603,8 +603,8 @@ HWTEST_F(UsbBulkcallbackTest, BulkRead004, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d UnRegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d UnRegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkRead004 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
@ -638,31 +638,29 @@ HWTEST_F(UsbBulkcallbackTest, BulkWrite001, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d OpenDevice=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
ret);
|
|
|
|
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d point=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d point=%{public}d", __LINE__,
|
|
|
|
point.GetInterfaceId());
|
|
|
|
point.GetInterfaceId());
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d ClaimInterface=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d ClaimInterface=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d RegBulkCallback=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkWrite(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkWrite(pipe, point, ashmem);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d BulkWrite=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d BulkWrite=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d UnRegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d UnRegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d BulkCancel=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
ret);
|
|
|
|
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite001 %{public}d close=%{public}d", __LINE__, close);
|
|
|
@ -693,20 +691,19 @@ HWTEST_F(UsbBulkcallbackTest, BulkWrite002, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d OpenDevice=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
ret);
|
|
|
|
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d point=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d point=%{public}d", __LINE__,
|
|
|
|
point.GetInterfaceId());
|
|
|
|
point.GetInterfaceId());
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d ClaimInterface=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d ClaimInterface=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d RegBulkCallback=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
pipe.SetBusNum(BUFFER_SIZE);
|
|
|
|
pipe.SetBusNum(BUFFER_SIZE);
|
|
|
|
ret = UsbSrvClient.BulkWrite(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkWrite(pipe, point, ashmem);
|
|
|
@ -714,12 +711,11 @@ HWTEST_F(UsbBulkcallbackTest, BulkWrite002, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d UnRegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d UnRegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d BulkCancel=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
ret);
|
|
|
|
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite002 %{public}d close=%{public}d", __LINE__, close);
|
|
|
@ -750,20 +746,19 @@ HWTEST_F(UsbBulkcallbackTest, BulkWrite003, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d OpenDevice=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
ret);
|
|
|
|
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().at(1);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d point=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d point=%{public}d", __LINE__,
|
|
|
|
point.GetInterfaceId());
|
|
|
|
point.GetInterfaceId());
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d ClaimInterface=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d ClaimInterface=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d RegBulkCallback=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
pipe.SetDevAddr(BUFFER_SIZE);
|
|
|
|
pipe.SetDevAddr(BUFFER_SIZE);
|
|
|
|
ret = UsbSrvClient.BulkWrite(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkWrite(pipe, point, ashmem);
|
|
|
@ -771,12 +766,11 @@ HWTEST_F(UsbBulkcallbackTest, BulkWrite003, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
ret = UsbSrvClient.UnRegBulkCallback(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d UnRegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d UnRegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d BulkCancel=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
ret);
|
|
|
|
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkWrite003 %{public}d close=%{public}d", __LINE__, close);
|
|
|
@ -812,8 +806,8 @@ HWTEST_F(UsbBulkcallbackTest, BulkCancel001, TestSize.Level1)
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d RegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
@ -824,13 +818,13 @@ HWTEST_F(UsbBulkcallbackTest, BulkCancel001, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
pipe.SetBusNum(BUFFER_SIZE);
|
|
|
|
pipe.SetBusNum(BUFFER_SIZE);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d BulkCancel=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkCancel=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel001 %{public}d close=%{public}d", __LINE__, close);
|
|
|
@ -861,16 +855,16 @@ HWTEST_F(UsbBulkcallbackTest, BulkCancel002, TestSize.Level1)
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbDevice device = devi.front();
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
UsbSrvClient.RequestRight(device.GetName());
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
ret = UsbSrvClient.OpenDevice(device, pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d OpenDevice=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d OpenDevice=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
UsbInterface interface = device.GetConfigs().front().GetInterfaces().at(1);
|
|
|
|
USBEndpoint point = interface.GetEndpoints().front();
|
|
|
|
USBEndpoint point = interface.GetEndpoints().front();
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
ret = UsbSrvClient.ClaimInterface(pipe, interface, true);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
ret = UsbSrvClient.RegBulkCallback(pipe, point, cb);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d RegBulkCallback=%{public}d",
|
|
|
|
USB_HILOGI(
|
|
|
|
__LINE__, ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d RegBulkCallback=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
ret = UsbSrvClient.BulkRead(pipe, point, ashmem);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkRead=%{public}d", __LINE__, ret);
|
|
|
@ -881,13 +875,13 @@ HWTEST_F(UsbBulkcallbackTest, BulkCancel002, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
pipe.SetDevAddr(BUFFER_SIZE);
|
|
|
|
pipe.SetDevAddr(BUFFER_SIZE);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkCancel=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
ret = UsbSrvClient.BulkCancel(pipe, point);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkCancel=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
ret);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d BulkCancel=%{public}d", __LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::BulkCancel002 %{public}d close=%{public}d", __LINE__, close);
|
|
|
@ -935,8 +929,8 @@ HWTEST_F(UsbBulkcallbackTest, UnRegBulkCallback001, TestSize.Level1)
|
|
|
|
__LINE__, ret);
|
|
|
|
__LINE__, ret);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
EXPECT_TRUE(ret == 0);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::UnRegBulkCallback001 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::UnRegBulkCallback001 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : UnRegBulkCallback001 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : UnRegBulkCallback001 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -981,8 +975,8 @@ HWTEST_F(UsbBulkcallbackTest, UnRegBulkCallback002, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
pipe.SetBusNum(device.GetBusNum());
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::UnRegBulkCallback002 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::UnRegBulkCallback002 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : UnRegBulkCallback002 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : UnRegBulkCallback002 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1029,11 +1023,11 @@ HWTEST_F(UsbBulkcallbackTest, UnRegBulkCallback003, TestSize.Level1)
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
EXPECT_TRUE(ret != 0);
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
pipe.SetDevAddr(device.GetDevAddr());
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
bool close = UsbSrvClient.Close(pipe);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "UsbBulkcallbackTest::UnRegBulkCallback003 %{public}d close=%{public}d", __LINE__,
|
|
|
|
USB_HILOGI(
|
|
|
|
close);
|
|
|
|
MODULE_USB_SERVICE, "UsbBulkcallbackTest::UnRegBulkCallback003 %{public}d close=%{public}d", __LINE__, close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
EXPECT_TRUE(close);
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : UnRegBulkCallback003 : BulkTransfer");
|
|
|
|
USB_HILOGI(MODULE_USB_SERVICE, "Case End : UnRegBulkCallback003 : BulkTransfer");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // BulkCallback
|
|
|
|
} // namespace BulkCallback
|
|
|
|
} // USB
|
|
|
|
} // namespace USB
|
|
|
|
} // OHOS
|
|
|
|
} // namespace OHOS
|
|
|
|