19762338dSopenharmony_ci/* 29762338dSopenharmony_ci * Copyright (c) 2023-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 169762338dSopenharmony_ci#include "fingerprint_auth_hdi_test.h" 179762338dSopenharmony_ci 189762338dSopenharmony_ci#include <hdf_base.h> 199762338dSopenharmony_ci 209762338dSopenharmony_ci#include "iam_hat_test.h" 219762338dSopenharmony_ci 229762338dSopenharmony_ci#define LOG_LABEL OHOS::UserIam::Common::LABEL_FINGERPRINT_AUTH_IMPL 239762338dSopenharmony_ci 249762338dSopenharmony_ciusing namespace std; 259762338dSopenharmony_ciusing namespace testing::ext; 269762338dSopenharmony_ciusing namespace OHOS; 279762338dSopenharmony_ciusing namespace OHOS::UserIam::Common; 289762338dSopenharmony_ciusing namespace OHOS::HDI::FingerprintAuth; 299762338dSopenharmony_ci 309762338dSopenharmony_cistatic AllInOneExecutorImpl g_executorImpl; 319762338dSopenharmony_cistatic Parcel parcel; 329762338dSopenharmony_cibool g_onResultFlag = false; 339762338dSopenharmony_cibool g_onTipFlag = false; 349762338dSopenharmony_cibool g_onSaCommandsFlag = false; 359762338dSopenharmony_ci 369762338dSopenharmony_civoid UserIamFingerprintAuthTestAdditional::SetUpTestCase() 379762338dSopenharmony_ci{ 389762338dSopenharmony_ci} 399762338dSopenharmony_ci 409762338dSopenharmony_civoid UserIamFingerprintAuthTestAdditional::TearDownTestCase() 419762338dSopenharmony_ci{ 429762338dSopenharmony_ci} 439762338dSopenharmony_ci 449762338dSopenharmony_civoid UserIamFingerprintAuthTestAdditional::SetUp() 459762338dSopenharmony_ci{ 469762338dSopenharmony_ci} 479762338dSopenharmony_ci 489762338dSopenharmony_civoid UserIamFingerprintAuthTestAdditional::TearDown() 499762338dSopenharmony_ci{ 509762338dSopenharmony_ci} 519762338dSopenharmony_ci 529762338dSopenharmony_ciclass DummyIExecutorCallback : public IExecutorCallback { 539762338dSopenharmony_cipublic: 549762338dSopenharmony_ci DummyIExecutorCallback(int32_t result, int32_t tip, int32_t message) : result_(result), tip_(tip), message_(message) 559762338dSopenharmony_ci { 569762338dSopenharmony_ci } 579762338dSopenharmony_ci 589762338dSopenharmony_ci int32_t OnResult(int32_t result, const std::vector<uint8_t> &extraInfo) override 599762338dSopenharmony_ci { 609762338dSopenharmony_ci g_onResultFlag = true; 619762338dSopenharmony_ci cout << "result is " << result << " extraInfo len is " << extraInfo.size() << endl; 629762338dSopenharmony_ci return result_; 639762338dSopenharmony_ci } 649762338dSopenharmony_ci 659762338dSopenharmony_ci int32_t OnTip(int32_t tip, const std::vector<uint8_t> &extraInfo) override 669762338dSopenharmony_ci { 679762338dSopenharmony_ci cout << "tip is " << tip << " extraInfo len is " << extraInfo.size() << endl; 689762338dSopenharmony_ci g_onTipFlag = true; 699762338dSopenharmony_ci return tip_; 709762338dSopenharmony_ci } 719762338dSopenharmony_ci 729762338dSopenharmony_ci int32_t OnMessage(int32_t destRole, const std::vector<uint8_t> &msg) override 739762338dSopenharmony_ci { 749762338dSopenharmony_ci cout << "destRole is " << destRole << " msg len is " << msg.size() << endl; 759762338dSopenharmony_ci return message_; 769762338dSopenharmony_ci } 779762338dSopenharmony_ci 789762338dSopenharmony_ciprivate: 799762338dSopenharmony_ci int32_t result_; 809762338dSopenharmony_ci int32_t tip_; 819762338dSopenharmony_ci int32_t message_; 829762338dSopenharmony_ci}; 839762338dSopenharmony_ci 849762338dSopenharmony_ciclass DummyISaCommandCallback : public ISaCommandCallback { 859762338dSopenharmony_cipublic: 869762338dSopenharmony_ci explicit DummyISaCommandCallback(int32_t result) : result_(result) 879762338dSopenharmony_ci { 889762338dSopenharmony_ci } 899762338dSopenharmony_ci 909762338dSopenharmony_ci int32_t OnSaCommands(const std::vector<SaCommand> &commands) override 919762338dSopenharmony_ci { 929762338dSopenharmony_ci g_onSaCommandsFlag = true; 939762338dSopenharmony_ci return result_; 949762338dSopenharmony_ci } 959762338dSopenharmony_ci 969762338dSopenharmony_ciprivate: 979762338dSopenharmony_ci int32_t result_; 989762338dSopenharmony_ci}; 999762338dSopenharmony_ci 1009762338dSopenharmony_cistatic void FillTestIExecutorCallback(Parcel &parcel, sptr<IExecutorCallback> &callbackObj) 1019762338dSopenharmony_ci{ 1029762338dSopenharmony_ci bool isNull = parcel.ReadBool(); 1039762338dSopenharmony_ci if (isNull) { 1049762338dSopenharmony_ci callbackObj = nullptr; 1059762338dSopenharmony_ci } else { 1069762338dSopenharmony_ci callbackObj = 1079762338dSopenharmony_ci new (std::nothrow) DummyIExecutorCallback(parcel.ReadInt32(), parcel.ReadInt32(), parcel.ReadInt32()); 1089762338dSopenharmony_ci if (callbackObj == nullptr) { 1099762338dSopenharmony_ci cout << "callbackObj construct fail" << endl; 1109762338dSopenharmony_ci } 1119762338dSopenharmony_ci } 1129762338dSopenharmony_ci cout << "success" << endl; 1139762338dSopenharmony_ci} 1149762338dSopenharmony_ci 1159762338dSopenharmony_civoid FillTestProperty(Parcel &parcel, Property &property) 1169762338dSopenharmony_ci{ 1179762338dSopenharmony_ci property.authSubType = parcel.ReadUint64(); 1189762338dSopenharmony_ci property.lockoutDuration = parcel.ReadInt32(); 1199762338dSopenharmony_ci property.remainAttempts = parcel.ReadInt32(); 1209762338dSopenharmony_ci FillTestString(parcel, property.enrollmentProgress); 1219762338dSopenharmony_ci FillTestString(parcel, property.sensorInfo); 1229762338dSopenharmony_ci 1239762338dSopenharmony_ci cout << "success" << endl; 1249762338dSopenharmony_ci} 1259762338dSopenharmony_ci 1269762338dSopenharmony_civoid FillTestISaCommandCallback(Parcel &parcel, sptr<ISaCommandCallback> &callbackObj) 1279762338dSopenharmony_ci{ 1289762338dSopenharmony_ci bool isNull = parcel.ReadBool(); 1299762338dSopenharmony_ci if (isNull) { 1309762338dSopenharmony_ci callbackObj = nullptr; 1319762338dSopenharmony_ci } else { 1329762338dSopenharmony_ci callbackObj = new (std::nothrow) DummyISaCommandCallback(parcel.ReadInt32()); 1339762338dSopenharmony_ci if (callbackObj == nullptr) { 1349762338dSopenharmony_ci cout << "callbackObj construct fail" << endl; 1359762338dSopenharmony_ci } 1369762338dSopenharmony_ci } 1379762338dSopenharmony_ci cout << "success" << endl; 1389762338dSopenharmony_ci} 1399762338dSopenharmony_ci/** 1409762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_GetExecutorInfo_0200 1419762338dSopenharmony_ci * @tc.name testFingerprintAuthTestGetExecutorInfo001 1429762338dSopenharmony_ci * @tc.desc test GetExecutorInfo executorInfo not empty 1439762338dSopenharmony_ci */ 1449762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestGetExecutorInfo001, 1459762338dSopenharmony_ci Function | MediumTest | Level1) 1469762338dSopenharmony_ci{ 1479762338dSopenharmony_ci cout << "start test testFingerprintAuthTestGetExecutorInfo001" << endl; 1489762338dSopenharmony_ci ExecutorInfo executorInfo; 1499762338dSopenharmony_ci int32_t ret = g_executorImpl.GetExecutorInfo(executorInfo); 1509762338dSopenharmony_ci cout << "ret is " << ret << endl; 1519762338dSopenharmony_ci EXPECT_EQ(ret, 0); 1529762338dSopenharmony_ci} 1539762338dSopenharmony_ci/** 1549762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_GetExecutorInfo_0300 1559762338dSopenharmony_ci * @tc.name testFingerprintAuthTestGetExecutorInfo002 1569762338dSopenharmony_ci * @tc.desc test GetExecutorInfo 1000 times 1579762338dSopenharmony_ci */ 1589762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestGetExecutorInfo002, 1599762338dSopenharmony_ci Function | MediumTest | Level1) 1609762338dSopenharmony_ci{ 1619762338dSopenharmony_ci cout << "start test testFingerprintAuthTestGetExecutorInfo002" << endl; 1629762338dSopenharmony_ci ExecutorInfo executorInfo; 1639762338dSopenharmony_ci int32_t ret = 0; 1649762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 1659762338dSopenharmony_ci ret = g_executorImpl.GetExecutorInfo(executorInfo); 1669762338dSopenharmony_ci cout << "ret " << i << " is " << ret << endl; 1679762338dSopenharmony_ci EXPECT_EQ(ret, 0); 1689762338dSopenharmony_ci } 1699762338dSopenharmony_ci} 1709762338dSopenharmony_ci/** 1719762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_OnRegisterFinish_0200 1729762338dSopenharmony_ci * @tc.name testFingerprintAuthTestOnRegisterFinish001 1739762338dSopenharmony_ci * @tc.desc test OnRegisterFinish templateIdList 1749762338dSopenharmony_ci */ 1759762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestOnRegisterFinish001, 1769762338dSopenharmony_ci Function | MediumTest | Level1) 1779762338dSopenharmony_ci{ 1789762338dSopenharmony_ci cout << "start test testFingerprintAuthTestOnRegisterFinish001" << endl; 1799762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 1809762338dSopenharmony_ci std::vector<uint8_t> frameworkPublicKey; 1819762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 1829762338dSopenharmony_ci int32_t ret = g_executorImpl.OnRegisterFinish(templateIdList, frameworkPublicKey, extraInfo); 1839762338dSopenharmony_ci cout << "ret is " << ret << endl; 1849762338dSopenharmony_ci EXPECT_EQ(ret, 0); 1859762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 1869762338dSopenharmony_ci ret = g_executorImpl.OnRegisterFinish(templateIdList, frameworkPublicKey, extraInfo); 1879762338dSopenharmony_ci cout << "ret is " << ret << endl; 1889762338dSopenharmony_ci EXPECT_EQ(ret, 0); 1899762338dSopenharmony_ci FillTestUint8Vector(parcel, frameworkPublicKey); 1909762338dSopenharmony_ci ret = g_executorImpl.OnRegisterFinish(templateIdList, frameworkPublicKey, extraInfo); 1919762338dSopenharmony_ci cout << "ret is " << ret << endl; 1929762338dSopenharmony_ci EXPECT_EQ(ret, 0); 1939762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 1949762338dSopenharmony_ci ret = g_executorImpl.OnRegisterFinish(templateIdList, frameworkPublicKey, extraInfo); 1959762338dSopenharmony_ci cout << "ret is " << ret << endl; 1969762338dSopenharmony_ci EXPECT_EQ(ret, 0); 1979762338dSopenharmony_ci} 1989762338dSopenharmony_ci/** 1999762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_OnRegisterFinish_0900 2009762338dSopenharmony_ci * @tc.name testFingerprintAuthTestOnRegisterFinish008 2019762338dSopenharmony_ci * @tc.desc test OnRegisterFinish 1000 times 2029762338dSopenharmony_ci */ 2039762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestOnRegisterFinish008, 2049762338dSopenharmony_ci Function | MediumTest | Level1) 2059762338dSopenharmony_ci{ 2069762338dSopenharmony_ci cout << "start test testFingerprintAuthTestOnRegisterFinish008" << endl; 2079762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 2089762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 2099762338dSopenharmony_ci std::vector<uint8_t> frameworkPublicKey; 2109762338dSopenharmony_ci FillTestUint8Vector(parcel, frameworkPublicKey); 2119762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 2129762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 2139762338dSopenharmony_ci int32_t ret = 0; 2149762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 2159762338dSopenharmony_ci ret = g_executorImpl.OnRegisterFinish(templateIdList, frameworkPublicKey, extraInfo); 2169762338dSopenharmony_ci cout << "ret " << i << " is " << ret << endl; 2179762338dSopenharmony_ci EXPECT_EQ(ret, 0); 2189762338dSopenharmony_ci } 2199762338dSopenharmony_ci} 2209762338dSopenharmony_ci/** 2219762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Enroll_0200 2229762338dSopenharmony_ci * @tc.name testFingerprintAuthTestEnroll001 2239762338dSopenharmony_ci * @tc.desc test Enroll scheduleId 2249762338dSopenharmony_ci */ 2259762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestEnroll001, Function | MediumTest | Level1) 2269762338dSopenharmony_ci{ 2279762338dSopenharmony_ci cout << "start test testFingerprintAuthTestEnroll001" << endl; 2289762338dSopenharmony_ci uint64_t scheduleId = 0; 2299762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 2309762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 2319762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 2329762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 2339762338dSopenharmony_ci int32_t ret = g_executorImpl.Enroll(scheduleId, extraInfo, callbackObj); 2349762338dSopenharmony_ci cout << "ret is " << ret << endl; 2359762338dSopenharmony_ci EXPECT_EQ(ret, 0); 2369762338dSopenharmony_ci scheduleId = 0x7FFFFFFFFFFFFFFF; 2379762338dSopenharmony_ci ret = g_executorImpl.Enroll(scheduleId, extraInfo, callbackObj); 2389762338dSopenharmony_ci cout << "ret is " << ret << endl; 2399762338dSopenharmony_ci EXPECT_EQ(ret, 0); 2409762338dSopenharmony_ci scheduleId = 0xFFFFFFFFFFFFFFFF; 2419762338dSopenharmony_ci ret = g_executorImpl.Enroll(scheduleId, extraInfo, callbackObj); 2429762338dSopenharmony_ci cout << "ret is " << ret << endl; 2439762338dSopenharmony_ci EXPECT_EQ(ret, 0); 2449762338dSopenharmony_ci} 2459762338dSopenharmony_ci/** 2469762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Enroll_0500 2479762338dSopenharmony_ci * @tc.name testFingerprintAuthTestEnroll004 2489762338dSopenharmony_ci * @tc.desc test Enroll extraInfo empty 2499762338dSopenharmony_ci */ 2509762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestEnroll004, Function | MediumTest | Level1) 2519762338dSopenharmony_ci{ 2529762338dSopenharmony_ci cout << "start test testFingerprintAuthTestEnroll004" << endl; 2539762338dSopenharmony_ci uint64_t scheduleId = 0x7FFFFFFFFFFFFFFF; 2549762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 2559762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 2569762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 2579762338dSopenharmony_ci int32_t ret = g_executorImpl.Enroll(scheduleId, extraInfo, callbackObj); 2589762338dSopenharmony_ci cout << "ret is " << ret << endl; 2599762338dSopenharmony_ci EXPECT_EQ(ret, 0); 2609762338dSopenharmony_ci ret = g_executorImpl.Enroll(scheduleId, extraInfo, nullptr); 2619762338dSopenharmony_ci cout << "ret is " << ret << endl; 2629762338dSopenharmony_ci EXPECT_NE(ret, 0); 2639762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 2649762338dSopenharmony_ci ret = g_executorImpl.Enroll(scheduleId, extraInfo, nullptr); 2659762338dSopenharmony_ci cout << "ret is " << ret << endl; 2669762338dSopenharmony_ci EXPECT_NE(ret, 0); 2679762338dSopenharmony_ci} 2689762338dSopenharmony_ci/** 2699762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Enroll_0800 2709762338dSopenharmony_ci * @tc.name testFingerprintAuthTestEnroll007 2719762338dSopenharmony_ci * @tc.desc test Enroll 1000 times 2729762338dSopenharmony_ci */ 2739762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestEnroll007, Function | MediumTest | Level1) 2749762338dSopenharmony_ci{ 2759762338dSopenharmony_ci cout << "start test testFingerprintAuthTestEnroll007" << endl; 2769762338dSopenharmony_ci uint64_t scheduleId = 0x7FFFFFFFFFFFFFFF; 2779762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 2789762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 2799762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 2809762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 2819762338dSopenharmony_ci int32_t ret = 0; 2829762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 2839762338dSopenharmony_ci ret = g_executorImpl.Enroll(scheduleId, extraInfo, callbackObj); 2849762338dSopenharmony_ci cout << "ret " << i << " is " << ret << endl; 2859762338dSopenharmony_ci EXPECT_EQ(ret, 0); 2869762338dSopenharmony_ci } 2879762338dSopenharmony_ci} 2889762338dSopenharmony_ci/** 2899762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Identify_0200 2909762338dSopenharmony_ci * @tc.name testFingerprintAuthTestIdentify001 2919762338dSopenharmony_ci * @tc.desc test Identify scheduleId 2929762338dSopenharmony_ci */ 2939762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestIdentify001, Function | MediumTest | Level1) 2949762338dSopenharmony_ci{ 2959762338dSopenharmony_ci cout << "start test testFingerprintAuthTestIdentify001" << endl; 2969762338dSopenharmony_ci uint64_t scheduleId = 0; 2979762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 2989762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 2999762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 3009762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 3019762338dSopenharmony_ci int32_t ret = g_executorImpl.Identify(scheduleId, extraInfo, callbackObj); 3029762338dSopenharmony_ci cout << "ret is " << ret << endl; 3039762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3049762338dSopenharmony_ci scheduleId = 0x7FFFFFFFFFFFFFFF; 3059762338dSopenharmony_ci ret = g_executorImpl.Identify(scheduleId, extraInfo, callbackObj); 3069762338dSopenharmony_ci cout << "ret is " << ret << endl; 3079762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3089762338dSopenharmony_ci scheduleId = 0xFFFFFFFFFFFFFFFF; 3099762338dSopenharmony_ci ret = g_executorImpl.Identify(scheduleId, extraInfo, callbackObj); 3109762338dSopenharmony_ci cout << "ret is " << ret << endl; 3119762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3129762338dSopenharmony_ci} 3139762338dSopenharmony_ci/** 3149762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Identify_0500 3159762338dSopenharmony_ci * @tc.name testFingerprintAuthTestIdentify004 3169762338dSopenharmony_ci * @tc.desc test Identify extraInfo 3179762338dSopenharmony_ci */ 3189762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestIdentify004, Function | MediumTest | Level1) 3199762338dSopenharmony_ci{ 3209762338dSopenharmony_ci cout << "start test testFingerprintAuthTestIdentify004" << endl; 3219762338dSopenharmony_ci uint64_t scheduleId = 0x7FFFFFFFFFFFFFFF; 3229762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 3239762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 3249762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 3259762338dSopenharmony_ci int32_t ret = g_executorImpl.Identify(scheduleId, extraInfo, callbackObj); 3269762338dSopenharmony_ci cout << "ret is " << ret << endl; 3279762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3289762338dSopenharmony_ci ret = g_executorImpl.Identify(scheduleId, extraInfo, nullptr); 3299762338dSopenharmony_ci cout << "ret is " << ret << endl; 3309762338dSopenharmony_ci EXPECT_NE(ret, 0); 3319762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 3329762338dSopenharmony_ci ret = g_executorImpl.Identify(scheduleId, extraInfo, nullptr); 3339762338dSopenharmony_ci cout << "ret is " << ret << endl; 3349762338dSopenharmony_ci EXPECT_NE(ret, 0); 3359762338dSopenharmony_ci} 3369762338dSopenharmony_ci/** 3379762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Identify_0800 3389762338dSopenharmony_ci * @tc.name testFingerprintAuthTestIdentify007 3399762338dSopenharmony_ci * @tc.desc test Identify 1000 times 3409762338dSopenharmony_ci */ 3419762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestIdentify007, Function | MediumTest | Level1) 3429762338dSopenharmony_ci{ 3439762338dSopenharmony_ci cout << "start test testFingerprintAuthTestIdentify007" << endl; 3449762338dSopenharmony_ci uint64_t scheduleId = 0x7FFFFFFFFFFFFFFF; 3459762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 3469762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 3479762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 3489762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 3499762338dSopenharmony_ci int32_t ret = 0; 3509762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 3519762338dSopenharmony_ci ret = g_executorImpl.Identify(scheduleId, extraInfo, callbackObj); 3529762338dSopenharmony_ci cout << "ret is " << ret << endl; 3539762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3549762338dSopenharmony_ci } 3559762338dSopenharmony_ci} 3569762338dSopenharmony_ci/** 3579762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Delete_0200 3589762338dSopenharmony_ci * @tc.name testFingerprintAuthTestDelete001 3599762338dSopenharmony_ci * @tc.desc test Delete templateIdList empty 3609762338dSopenharmony_ci */ 3619762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestDelete001, Function | MediumTest | Level1) 3629762338dSopenharmony_ci{ 3639762338dSopenharmony_ci cout << "start test testFingerprintAuthTestDelete001" << endl; 3649762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 3659762338dSopenharmony_ci int32_t ret = g_executorImpl.Delete(templateIdList); 3669762338dSopenharmony_ci cout << "ret is " << ret << endl; 3679762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3689762338dSopenharmony_ci} 3699762338dSopenharmony_ci/** 3709762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Delete_0300 3719762338dSopenharmony_ci * @tc.name testFingerprintAuthTestDelete002 3729762338dSopenharmony_ci * @tc.desc test Delete 1000 times 3739762338dSopenharmony_ci */ 3749762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestDelete002, Function | MediumTest | Level1) 3759762338dSopenharmony_ci{ 3769762338dSopenharmony_ci cout << "start test testFingerprintAuthTestDelete002" << endl; 3779762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 3789762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 3799762338dSopenharmony_ci int32_t ret = 0; 3809762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 3819762338dSopenharmony_ci ret = g_executorImpl.Delete(templateIdList); 3829762338dSopenharmony_ci cout << "ret is " << ret << endl; 3839762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3849762338dSopenharmony_ci } 3859762338dSopenharmony_ci} 3869762338dSopenharmony_ci/** 3879762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Cancel_0200 3889762338dSopenharmony_ci * @tc.name testFingerprintAuthTestCancel001 3899762338dSopenharmony_ci * @tc.desc test Cancel scheduleId 3909762338dSopenharmony_ci */ 3919762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestCancel001, Function | MediumTest | Level1) 3929762338dSopenharmony_ci{ 3939762338dSopenharmony_ci cout << "start test testFingerprintAuthTestCancel001" << endl; 3949762338dSopenharmony_ci uint64_t scheduleId = 0; 3959762338dSopenharmony_ci int32_t ret = g_executorImpl.Cancel(scheduleId); 3969762338dSopenharmony_ci cout << "ret is " << ret << endl; 3979762338dSopenharmony_ci EXPECT_EQ(ret, 0); 3989762338dSopenharmony_ci scheduleId = 0x7FFFFFFFFFFFFFFF; 3999762338dSopenharmony_ci ret = g_executorImpl.Cancel(scheduleId); 4009762338dSopenharmony_ci cout << "ret is " << ret << endl; 4019762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4029762338dSopenharmony_ci scheduleId = 0xFFFFFFFFFFFFFFFF; 4039762338dSopenharmony_ci ret = g_executorImpl.Cancel(scheduleId); 4049762338dSopenharmony_ci cout << "ret is " << ret << endl; 4059762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4069762338dSopenharmony_ci} 4079762338dSopenharmony_ci/** 4089762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Cancel_0500 4099762338dSopenharmony_ci * @tc.name testFingerprintAuthTestCancel004 4109762338dSopenharmony_ci * @tc.desc test Cancel 1000 times 4119762338dSopenharmony_ci */ 4129762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestCancel004, Function | MediumTest | Level1) 4139762338dSopenharmony_ci{ 4149762338dSopenharmony_ci cout << "start test testFingerprintAuthTestCancel004" << endl; 4159762338dSopenharmony_ci uint64_t scheduleId = 0; 4169762338dSopenharmony_ci int32_t ret = 0; 4179762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 4189762338dSopenharmony_ci ret = g_executorImpl.Cancel(scheduleId); 4199762338dSopenharmony_ci cout << "ret is " << ret << endl; 4209762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4219762338dSopenharmony_ci } 4229762338dSopenharmony_ci} 4239762338dSopenharmony_ci/** 4249762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_SendCommand_0200 4259762338dSopenharmony_ci * @tc.name testFingerprintAuthTestSendCommand001 4269762338dSopenharmony_ci * @tc.desc test SendCommand commandId enum 4279762338dSopenharmony_ci */ 4289762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestSendCommand001, Function | MediumTest | Level1) 4299762338dSopenharmony_ci{ 4309762338dSopenharmony_ci cout << "start test testFingerprintAuthTestSendCommand001" << endl; 4319762338dSopenharmony_ci int32_t commandId = DriverCommandId::LOCK_TEMPLATE; 4329762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 4339762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 4349762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 4359762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 4369762338dSopenharmony_ci int32_t ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4379762338dSopenharmony_ci cout << "ret is " << ret << endl; 4389762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4399762338dSopenharmony_ci commandId = DriverCommandId::UNLOCK_TEMPLATE; 4409762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4419762338dSopenharmony_ci cout << "ret is " << ret << endl; 4429762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4439762338dSopenharmony_ci commandId = DriverCommandId::VENDOR_COMMAND_BEGIN; 4449762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4459762338dSopenharmony_ci cout << "ret is " << ret << endl; 4469762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4479762338dSopenharmony_ci commandId = 0; 4489762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4499762338dSopenharmony_ci cout << "ret is " << ret << endl; 4509762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4519762338dSopenharmony_ci commandId = 0x7FFFFFFF; 4529762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4539762338dSopenharmony_ci cout << "ret is " << ret << endl; 4549762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4559762338dSopenharmony_ci commandId = -0x01; 4569762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4579762338dSopenharmony_ci cout << "ret is " << ret << endl; 4589762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4599762338dSopenharmony_ci commandId = -0x7FFFFFFF; 4609762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4619762338dSopenharmony_ci cout << "ret is " << ret << endl; 4629762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4639762338dSopenharmony_ci} 4649762338dSopenharmony_ci/** 4659762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_SendCommand_0900 4669762338dSopenharmony_ci * @tc.name testFingerprintAuthTestSendCommand008 4679762338dSopenharmony_ci * @tc.desc test SendCommand extraInfo 4689762338dSopenharmony_ci */ 4699762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestSendCommand008, Function | MediumTest | Level1) 4709762338dSopenharmony_ci{ 4719762338dSopenharmony_ci cout << "start test testFingerprintAuthTestSendCommand008" << endl; 4729762338dSopenharmony_ci int32_t commandId = DriverCommandId::LOCK_TEMPLATE; 4739762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 4749762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 4759762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 4769762338dSopenharmony_ci int32_t ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 4779762338dSopenharmony_ci cout << "ret is " << ret << endl; 4789762338dSopenharmony_ci EXPECT_EQ(ret, 0); 4799762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, nullptr); 4809762338dSopenharmony_ci cout << "ret is " << ret << endl; 4819762338dSopenharmony_ci EXPECT_NE(ret, 0); 4829762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 4839762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, nullptr); 4849762338dSopenharmony_ci cout << "ret is " << ret << endl; 4859762338dSopenharmony_ci EXPECT_NE(ret, 0); 4869762338dSopenharmony_ci} 4879762338dSopenharmony_ci/** 4889762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_SendCommand_1200 4899762338dSopenharmony_ci * @tc.name testFingerprintAuthTestSendCommand011 4909762338dSopenharmony_ci * @tc.desc test SendCommand 1000 times 4919762338dSopenharmony_ci */ 4929762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestSendCommand011, Function | MediumTest | Level1) 4939762338dSopenharmony_ci{ 4949762338dSopenharmony_ci cout << "start test testFingerprintAuthTestSendCommand011" << endl; 4959762338dSopenharmony_ci int32_t commandId = DriverCommandId::LOCK_TEMPLATE; 4969762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 4979762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 4989762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 4999762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 5009762338dSopenharmony_ci int32_t ret = 0; 5019762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 5029762338dSopenharmony_ci ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 5039762338dSopenharmony_ci cout << "ret is " << ret << endl; 5049762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5059762338dSopenharmony_ci } 5069762338dSopenharmony_ci} 5079762338dSopenharmony_ci/** 5089762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Authenticate_0100 5099762338dSopenharmony_ci * @tc.name testFingerprintAuthTestAuthenticate001 5109762338dSopenharmony_ci * @tc.desc test Authenticate scheduleId 0 5119762338dSopenharmony_ci */ 5129762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestAuthenticate001, Function | MediumTest | Level1) 5139762338dSopenharmony_ci{ 5149762338dSopenharmony_ci cout << "start test testFingerprintAuthTestAuthenticate001" << endl; 5159762338dSopenharmony_ci uint64_t scheduleId = 0; 5169762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 5179762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 5189762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 5199762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 5209762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 5219762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 5229762338dSopenharmony_ci int32_t ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 5239762338dSopenharmony_ci cout << "ret is " << ret << endl; 5249762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5259762338dSopenharmony_ci scheduleId = 0x7FFFFFFFFFFFFFFF; 5269762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 5279762338dSopenharmony_ci cout << "ret is " << ret << endl; 5289762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5299762338dSopenharmony_ci scheduleId = 0xFFFFFFFFFFFFFFFF; 5309762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 5319762338dSopenharmony_ci cout << "ret is " << ret << endl; 5329762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5339762338dSopenharmony_ci} 5349762338dSopenharmony_ci/** 5359762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Authenticate_0400 5369762338dSopenharmony_ci * @tc.name testFingerprintAuthTestAuthenticate004 5379762338dSopenharmony_ci * @tc.desc test Authenticate endAfterFirstFail true 5389762338dSopenharmony_ci */ 5399762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestAuthenticate004, Function | MediumTest | Level1) 5409762338dSopenharmony_ci{ 5419762338dSopenharmony_ci cout << "start test testFingerprintAuthTestAuthenticate004" << endl; 5429762338dSopenharmony_ci uint64_t scheduleId = parcel.ReadUint64(); 5439762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 5449762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 5459762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 5469762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 5479762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 5489762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 5499762338dSopenharmony_ci int32_t ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 5509762338dSopenharmony_ci cout << "ret is " << ret << endl; 5519762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5529762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, false, extraInfo, callbackObj); 5539762338dSopenharmony_ci cout << "ret is " << ret << endl; 5549762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5559762338dSopenharmony_ci} 5569762338dSopenharmony_ci/** 5579762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Authenticate_0600 5589762338dSopenharmony_ci * @tc.name testFingerprintAuthTestAuthenticate006 5599762338dSopenharmony_ci * @tc.desc test Authenticate empty 5609762338dSopenharmony_ci */ 5619762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestAuthenticate006, Function | MediumTest | Level1) 5629762338dSopenharmony_ci{ 5639762338dSopenharmony_ci cout << "start test testFingerprintAuthTestAuthenticate006" << endl; 5649762338dSopenharmony_ci uint64_t scheduleId = parcel.ReadUint64(); 5659762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 5669762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 5679762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 5689762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 5699762338dSopenharmony_ci int32_t ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 5709762338dSopenharmony_ci cout << "ret is " << ret << endl; 5719762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5729762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, nullptr); 5739762338dSopenharmony_ci cout << "ret is " << ret << endl; 5749762338dSopenharmony_ci EXPECT_NE(ret, 0); 5759762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 5769762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 5779762338dSopenharmony_ci cout << "ret is " << ret << endl; 5789762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5799762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, nullptr); 5809762338dSopenharmony_ci cout << "ret is " << ret << endl; 5819762338dSopenharmony_ci EXPECT_NE(ret, 0); 5829762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 5839762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 5849762338dSopenharmony_ci cout << "ret is " << ret << endl; 5859762338dSopenharmony_ci EXPECT_EQ(ret, 0); 5869762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, nullptr); 5879762338dSopenharmony_ci cout << "ret is " << ret << endl; 5889762338dSopenharmony_ci EXPECT_NE(ret, 0); 5899762338dSopenharmony_ci} 5909762338dSopenharmony_ci/** 5919762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_Authenticate_1300 5929762338dSopenharmony_ci * @tc.name testFingerprintAuthTestAuthenticate013 5939762338dSopenharmony_ci * @tc.desc test Authenticate 1000 times 5949762338dSopenharmony_ci */ 5959762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestAuthenticate013, Function | MediumTest | Level1) 5969762338dSopenharmony_ci{ 5979762338dSopenharmony_ci cout << "start test testFingerprintAuthTestAuthenticate013" << endl; 5989762338dSopenharmony_ci uint64_t scheduleId = parcel.ReadUint64(); 5999762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 6009762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 6019762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 6029762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 6039762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 6049762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 6059762338dSopenharmony_ci int32_t ret = 0; 6069762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 6079762338dSopenharmony_ci ret = g_executorImpl.Authenticate(scheduleId, templateIdList, true, extraInfo, callbackObj); 6089762338dSopenharmony_ci cout << "ret is " << ret << endl; 6099762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6109762338dSopenharmony_ci } 6119762338dSopenharmony_ci} 6129762338dSopenharmony_ci/** 6139762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_GetProperty_0200 6149762338dSopenharmony_ci * @tc.name testFingerprintAuthTestGetProperty001 6159762338dSopenharmony_ci * @tc.desc test GetProperty 6169762338dSopenharmony_ci */ 6179762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestGetProperty001, Function | MediumTest | Level1) 6189762338dSopenharmony_ci{ 6199762338dSopenharmony_ci cout << "start test testFingerprintAuthTestGetProperty001" << endl; 6209762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 6219762338dSopenharmony_ci std::vector<int32_t> propertyTypes; 6229762338dSopenharmony_ci Property property; 6239762338dSopenharmony_ci int32_t ret = g_executorImpl.GetProperty(templateIdList, propertyTypes, property); 6249762338dSopenharmony_ci cout << "ret is " << ret << endl; 6259762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6269762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 6279762338dSopenharmony_ci ret = g_executorImpl.GetProperty(templateIdList, propertyTypes, property); 6289762338dSopenharmony_ci cout << "ret is " << ret << endl; 6299762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6309762338dSopenharmony_ci propertyTypes.push_back(GetPropertyType::AUTH_SUB_TYPE); 6319762338dSopenharmony_ci propertyTypes.push_back(GetPropertyType::LOCKOUT_DURATION); 6329762338dSopenharmony_ci propertyTypes.push_back(GetPropertyType::REMAIN_ATTEMPTS); 6339762338dSopenharmony_ci propertyTypes.push_back(GetPropertyType::ENROLL_PROGRESS); 6349762338dSopenharmony_ci propertyTypes.push_back(GetPropertyType::SENSOR_INFO); 6359762338dSopenharmony_ci ret = g_executorImpl.GetProperty(templateIdList, propertyTypes, property); 6369762338dSopenharmony_ci cout << "ret is " << ret << endl; 6379762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6389762338dSopenharmony_ci FillTestProperty(parcel, property); 6399762338dSopenharmony_ci ret = g_executorImpl.GetProperty(templateIdList, propertyTypes, property); 6409762338dSopenharmony_ci cout << "ret is " << ret << endl; 6419762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6429762338dSopenharmony_ci} 6439762338dSopenharmony_ci/** 6449762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_GetProperty_1000 6459762338dSopenharmony_ci * @tc.name testFingerprintAuthTestGetProperty009 6469762338dSopenharmony_ci * @tc.desc test GetProperty 1000 times 6479762338dSopenharmony_ci */ 6489762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestGetProperty009, Function | MediumTest | Level1) 6499762338dSopenharmony_ci{ 6509762338dSopenharmony_ci cout << "start test testFingerprintAuthTestGetProperty009" << endl; 6519762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 6529762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 6539762338dSopenharmony_ci std::vector<int32_t> propertyTypes; 6549762338dSopenharmony_ci FillTestInt32Vector(parcel, propertyTypes); 6559762338dSopenharmony_ci Property property; 6569762338dSopenharmony_ci FillTestProperty(parcel, property); 6579762338dSopenharmony_ci int32_t ret = 0; 6589762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 6599762338dSopenharmony_ci ret = g_executorImpl.GetProperty(templateIdList, propertyTypes, property); 6609762338dSopenharmony_ci cout << "ret is " << ret << endl; 6619762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6629762338dSopenharmony_ci } 6639762338dSopenharmony_ci} 6649762338dSopenharmony_ci/** 6659762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_SetCachedTemplates_0200 6669762338dSopenharmony_ci * @tc.name testFingerprintAuthTestSetCachedTemplates001 6679762338dSopenharmony_ci * @tc.desc test SetCachedTemplates templateIdList empty 6689762338dSopenharmony_ci */ 6699762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestSetCachedTemplates001, 6709762338dSopenharmony_ci Function | MediumTest | Level1) 6719762338dSopenharmony_ci{ 6729762338dSopenharmony_ci cout << "start test testFingerprintAuthTestSetCachedTemplates001" << endl; 6739762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 6749762338dSopenharmony_ci 6759762338dSopenharmony_ci int32_t ret = g_executorImpl.SetCachedTemplates(templateIdList); 6769762338dSopenharmony_ci cout << "ret is " << ret << endl; 6779762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6789762338dSopenharmony_ci} 6799762338dSopenharmony_ci/** 6809762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_SetCachedTemplates_0300 6819762338dSopenharmony_ci * @tc.name testFingerprintAuthTestSetCachedTemplates002 6829762338dSopenharmony_ci * @tc.desc test SetCachedTemplates 1000 times 6839762338dSopenharmony_ci */ 6849762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestSetCachedTemplates002, 6859762338dSopenharmony_ci Function | MediumTest | Level1) 6869762338dSopenharmony_ci{ 6879762338dSopenharmony_ci cout << "start test testFingerprintAuthTestSetCachedTemplates002" << endl; 6889762338dSopenharmony_ci std::vector<uint64_t> templateIdList; 6899762338dSopenharmony_ci FillTestUint64Vector(parcel, templateIdList); 6909762338dSopenharmony_ci 6919762338dSopenharmony_ci int32_t ret = 0; 6929762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 6939762338dSopenharmony_ci ret = g_executorImpl.SetCachedTemplates(templateIdList); 6949762338dSopenharmony_ci cout << "ret is " << ret << endl; 6959762338dSopenharmony_ci EXPECT_EQ(ret, 0); 6969762338dSopenharmony_ci } 6979762338dSopenharmony_ci} 6989762338dSopenharmony_ci/** 6999762338dSopenharmony_ci * @tc.number 7009762338dSopenharmony_ci * SUB_Security_Iam_FingerprintAuth_HDI_RegisterSaCommandCallback_0200 7019762338dSopenharmony_ci * @tc.name testFingerprintAuthTestRegisterSaCommandCallback001 7029762338dSopenharmony_ci * @tc.desc test SetCachedTemplates callbackObj null 7039762338dSopenharmony_ci */ 7049762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestRegisterSaCommandCallback001, 7059762338dSopenharmony_ci Function | MediumTest | Level2) 7069762338dSopenharmony_ci{ 7079762338dSopenharmony_ci cout << "start test testFingerprintAuthTestRegisterSaCommandCallback001" << endl; 7089762338dSopenharmony_ci sptr<ISaCommandCallback> callbackObj = nullptr; 7099762338dSopenharmony_ci FillTestISaCommandCallback(parcel, callbackObj); 7109762338dSopenharmony_ci 7119762338dSopenharmony_ci int32_t ret = g_executorImpl.RegisterSaCommandCallback(nullptr); 7129762338dSopenharmony_ci 7139762338dSopenharmony_ci cout << "ret is " << ret << endl; 7149762338dSopenharmony_ci EXPECT_EQ(ret, 0); 7159762338dSopenharmony_ci} 7169762338dSopenharmony_ci/** 7179762338dSopenharmony_ci * @tc.number 7189762338dSopenharmony_ci * SUB_Security_Iam_FingerprintAuth_HDI_RegisterSaCommandCallback_0300 7199762338dSopenharmony_ci * @tc.name testFingerprintAuthTestRegisterSaCommandCallback002 7209762338dSopenharmony_ci * @tc.desc test SetCachedTemplates 1000 times 7219762338dSopenharmony_ci */ 7229762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestRegisterSaCommandCallback002, 7239762338dSopenharmony_ci Function | MediumTest | Level1) 7249762338dSopenharmony_ci{ 7259762338dSopenharmony_ci cout << "start test testFingerprintAuthTestRegisterSaCommandCallback002" << endl; 7269762338dSopenharmony_ci sptr<ISaCommandCallback> callbackObj = nullptr; 7279762338dSopenharmony_ci FillTestISaCommandCallback(parcel, callbackObj); 7289762338dSopenharmony_ci int32_t ret = 0; 7299762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 7309762338dSopenharmony_ci ret = g_executorImpl.RegisterSaCommandCallback(callbackObj); 7319762338dSopenharmony_ci cout << "ret is " << ret << endl; 7329762338dSopenharmony_ci EXPECT_EQ(ret, 0); 7339762338dSopenharmony_ci } 7349762338dSopenharmony_ci} 7359762338dSopenharmony_ci/** 7369762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_SendMessage_0100 7379762338dSopenharmony_ci * @tc.name testFingerprintAuthTestSendMessage001 7389762338dSopenharmony_ci * @tc.desc test SetCachedTemplates 1000 times 7399762338dSopenharmony_ci */ 7409762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestSendMessage001, Function | MediumTest | Level1) 7419762338dSopenharmony_ci{ 7429762338dSopenharmony_ci cout << "start test testFingerprintAuthTestSendMessage001" << endl; 7439762338dSopenharmony_ci 7449762338dSopenharmony_ci uint64_t scheduleId = 0; 7459762338dSopenharmony_ci int32_t srcRole = 0; 7469762338dSopenharmony_ci std::vector<uint8_t> msg; 7479762338dSopenharmony_ci msg.resize(5); 7489762338dSopenharmony_ci int32_t ret = 0; 7499762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 7509762338dSopenharmony_ci ret = g_executorImpl.SendMessage(scheduleId, srcRole, msg); 7519762338dSopenharmony_ci cout << "ret is " << ret << endl; 7529762338dSopenharmony_ci EXPECT_EQ(ret, 0); 7539762338dSopenharmony_ci } 7549762338dSopenharmony_ci} 7559762338dSopenharmony_ci/** 7569762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_GetExecutorList_0200 7579762338dSopenharmony_ci * @tc.name testFingerprintAuthTestGetExecutorList001 7589762338dSopenharmony_ci * @tc.desc test GetExecutorList 1000 times 7599762338dSopenharmony_ci */ 7609762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestGetExecutorList001, 7619762338dSopenharmony_ci Function | MediumTest | Level1) 7629762338dSopenharmony_ci{ 7639762338dSopenharmony_ci cout << "start test GetExecutorList" << endl; 7649762338dSopenharmony_ci FingerprintAuthInterfaceService fingerprint_Interface; 7659762338dSopenharmony_ci std::vector<sptr<IAllInOneExecutor>> executorList; 7669762338dSopenharmony_ci int32_t ret = 0; 7679762338dSopenharmony_ci for (int32_t i = 0; i < 1000; i++) { 7689762338dSopenharmony_ci ret = fingerprint_Interface.GetExecutorList(executorList); 7699762338dSopenharmony_ci cout << "ret is " << ret << endl; 7709762338dSopenharmony_ci EXPECT_EQ(ret, 0); 7719762338dSopenharmony_ci } 7729762338dSopenharmony_ci} 7739762338dSopenharmony_ci/** 7749762338dSopenharmony_ci * @tc.number SUB_Security_Iam_FingerprintAuth_HDI_OnResult_0100 7759762338dSopenharmony_ci * @tc.name testFingerprintAuthTestOnResult001 7769762338dSopenharmony_ci * @tc.desc test OnResult Callback 7779762338dSopenharmony_ci */ 7789762338dSopenharmony_ciHWTEST_F(UserIamFingerprintAuthTestAdditional, testFingerprintAuthTestOnResult001, Function | MediumTest | Level1) 7799762338dSopenharmony_ci{ 7809762338dSopenharmony_ci cout << "start test testFingerprintAuthTestOnResult001" << endl; 7819762338dSopenharmony_ci uint8_t commandId = parcel.ReadUint8(); 7829762338dSopenharmony_ci std::vector<uint8_t> extraInfo; 7839762338dSopenharmony_ci FillTestUint8Vector(parcel, extraInfo); 7849762338dSopenharmony_ci sptr<IExecutorCallback> callbackObj; 7859762338dSopenharmony_ci FillTestIExecutorCallback(parcel, callbackObj); 7869762338dSopenharmony_ci int32_t ret = g_executorImpl.SendCommand(commandId, extraInfo, callbackObj); 7879762338dSopenharmony_ci cout << "ret is " << ret << endl; 7889762338dSopenharmony_ci EXPECT_EQ(g_onResultFlag, true); 7899762338dSopenharmony_ci}