19762338dSopenharmony_ci/* 29762338dSopenharmony_ci * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 39762338dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 49762338dSopenharmony_ci * you may not use this file except in compliance with the License. 59762338dSopenharmony_ci * You may obtain a copy of the License at 69762338dSopenharmony_ci * 79762338dSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 89762338dSopenharmony_ci * 99762338dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 109762338dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 119762338dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 129762338dSopenharmony_ci * See the License for the specific language governing permissions and 139762338dSopenharmony_ci * limitations under the License. 149762338dSopenharmony_ci */ 159762338dSopenharmony_ci#include <iostream> 169762338dSopenharmony_ci#include <string> 179762338dSopenharmony_ci#include <vector> 189762338dSopenharmony_ci 199762338dSopenharmony_ci#include "HdfUsbdBenchmarkRequestTest.h" 209762338dSopenharmony_ci#include "hdf_log.h" 219762338dSopenharmony_ci#include "v1_1/iusb_interface.h" 229762338dSopenharmony_ci 239762338dSopenharmony_ciusing namespace benchmark::internal; 249762338dSopenharmony_ciusing namespace OHOS; 259762338dSopenharmony_ciusing namespace OHOS::USB; 269762338dSopenharmony_ciusing namespace std; 279762338dSopenharmony_ciusing namespace OHOS::HDI::Usb::V1_0; 289762338dSopenharmony_ciusing namespace OHOS::HDI::Usb::V1_1; 299762338dSopenharmony_ci 309762338dSopenharmony_ciconst int SLEEP_TIME = 3; 319762338dSopenharmony_ciconst uint8_t INDEX_0 = 0; 329762338dSopenharmony_ciconst uint8_t INDEX_1 = 1; 339762338dSopenharmony_ciconst uint8_t CONFIG_ID_0 = 0; 349762338dSopenharmony_ciconst uint32_t MAX_BUFFER_LENGTH = 255; 359762338dSopenharmony_ciconst int TAG_NUM_10 = 10; 369762338dSopenharmony_ciconst uint8_t INTERFACEID_OK = 1; 379762338dSopenharmony_ci// data interface have 2 point : 1->bulk_out 2->bulk_in 389762338dSopenharmony_ciconst uint8_t POINTID_DIR_IN = USB_ENDPOINT_DIR_IN | 2; 399762338dSopenharmony_ciconst uint32_t TIME_WAIT = 10000; 409762338dSopenharmony_ciconstexpr int32_t ITERATION_FREQUENCY = 100; 419762338dSopenharmony_ciconstexpr int32_t REPETITION_FREQUENCY = 3; 429762338dSopenharmony_ciUsbDev HdfUsbdBenchmarkRequestTest::dev_ = { 0, 0 }; 439762338dSopenharmony_ci 449762338dSopenharmony_cinamespace { 459762338dSopenharmony_cisptr<OHOS::HDI::Usb::V1_1::IUsbInterface> g_usbInterface = nullptr; 469762338dSopenharmony_ci 479762338dSopenharmony_ciint32_t SwitchErrCode(int32_t ret) 489762338dSopenharmony_ci{ 499762338dSopenharmony_ci return ret == HDF_ERR_NOT_SUPPORT ? HDF_SUCCESS : ret; 509762338dSopenharmony_ci} 519762338dSopenharmony_ci 529762338dSopenharmony_civoid HdfUsbdBenchmarkRequestTest::SetUp(const ::benchmark::State& state) 539762338dSopenharmony_ci{ 549762338dSopenharmony_ci g_usbInterface = OHOS::HDI::Usb::V1_1::IUsbInterface::Get(); 559762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 569762338dSopenharmony_ci auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); 579762338dSopenharmony_ci sleep(SLEEP_TIME); 589762338dSopenharmony_ci ret = SwitchErrCode(ret); 599762338dSopenharmony_ci ASSERT_EQ(0, ret); 609762338dSopenharmony_ci} 619762338dSopenharmony_ci 629762338dSopenharmony_civoid HdfUsbdBenchmarkRequestTest::TearDown(const ::benchmark::State& state){} 639762338dSopenharmony_ci 649762338dSopenharmony_civoid HdfUsbdBenchmarkRequestTest::InitPara(const sptr<UsbSubscriberTest> &subscriber) 659762338dSopenharmony_ci{ 669762338dSopenharmony_ci auto ret = g_usbInterface->BindUsbdSubscriber(subscriber); 679762338dSopenharmony_ci ASSERT_EQ(0, ret); 689762338dSopenharmony_ci dev_ = {subscriber->busNum_, subscriber->devAddr_}; 699762338dSopenharmony_ci ret = g_usbInterface->OpenDevice(dev_); 709762338dSopenharmony_ci ASSERT_EQ(0, ret); 719762338dSopenharmony_ci} 729762338dSopenharmony_ci 739762338dSopenharmony_civoid HdfUsbdBenchmarkRequestTest::ReleasePara(const sptr<UsbSubscriberTest> &subscriber) 749762338dSopenharmony_ci{ 759762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 769762338dSopenharmony_ci auto ret = g_usbInterface->UnbindUsbdSubscriber(subscriber); 779762338dSopenharmony_ci EXPECT_EQ(0, ret); 789762338dSopenharmony_ci ret = g_usbInterface->CloseDevice(dev_); 799762338dSopenharmony_ci ASSERT_EQ(0, ret); 809762338dSopenharmony_ci} 819762338dSopenharmony_ci 829762338dSopenharmony_ci/** 839762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0100 849762338dSopenharmony_ci * @tc.desc: Test functions to SetConfig benchmark test 859762338dSopenharmony_ci * @tc.desc: int32_t SetConfig(const UsbDev &dev, uint8_t configIndex); 869762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 879762338dSopenharmony_ci * @tc.type: FUNC 889762338dSopenharmony_ci */ 899762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0100) 909762338dSopenharmony_ci(benchmark::State& st) 919762338dSopenharmony_ci{ 929762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 939762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 949762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 959762338dSopenharmony_ci uint8_t configIndex = INDEX_1; 969762338dSopenharmony_ci InitPara(subscriber); 979762338dSopenharmony_ci struct UsbDev dev = dev_; 989762338dSopenharmony_ci auto ret = -1; 999762338dSopenharmony_ci for (auto _ : st) { 1009762338dSopenharmony_ci ret = g_usbInterface->SetConfig(dev, configIndex); 1019762338dSopenharmony_ci } 1029762338dSopenharmony_ci ASSERT_EQ(0, ret); 1039762338dSopenharmony_ci ReleasePara(subscriber); 1049762338dSopenharmony_ci} 1059762338dSopenharmony_ci 1069762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0100) 1079762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 1089762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 1099762338dSopenharmony_ci ->ReportAggregatesOnly(); 1109762338dSopenharmony_ci 1119762338dSopenharmony_ci/** 1129762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0200 1139762338dSopenharmony_ci * @tc.desc: Test functions to GetConfig benchmark test 1149762338dSopenharmony_ci * @tc.desc: int32_t GetConfig(const UsbDev &dev, uint8_t &configIndex); 1159762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 1169762338dSopenharmony_ci * @tc.type: FUNC 1179762338dSopenharmony_ci */ 1189762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0200) 1199762338dSopenharmony_ci(benchmark::State& st) 1209762338dSopenharmony_ci{ 1219762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 1229762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 1239762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 1249762338dSopenharmony_ci uint8_t configIndex = INDEX_1; 1259762338dSopenharmony_ci InitPara(subscriber); 1269762338dSopenharmony_ci struct UsbDev dev = dev_; 1279762338dSopenharmony_ci auto ret = -1; 1289762338dSopenharmony_ci for (auto _ : st) { 1299762338dSopenharmony_ci ret = g_usbInterface->GetConfig(dev, configIndex); 1309762338dSopenharmony_ci } 1319762338dSopenharmony_ci ASSERT_EQ(0, ret); 1329762338dSopenharmony_ci ReleasePara(subscriber); 1339762338dSopenharmony_ci} 1349762338dSopenharmony_ci 1359762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0200) 1369762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 1379762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 1389762338dSopenharmony_ci ->ReportAggregatesOnly(); 1399762338dSopenharmony_ci 1409762338dSopenharmony_ci/** 1419762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0300 1429762338dSopenharmony_ci * @tc.desc: Test functions to ClaimInterface benchmark test 1439762338dSopenharmony_ci * @tc.desc: int32_t ClaimInterface(const UsbDev &dev, uint8_t interfaceId); 1449762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 1459762338dSopenharmony_ci * @tc.type: FUNC 1469762338dSopenharmony_ci */ 1479762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0300) 1489762338dSopenharmony_ci(benchmark::State& st) 1499762338dSopenharmony_ci{ 1509762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 1519762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 1529762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 1539762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 1549762338dSopenharmony_ci InitPara(subscriber); 1559762338dSopenharmony_ci struct UsbDev dev = dev_; 1569762338dSopenharmony_ci auto ret = -1; 1579762338dSopenharmony_ci for (auto _ : st) { 1589762338dSopenharmony_ci ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1); 1599762338dSopenharmony_ci } 1609762338dSopenharmony_ci ASSERT_EQ(0, ret); 1619762338dSopenharmony_ci ReleasePara(subscriber); 1629762338dSopenharmony_ci} 1639762338dSopenharmony_ci 1649762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0300) 1659762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 1669762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 1679762338dSopenharmony_ci ->ReportAggregatesOnly(); 1689762338dSopenharmony_ci 1699762338dSopenharmony_ci/** 1709762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0400 1719762338dSopenharmony_ci * @tc.desc: Test functions to SetInterface benchmark test 1729762338dSopenharmony_ci * @tc.desc: int32_t SetInterface(const UsbDev &dev, uint8_t interfaceId, uint8_t altIndex); 1739762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 1749762338dSopenharmony_ci * @tc.type: FUNC 1759762338dSopenharmony_ci */ 1769762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0400) 1779762338dSopenharmony_ci(benchmark::State& st) 1789762338dSopenharmony_ci{ 1799762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 1809762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 1819762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 1829762338dSopenharmony_ci InitPara(subscriber); 1839762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 1849762338dSopenharmony_ci uint8_t altIndex = INDEX_0; 1859762338dSopenharmony_ci struct UsbDev dev = dev_; 1869762338dSopenharmony_ci auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1); 1879762338dSopenharmony_ci ASSERT_EQ(0, ret); 1889762338dSopenharmony_ci for (auto _ : st) { 1899762338dSopenharmony_ci ret = g_usbInterface->SetInterface(dev, interfaceId, altIndex); 1909762338dSopenharmony_ci } 1919762338dSopenharmony_ci ASSERT_EQ(0, ret); 1929762338dSopenharmony_ci ReleasePara(subscriber); 1939762338dSopenharmony_ci} 1949762338dSopenharmony_ci 1959762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0400) 1969762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 1979762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 1989762338dSopenharmony_ci ->ReportAggregatesOnly(); 1999762338dSopenharmony_ci 2009762338dSopenharmony_ci/** 2019762338dSopenharmony_ci * @tc.name: SUB_USB_DeviceManager_HDI_Performance_0300 2029762338dSopenharmony_ci * @tc.desc: Test functions to GetDeviceDescriptor benchmark test 2039762338dSopenharmony_ci * @tc.desc: int32_t GetDeviceDescriptor(const UsbDev &dev, std::vector<uint8_t> &descriptor); 2049762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 2059762338dSopenharmony_ci * @tc.type: FUNC 2069762338dSopenharmony_ci */ 2079762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_DeviceManager_HDI_Performance_0300) 2089762338dSopenharmony_ci(benchmark::State& st) 2099762338dSopenharmony_ci{ 2109762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 2119762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 2129762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 2139762338dSopenharmony_ci InitPara(subscriber); 2149762338dSopenharmony_ci struct UsbDev dev = dev_; 2159762338dSopenharmony_ci std::vector<uint8_t> devData(MAX_BUFFER_LENGTH); 2169762338dSopenharmony_ci auto ret = -1; 2179762338dSopenharmony_ci for (auto _ : st) { 2189762338dSopenharmony_ci ret = g_usbInterface->GetDeviceDescriptor(dev, devData); 2199762338dSopenharmony_ci } 2209762338dSopenharmony_ci ASSERT_EQ(0, ret); 2219762338dSopenharmony_ci ReleasePara(subscriber); 2229762338dSopenharmony_ci} 2239762338dSopenharmony_ci 2249762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_DeviceManager_HDI_Performance_0300) 2259762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 2269762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 2279762338dSopenharmony_ci ->ReportAggregatesOnly(); 2289762338dSopenharmony_ci 2299762338dSopenharmony_ci/** 2309762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0500 2319762338dSopenharmony_ci * @tc.desc: Test functions to GetStringDescriptor benchmark test 2329762338dSopenharmony_ci * @tc.desc: int32_t GetStringDescriptor(const UsbDev &dev, uint8_t descId, std::vector<uint8_t> &descriptor); 2339762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 2349762338dSopenharmony_ci * @tc.type: FUNC 2359762338dSopenharmony_ci */ 2369762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0500) 2379762338dSopenharmony_ci(benchmark::State& st) 2389762338dSopenharmony_ci{ 2399762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 2409762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 2419762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 2429762338dSopenharmony_ci InitPara(subscriber); 2439762338dSopenharmony_ci uint8_t stringId = 0; 2449762338dSopenharmony_ci struct UsbDev dev = dev_; 2459762338dSopenharmony_ci std::vector<uint8_t> devData(MAX_BUFFER_LENGTH); 2469762338dSopenharmony_ci auto ret = -1; 2479762338dSopenharmony_ci for (auto _ : st) { 2489762338dSopenharmony_ci ret = g_usbInterface->GetStringDescriptor(dev, stringId, devData); 2499762338dSopenharmony_ci } 2509762338dSopenharmony_ci ASSERT_EQ(0, ret); 2519762338dSopenharmony_ci ReleasePara(subscriber); 2529762338dSopenharmony_ci} 2539762338dSopenharmony_ci 2549762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0500) 2559762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 2569762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 2579762338dSopenharmony_ci ->ReportAggregatesOnly(); 2589762338dSopenharmony_ci 2599762338dSopenharmony_ci/** 2609762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0600 2619762338dSopenharmony_ci * @tc.desc: Test functions to GetConfigDescriptor benchmark test 2629762338dSopenharmony_ci * @tc.desc: int32_t GetConfigDescriptor(const UsbDev &dev, uint8_t descId, std::vector<uint8_t> &descriptor); 2639762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 2649762338dSopenharmony_ci * @tc.type: FUNC 2659762338dSopenharmony_ci */ 2669762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0600) 2679762338dSopenharmony_ci(benchmark::State& st) 2689762338dSopenharmony_ci{ 2699762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 2709762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 2719762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 2729762338dSopenharmony_ci InitPara(subscriber); 2739762338dSopenharmony_ci uint8_t configId = CONFIG_ID_0; 2749762338dSopenharmony_ci struct UsbDev dev = dev_; 2759762338dSopenharmony_ci std::vector<uint8_t> devData(MAX_BUFFER_LENGTH); 2769762338dSopenharmony_ci auto ret = -1; 2779762338dSopenharmony_ci for (auto _ : st) { 2789762338dSopenharmony_ci ret = g_usbInterface->GetConfigDescriptor(dev, configId, devData); 2799762338dSopenharmony_ci } 2809762338dSopenharmony_ci ASSERT_EQ(0, ret); 2819762338dSopenharmony_ci ReleasePara(subscriber); 2829762338dSopenharmony_ci} 2839762338dSopenharmony_ci 2849762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0600) 2859762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 2869762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 2879762338dSopenharmony_ci ->ReportAggregatesOnly(); 2889762338dSopenharmony_ci 2899762338dSopenharmony_ci/** 2909762338dSopenharmony_ci * @tc.name: SUB_USB_DeviceManager_HDI_Performance_0400 2919762338dSopenharmony_ci * @tc.desc: Test functions to GetRawDescriptor benchmark test 2929762338dSopenharmony_ci * @tc.desc: int32_t GetRawDescriptor(const UsbDev &dev, std::vector<uint8_t> &descriptor); 2939762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 2949762338dSopenharmony_ci * @tc.type: FUNC 2959762338dSopenharmony_ci */ 2969762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_DeviceManager_HDI_Performance_0400) 2979762338dSopenharmony_ci(benchmark::State& st) 2989762338dSopenharmony_ci{ 2999762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 3009762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 3019762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 3029762338dSopenharmony_ci InitPara(subscriber); 3039762338dSopenharmony_ci struct UsbDev dev = dev_; 3049762338dSopenharmony_ci std::vector<uint8_t> rawData; 3059762338dSopenharmony_ci auto ret = -1; 3069762338dSopenharmony_ci for (auto _ : st) { 3079762338dSopenharmony_ci ret = g_usbInterface->GetRawDescriptor(dev, rawData); 3089762338dSopenharmony_ci } 3099762338dSopenharmony_ci ASSERT_EQ(0, ret); 3109762338dSopenharmony_ci ReleasePara(subscriber); 3119762338dSopenharmony_ci} 3129762338dSopenharmony_ci 3139762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_DeviceManager_HDI_Performance_0400) 3149762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 3159762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 3169762338dSopenharmony_ci ->ReportAggregatesOnly(); 3179762338dSopenharmony_ci 3189762338dSopenharmony_ci/** 3199762338dSopenharmony_ci * @tc.name: SUB_USB_DeviceManager_HDI_Performance_0500 3209762338dSopenharmony_ci * @tc.desc: Test functions to GetFileDescriptor benchmark test 3219762338dSopenharmony_ci * @tc.desc: int32_t GetFileDescriptor(const UsbDev &dev, int32_t &fd); 3229762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 3239762338dSopenharmony_ci * @tc.type: FUNC 3249762338dSopenharmony_ci */ 3259762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_DeviceManager_HDI_Performance_0500) 3269762338dSopenharmony_ci(benchmark::State& st) 3279762338dSopenharmony_ci{ 3289762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 3299762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 3309762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 3319762338dSopenharmony_ci InitPara(subscriber); 3329762338dSopenharmony_ci struct UsbDev dev = dev_; 3339762338dSopenharmony_ci int32_t fd = 0; 3349762338dSopenharmony_ci auto ret = -1; 3359762338dSopenharmony_ci for (auto _ : st) { 3369762338dSopenharmony_ci ret = g_usbInterface->GetFileDescriptor(dev, fd); 3379762338dSopenharmony_ci } 3389762338dSopenharmony_ci ASSERT_EQ(0, ret); 3399762338dSopenharmony_ci ReleasePara(subscriber); 3409762338dSopenharmony_ci} 3419762338dSopenharmony_ci 3429762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_DeviceManager_HDI_Performance_0500) 3439762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 3449762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 3459762338dSopenharmony_ci ->ReportAggregatesOnly(); 3469762338dSopenharmony_ci 3479762338dSopenharmony_ci/** 3489762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0700 3499762338dSopenharmony_ci * @tc.desc: Test functions to RequestQueue benchmark test 3509762338dSopenharmony_ci * @tc.desc: int32_t RequestQueue(const UsbDev &dev, const UsbPipe &pipe, std::vector<uint8_t> &clientData, 3519762338dSopenharmony_ci std::vector<uint8_t> &buffer); 3529762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 3539762338dSopenharmony_ci * @tc.type: FUNC 3549762338dSopenharmony_ci */ 3559762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0700) 3569762338dSopenharmony_ci(benchmark::State& st) 3579762338dSopenharmony_ci{ 3589762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 3599762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 3609762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 3619762338dSopenharmony_ci InitPara(subscriber); 3629762338dSopenharmony_ci struct UsbDev dev = dev_; 3639762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 3649762338dSopenharmony_ci uint8_t pointId = POINTID_DIR_IN; 3659762338dSopenharmony_ci auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1); 3669762338dSopenharmony_ci ASSERT_EQ(0, ret); 3679762338dSopenharmony_ci OHOS::HDI::Usb::V1_0::UsbPipe pipe = { interfaceId, pointId }; 3689762338dSopenharmony_ci std::vector<uint8_t> clientData = {'q', 'u', 'e', 'u', 'e', 'r', 'e', 'a', 'd'}; 3699762338dSopenharmony_ci std::vector<uint8_t> bufferData(MAX_BUFFER_LENGTH); 3709762338dSopenharmony_ci auto req = -1; 3719762338dSopenharmony_ci for (auto _ : st) { 3729762338dSopenharmony_ci ret = g_usbInterface->RequestQueue(dev, pipe, clientData, bufferData); 3739762338dSopenharmony_ci req = g_usbInterface->RequestCancel(dev, pipe); 3749762338dSopenharmony_ci } 3759762338dSopenharmony_ci ASSERT_EQ(0, ret); 3769762338dSopenharmony_ci ASSERT_EQ(0, req); 3779762338dSopenharmony_ci ReleasePara(subscriber); 3789762338dSopenharmony_ci} 3799762338dSopenharmony_ci 3809762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0700) 3819762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 3829762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 3839762338dSopenharmony_ci ->ReportAggregatesOnly(); 3849762338dSopenharmony_ci 3859762338dSopenharmony_ci/** 3869762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0800 3879762338dSopenharmony_ci * @tc.desc: Test functions to RequestWait benchmark test 3889762338dSopenharmony_ci * @tc.desc: int32_t RequestWait(const UsbDev &dev, std::vector<uint8_t> &clientData, std::vector<uint8_t> &buffer, 3899762338dSopenharmony_ci * int32_t timeout); 3909762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 3919762338dSopenharmony_ci * @tc.type: FUNC 3929762338dSopenharmony_ci */ 3939762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0800) 3949762338dSopenharmony_ci(benchmark::State& st) 3959762338dSopenharmony_ci{ 3969762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 3979762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 3989762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 3999762338dSopenharmony_ci InitPara(subscriber); 4009762338dSopenharmony_ci struct UsbDev dev = dev_; 4019762338dSopenharmony_ci uint8_t pointId = POINTID_DIR_IN; 4029762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 4039762338dSopenharmony_ci auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1); 4049762338dSopenharmony_ci ASSERT_EQ(0, ret); 4059762338dSopenharmony_ci OHOS::HDI::Usb::V1_0::UsbPipe pipe = { interfaceId, pointId }; 4069762338dSopenharmony_ci std::vector<uint8_t> clientData = {'q', 'u', 'e', 'u', 'e', 'r', 'e', 'a', 'd'}; 4079762338dSopenharmony_ci std::vector<uint8_t> bufferData(MAX_BUFFER_LENGTH); 4089762338dSopenharmony_ci std::vector<uint8_t> waitData(TAG_NUM_10); 4099762338dSopenharmony_ci auto req = -1; 4109762338dSopenharmony_ci for (auto _ : st) { 4119762338dSopenharmony_ci ret = g_usbInterface->RequestQueue(dev, pipe, clientData, bufferData); 4129762338dSopenharmony_ci ret = g_usbInterface->RequestWait(dev, waitData, bufferData, TIME_WAIT); 4139762338dSopenharmony_ci req = g_usbInterface->RequestCancel(dev, pipe); 4149762338dSopenharmony_ci } 4159762338dSopenharmony_ci ASSERT_EQ(0, ret); 4169762338dSopenharmony_ci ASSERT_EQ(0, req); 4179762338dSopenharmony_ci ReleasePara(subscriber); 4189762338dSopenharmony_ci} 4199762338dSopenharmony_ci 4209762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0800) 4219762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 4229762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 4239762338dSopenharmony_ci ->ReportAggregatesOnly(); 4249762338dSopenharmony_ci 4259762338dSopenharmony_ci/** 4269762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_0900 4279762338dSopenharmony_ci * @tc.desc: Test functions to RequestCancel benchmark test 4289762338dSopenharmony_ci * @tc.desc: int32_t RequestCancel(const UsbDev &dev, const UsbPipe &pipe); 4299762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 4309762338dSopenharmony_ci * @tc.type: FUNC 4319762338dSopenharmony_ci */ 4329762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0900) 4339762338dSopenharmony_ci(benchmark::State& st) 4349762338dSopenharmony_ci{ 4359762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 4369762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 4379762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 4389762338dSopenharmony_ci InitPara(subscriber); 4399762338dSopenharmony_ci uint8_t pointId = POINTID_DIR_IN; 4409762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 4419762338dSopenharmony_ci struct UsbDev dev = dev_; 4429762338dSopenharmony_ci auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1); 4439762338dSopenharmony_ci ASSERT_EQ(0, ret); 4449762338dSopenharmony_ci OHOS::HDI::Usb::V1_0::UsbPipe pipe = { interfaceId, pointId }; 4459762338dSopenharmony_ci std::vector<uint8_t> clientData = {'q', 'u', 'e', 'u', 'e', 'r', 'e', 'a', 'd'}; 4469762338dSopenharmony_ci std::vector<uint8_t> bufferData = {'r', 'e', 'q', 'u', 'e', 's', 't', '0', '0', '1'}; 4479762338dSopenharmony_ci ret = g_usbInterface->RequestQueue(dev, pipe, clientData, bufferData); 4489762338dSopenharmony_ci EXPECT_EQ(0, ret); 4499762338dSopenharmony_ci for (auto _ : st) { 4509762338dSopenharmony_ci ret = g_usbInterface->RequestCancel(dev, pipe); 4519762338dSopenharmony_ci } 4529762338dSopenharmony_ci ASSERT_EQ(0, ret); 4539762338dSopenharmony_ci ReleasePara(subscriber); 4549762338dSopenharmony_ci} 4559762338dSopenharmony_ci 4569762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_0900) 4579762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 4589762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 4599762338dSopenharmony_ci ->ReportAggregatesOnly(); 4609762338dSopenharmony_ci 4619762338dSopenharmony_ci/** 4629762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_1000 4639762338dSopenharmony_ci * @tc.desc: Test functions to ReleaseInterface benchmark test 4649762338dSopenharmony_ci * @tc.desc: int32_t ReleaseInterface(const UsbDev &dev, uint8_t interfaceId); 4659762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 4669762338dSopenharmony_ci * @tc.type: FUNC 4679762338dSopenharmony_ci */ 4689762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_1000) 4699762338dSopenharmony_ci(benchmark::State& st) 4709762338dSopenharmony_ci{ 4719762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 4729762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 4739762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 4749762338dSopenharmony_ci InitPara(subscriber); 4759762338dSopenharmony_ci struct UsbDev dev = dev_; 4769762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 4779762338dSopenharmony_ci auto ret = -1; 4789762338dSopenharmony_ci for (auto _ : st) { 4799762338dSopenharmony_ci ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1); 4809762338dSopenharmony_ci ret = g_usbInterface->ReleaseInterface(dev, interfaceId); 4819762338dSopenharmony_ci } 4829762338dSopenharmony_ci ASSERT_EQ(0, ret); 4839762338dSopenharmony_ci ReleasePara(subscriber); 4849762338dSopenharmony_ci} 4859762338dSopenharmony_ci 4869762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_1000) 4879762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 4889762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 4899762338dSopenharmony_ci ->ReportAggregatesOnly(); 4909762338dSopenharmony_ci 4919762338dSopenharmony_ci/** 4929762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_2100 4939762338dSopenharmony_ci * @tc.desc: Test functions to BulkCancel benchmark test 4949762338dSopenharmony_ci * @tc.desc: int32_t BulkCancel(const UsbDev &dev, const UsbPipe &pipe); 4959762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 4969762338dSopenharmony_ci * @tc.type: FUNC 4979762338dSopenharmony_ci */ 4989762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_2100) 4999762338dSopenharmony_ci(benchmark::State& st) 5009762338dSopenharmony_ci{ 5019762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 5029762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 5039762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 5049762338dSopenharmony_ci InitPara(subscriber); 5059762338dSopenharmony_ci struct UsbDev dev = dev_; 5069762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 5079762338dSopenharmony_ci uint8_t pointId = POINTID_DIR_IN; 5089762338dSopenharmony_ci OHOS::HDI::Usb::V1_0::UsbPipe pipe = {interfaceId, pointId}; 5099762338dSopenharmony_ci auto ret = g_usbInterface->ClaimInterface(dev, interfaceId, 1); 5109762338dSopenharmony_ci ASSERT_EQ(0, ret); 5119762338dSopenharmony_ci sptr<UsbdBulkCallbackTest> usbdBulkCallback = new UsbdBulkCallbackTest(); 5129762338dSopenharmony_ci for (auto _ : st) { 5139762338dSopenharmony_ci ret = g_usbInterface->RegBulkCallback(dev, pipe, usbdBulkCallback); 5149762338dSopenharmony_ci ret = g_usbInterface->BulkCancel(dev, pipe); 5159762338dSopenharmony_ci } 5169762338dSopenharmony_ci ASSERT_EQ(0, ret); 5179762338dSopenharmony_ci ret = g_usbInterface->UnRegBulkCallback(dev, pipe); 5189762338dSopenharmony_ci ASSERT_EQ(ret, 0); 5199762338dSopenharmony_ci ReleasePara(subscriber); 5209762338dSopenharmony_ci} 5219762338dSopenharmony_ci 5229762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, SUB_USB_HostManager_HDI_Performance_2100) 5239762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 5249762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 5259762338dSopenharmony_ci ->ReportAggregatesOnly(); 5269762338dSopenharmony_ci 5279762338dSopenharmony_ci/** 5289762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_2900 5299762338dSopenharmony_ci * @tc.desc: Test functions to ClearHalt benchmark test 5309762338dSopenharmony_ci * @tc.desc: int32_t ClearHalt(const UsbDev &dev, const UsbPipe &pipe) 5319762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 5329762338dSopenharmony_ci * @tc.type: FUNC 5339762338dSopenharmony_ci */ 5349762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, ClearHaltBenchmarkTest) 5359762338dSopenharmony_ci(benchmark::State& st) 5369762338dSopenharmony_ci{ 5379762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 5389762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 5399762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 5409762338dSopenharmony_ci InitPara(subscriber); 5419762338dSopenharmony_ci uint8_t interfaceId = INTERFACEID_OK; 5429762338dSopenharmony_ci auto ret = g_usbInterface->ClaimInterface(dev_, interfaceId, 1); 5439762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5449762338dSopenharmony_ci uint8_t pointId = POINTID_DIR_IN; 5459762338dSopenharmony_ci OHOS::HDI::Usb::V1_0::UsbPipe pipe = {interfaceId, pointId}; 5469762338dSopenharmony_ci EXPECT_EQ(0, ret); 5479762338dSopenharmony_ci for (auto _ : st) { 5489762338dSopenharmony_ci ret = g_usbInterface->ClearHalt(dev_, pipe); 5499762338dSopenharmony_ci } 5509762338dSopenharmony_ci ReleasePara(subscriber); 5519762338dSopenharmony_ci} 5529762338dSopenharmony_ci 5539762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, ClearHaltBenchmarkTest) 5549762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 5559762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 5569762338dSopenharmony_ci ->ReportAggregatesOnly(); 5579762338dSopenharmony_ci 5589762338dSopenharmony_ci/** 5599762338dSopenharmony_ci * @tc.name: SUB_USB_HostManager_HDI_Performance_3000 5609762338dSopenharmony_ci * @tc.desc: Test functions to ResetDevice benchmark test 5619762338dSopenharmony_ci * @tc.desc: int32_t ResetDevice(const UsbDev &dev) 5629762338dSopenharmony_ci * @tc.desc: Positive test: parameters correctly 5639762338dSopenharmony_ci * @tc.type: FUNC 5649762338dSopenharmony_ci */ 5659762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, ResetDeviceBenchmarkTest) 5669762338dSopenharmony_ci(benchmark::State& st) 5679762338dSopenharmony_ci{ 5689762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 5699762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 5709762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 5719762338dSopenharmony_ci InitPara(subscriber); 5729762338dSopenharmony_ci auto ret = -1; 5739762338dSopenharmony_ci for (auto _ : st) { 5749762338dSopenharmony_ci ret = g_usbInterface->ResetDevice(dev_); 5759762338dSopenharmony_ci } 5769762338dSopenharmony_ci EXPECT_EQ(0, ret); 5779762338dSopenharmony_ci ReleasePara(subscriber); 5789762338dSopenharmony_ci} 5799762338dSopenharmony_ci 5809762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, ResetDeviceBenchmarkTest) 5819762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 5829762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 5839762338dSopenharmony_ci ->ReportAggregatesOnly(); 5849762338dSopenharmony_ci 5859762338dSopenharmony_ci/** 5869762338dSopenharmony_ci * @tc.number : SUB_USB_HostManager_HDI_Performance_3100 5879762338dSopenharmony_ci * @tc.name : GetDeviceFileDescriptorBenchmarkTest 5889762338dSopenharmony_ci * @tc.desc : Test functions to GetDeviceFileDescriptor benchmark test 5899762338dSopenharmony_ci * @tc.desc : int32_t GetDeviceFileDescriptor(const UsbDev &dev, int32_t &fd); 5909762338dSopenharmony_ci * @tc.desc : Positive test: parameters correctly 5919762338dSopenharmony_ci * @tc.size : MediumTest 5929762338dSopenharmony_ci * @tc.type : Function 5939762338dSopenharmony_ci * @tc.level : Level 3 5949762338dSopenharmony_ci */ 5959762338dSopenharmony_ciBENCHMARK_F(HdfUsbdBenchmarkRequestTest, GetDeviceFileDescriptorBenchmarkTest) 5969762338dSopenharmony_ci(benchmark::State& st) 5979762338dSopenharmony_ci{ 5989762338dSopenharmony_ci ASSERT_TRUE(g_usbInterface != nullptr); 5999762338dSopenharmony_ci sptr<UsbSubscriberTest> subscriber = new UsbSubscriberTest(); 6009762338dSopenharmony_ci ASSERT_TRUE(subscriber != nullptr); 6019762338dSopenharmony_ci InitPara(subscriber); 6029762338dSopenharmony_ci struct UsbDev dev = dev_; 6039762338dSopenharmony_ci int32_t fd = 0; 6049762338dSopenharmony_ci auto ret = -1; 6059762338dSopenharmony_ci for (auto _ : st) { 6069762338dSopenharmony_ci ret = g_usbInterface->GetDeviceFileDescriptor(dev, fd); 6079762338dSopenharmony_ci } 6089762338dSopenharmony_ci EXPECT_EQ(0, ret); 6099762338dSopenharmony_ci ReleasePara(subscriber); 6109762338dSopenharmony_ci} 6119762338dSopenharmony_ci 6129762338dSopenharmony_ciBENCHMARK_REGISTER_F(HdfUsbdBenchmarkRequestTest, GetDeviceFileDescriptorBenchmarkTest) 6139762338dSopenharmony_ci ->Iterations(ITERATION_FREQUENCY) 6149762338dSopenharmony_ci ->Repetitions(REPETITION_FREQUENCY) 6159762338dSopenharmony_ci ->ReportAggregatesOnly(); 6169762338dSopenharmony_ci 6179762338dSopenharmony_ci} // namespace 6189762338dSopenharmony_ci 6199762338dSopenharmony_ciBENCHMARK_MAIN(); 620