19762338dSopenharmony_ci/* 29762338dSopenharmony_ci * Copyright (c) 2023 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 <iostream> 179762338dSopenharmony_ci#include <osal_mem.h> 189762338dSopenharmony_ci#include "hdf_sbuf.h" 199762338dSopenharmony_ci#include <cmath> 209762338dSopenharmony_ci#include <cstdio> 219762338dSopenharmony_ci#include <unistd.h> 229762338dSopenharmony_ci#include <gtest/gtest.h> 239762338dSopenharmony_ci#include "idevmgr_hdi.h" 249762338dSopenharmony_ci#include <securec.h> 259762338dSopenharmony_ci#include "hdf_base.h" 269762338dSopenharmony_ci#include "hdf_log.h" 279762338dSopenharmony_ci#include "osal_time.h" 289762338dSopenharmony_ci#ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 299762338dSopenharmony_ci#include "v2_0/igeofence_interface.h" 309762338dSopenharmony_ci#include "geofence_callback_impl.h" 319762338dSopenharmony_ci 329762338dSopenharmony_ciusing namespace OHOS::HDI::Location::Geofence::V2_0; 339762338dSopenharmony_ci#endif 349762338dSopenharmony_ciusing namespace std; 359762338dSopenharmony_ciusing namespace testing::ext; 369762338dSopenharmony_ci 379762338dSopenharmony_cinamespace { 389762338dSopenharmony_ci#ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 399762338dSopenharmony_cisptr<IGeofenceInterface> g_igeofenceHci = nullptr; 409762338dSopenharmony_ci#endif 419762338dSopenharmony_ci} // namespace 429762338dSopenharmony_ci 439762338dSopenharmony_ciclass LocationGeofenceAdditionalTest : public testing::Test { 449762338dSopenharmony_cipublic: 459762338dSopenharmony_ci static void SetUpTestCase(); 469762338dSopenharmony_ci static void TearDownTestCase(); 479762338dSopenharmony_ci void SetUp(); 489762338dSopenharmony_ci void TearDown(); 499762338dSopenharmony_ci}; 509762338dSopenharmony_ci 519762338dSopenharmony_ci#ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 529762338dSopenharmony_ciint32_t GeofenceCallbackImpl::ReportGeofenceAvailability(bool isAvailable) 539762338dSopenharmony_ci{ 549762338dSopenharmony_ci (void)isAvailable; 559762338dSopenharmony_ci return HDF_SUCCESS; 569762338dSopenharmony_ci} 579762338dSopenharmony_ci 589762338dSopenharmony_ciint32_t GeofenceCallbackImpl::ReportGeofenceEvent(int32_t fenceIndex, const LocationInfo &location, GeofenceEvent event, 599762338dSopenharmony_ci int64_t timestamp) 609762338dSopenharmony_ci{ 619762338dSopenharmony_ci (void)fenceIndex; 629762338dSopenharmony_ci (void)location; 639762338dSopenharmony_ci (void)event; 649762338dSopenharmony_ci (void)timestamp; 659762338dSopenharmony_ci return HDF_SUCCESS; 669762338dSopenharmony_ci} 679762338dSopenharmony_ci 689762338dSopenharmony_ciint32_t GeofenceCallbackImpl::ReportGeofenceOperateResult(int32_t fenceIndex, GeofenceOperateType type, 699762338dSopenharmony_ci GeofenceOperateResult result) 709762338dSopenharmony_ci{ 719762338dSopenharmony_ci (void)fenceIndex; 729762338dSopenharmony_ci (void)type; 739762338dSopenharmony_ci (void)result; 749762338dSopenharmony_ci return HDF_SUCCESS; 759762338dSopenharmony_ci} 769762338dSopenharmony_ci#endif 779762338dSopenharmony_ci 789762338dSopenharmony_civoid LocationGeofenceAdditionalTest::SetUpTestCase() 799762338dSopenharmony_ci{ 809762338dSopenharmony_ci#ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 819762338dSopenharmony_ci auto devmgr = HDI::DeviceManager::V1_0::IDeviceManager::Get(); 829762338dSopenharmony_ci if (devmgr == nullptr) { 839762338dSopenharmony_ci printf("fail to get devmgr.\n"); 849762338dSopenharmony_ci return; 859762338dSopenharmony_ci } 869762338dSopenharmony_ci if (devmgr->LoadDevice("gnss_interface_service") != 0) { 879762338dSopenharmony_ci printf("Load gnss service failed!\n"); 889762338dSopenharmony_ci return; 899762338dSopenharmony_ci } 909762338dSopenharmony_ci if (devmgr->LoadDevice("agnss_interface_service") != 0) { 919762338dSopenharmony_ci printf("Load agnss service failed!\n"); 929762338dSopenharmony_ci return; 939762338dSopenharmony_ci } 949762338dSopenharmony_ci if (devmgr->LoadDevice("geofence_interface_service") != 0) { 959762338dSopenharmony_ci printf("Load geofence service failed!\n"); 969762338dSopenharmony_ci return; 979762338dSopenharmony_ci } 989762338dSopenharmony_ci g_igeofenceHci = IGeofenceInterface::Get(); 999762338dSopenharmony_ci#endif 1009762338dSopenharmony_ci} 1019762338dSopenharmony_ci 1029762338dSopenharmony_civoid LocationGeofenceAdditionalTest::TearDownTestCase() 1039762338dSopenharmony_ci{ 1049762338dSopenharmony_ci#ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 1059762338dSopenharmony_ci auto devmgr = HDI::DeviceManager::V1_0::IDeviceManager::Get(); 1069762338dSopenharmony_ci if (devmgr == nullptr) { 1079762338dSopenharmony_ci printf("fail to get devmgr.\n"); 1089762338dSopenharmony_ci return; 1099762338dSopenharmony_ci } 1109762338dSopenharmony_ci if (devmgr->UnloadDevice("gnss_interface_service") != 0) { 1119762338dSopenharmony_ci printf("Load gnss service failed!\n"); 1129762338dSopenharmony_ci return; 1139762338dSopenharmony_ci } 1149762338dSopenharmony_ci if (devmgr->UnloadDevice("agnss_interface_service") != 0) { 1159762338dSopenharmony_ci printf("Load agnss service failed!\n"); 1169762338dSopenharmony_ci return; 1179762338dSopenharmony_ci } 1189762338dSopenharmony_ci if (devmgr->UnloadDevice("geofence_interface_service") != 0) { 1199762338dSopenharmony_ci printf("Load geofence service failed!\n"); 1209762338dSopenharmony_ci return; 1219762338dSopenharmony_ci } 1229762338dSopenharmony_ci#endif 1239762338dSopenharmony_ci} 1249762338dSopenharmony_ci 1259762338dSopenharmony_civoid LocationGeofenceAdditionalTest::SetUp() {} 1269762338dSopenharmony_ci 1279762338dSopenharmony_civoid LocationGeofenceAdditionalTest::TearDown() {} 1289762338dSopenharmony_ci 1299762338dSopenharmony_ci/** 1309762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0200 1319762338dSopenharmony_ci * @tc.name : testAddGnssGeofence001 1329762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 1339762338dSopenharmony_ci */ 1349762338dSopenharmony_ci#ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE 1359762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence001, Function | MediumTest | Level1) 1369762338dSopenharmony_ci{ 1379762338dSopenharmony_ci GeofenceInfo fence; 1389762338dSopenharmony_ci fence.fenceIndex = 1; 1399762338dSopenharmony_ci fence.latitude = 1.00; 1409762338dSopenharmony_ci fence.longitude = 1.00; 1419762338dSopenharmony_ci fence.radius = 1.00; 1429762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 1439762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 1449762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 1459762338dSopenharmony_ci} 1469762338dSopenharmony_ci 1479762338dSopenharmony_ci/** 1489762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0300 1499762338dSopenharmony_ci * @tc.name : testAddGnssGeofence002 1509762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED 100times. 1519762338dSopenharmony_ci */ 1529762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence002, Function | MediumTest | Level1) 1539762338dSopenharmony_ci{ 1549762338dSopenharmony_ci int32_t ret = 0; 1559762338dSopenharmony_ci GeofenceInfo fence; 1569762338dSopenharmony_ci fence.fenceIndex = 1; 1579762338dSopenharmony_ci fence.latitude = 1.00; 1589762338dSopenharmony_ci fence.longitude = 1.00; 1599762338dSopenharmony_ci fence.radius = 1.00; 1609762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 1619762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 1629762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 1639762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 1649762338dSopenharmony_ci } 1659762338dSopenharmony_ci} 1669762338dSopenharmony_ci 1679762338dSopenharmony_ci/** 1689762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0400 1699762338dSopenharmony_ci * @tc.name : testAddGnssGeofence003 1709762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 1719762338dSopenharmony_ci */ 1729762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence003, Function | MediumTest | Level1) 1739762338dSopenharmony_ci{ 1749762338dSopenharmony_ci GeofenceInfo fence; 1759762338dSopenharmony_ci fence.fenceIndex = 1; 1769762338dSopenharmony_ci fence.latitude = 180.00; 1779762338dSopenharmony_ci fence.longitude = 1.00; 1789762338dSopenharmony_ci fence.radius = 1.00; 1799762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 1809762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 1819762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 1829762338dSopenharmony_ci} 1839762338dSopenharmony_ci 1849762338dSopenharmony_ci/** 1859762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0500 1869762338dSopenharmony_ci * @tc.name : testAddGnssGeofence004 1879762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 1889762338dSopenharmony_ci */ 1899762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence004, Function | MediumTest | Level1) 1909762338dSopenharmony_ci{ 1919762338dSopenharmony_ci GeofenceInfo fence; 1929762338dSopenharmony_ci fence.fenceIndex = 1; 1939762338dSopenharmony_ci fence.latitude = 180.00; 1949762338dSopenharmony_ci fence.longitude = 1.00; 1959762338dSopenharmony_ci fence.radius = 1.00; 1969762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 1979762338dSopenharmony_ci int32_t ret = 0; 1989762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 1999762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 2009762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 2019762338dSopenharmony_ci } 2029762338dSopenharmony_ci} 2039762338dSopenharmony_ci 2049762338dSopenharmony_ci/** 2059762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0600 2069762338dSopenharmony_ci * @tc.name : testAddGnssGeofence005 2079762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 2089762338dSopenharmony_ci */ 2099762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence005, Function | MediumTest | Level1) 2109762338dSopenharmony_ci{ 2119762338dSopenharmony_ci GeofenceInfo fence; 2129762338dSopenharmony_ci fence.fenceIndex = 1; 2139762338dSopenharmony_ci fence.latitude = 1.00; 2149762338dSopenharmony_ci fence.longitude = 180.00; 2159762338dSopenharmony_ci fence.radius = 1.00; 2169762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 2179762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 2189762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 2199762338dSopenharmony_ci} 2209762338dSopenharmony_ci 2219762338dSopenharmony_ci/** 2229762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0700 2239762338dSopenharmony_ci * @tc.name : testAddGnssGeofence006 2249762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 2259762338dSopenharmony_ci */ 2269762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence006, Function | MediumTest | Level1) 2279762338dSopenharmony_ci{ 2289762338dSopenharmony_ci GeofenceInfo fence; 2299762338dSopenharmony_ci fence.fenceIndex = 1; 2309762338dSopenharmony_ci fence.latitude = 1.00; 2319762338dSopenharmony_ci fence.longitude = 180.00; 2329762338dSopenharmony_ci fence.radius = 1.00; 2339762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 2349762338dSopenharmony_ci int32_t ret = 0; 2359762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 2369762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 2379762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 2389762338dSopenharmony_ci } 2399762338dSopenharmony_ci} 2409762338dSopenharmony_ci 2419762338dSopenharmony_ci/** 2429762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0800 2439762338dSopenharmony_ci * @tc.name : testAddGnssGeofence007 2449762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 2459762338dSopenharmony_ci */ 2469762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence007, Function | MediumTest | Level1) 2479762338dSopenharmony_ci{ 2489762338dSopenharmony_ci GeofenceInfo fence; 2499762338dSopenharmony_ci fence.fenceIndex = 1; 2509762338dSopenharmony_ci fence.latitude = 180.00; 2519762338dSopenharmony_ci fence.longitude = 180.00; 2529762338dSopenharmony_ci fence.radius = 1.00; 2539762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 2549762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 2559762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 2569762338dSopenharmony_ci} 2579762338dSopenharmony_ci 2589762338dSopenharmony_ci/** 2599762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_0900 2609762338dSopenharmony_ci * @tc.name : testAddGnssGeofence008 2619762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 2629762338dSopenharmony_ci */ 2639762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence008, Function | MediumTest | Level1) 2649762338dSopenharmony_ci{ 2659762338dSopenharmony_ci GeofenceInfo fence; 2669762338dSopenharmony_ci fence.fenceIndex = 1; 2679762338dSopenharmony_ci fence.latitude = 180.00; 2689762338dSopenharmony_ci fence.longitude = 180.00; 2699762338dSopenharmony_ci fence.radius = 1.00; 2709762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 2719762338dSopenharmony_ci int32_t ret = 0; 2729762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 2739762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 2749762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 2759762338dSopenharmony_ci } 2769762338dSopenharmony_ci} 2779762338dSopenharmony_ci 2789762338dSopenharmony_ci/** 2799762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1000 2809762338dSopenharmony_ci * @tc.name : testAddGnssGeofence009 2819762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 2829762338dSopenharmony_ci */ 2839762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence009, Function | MediumTest | Level1) 2849762338dSopenharmony_ci{ 2859762338dSopenharmony_ci GeofenceInfo fence; 2869762338dSopenharmony_ci fence.fenceIndex = 1; 2879762338dSopenharmony_ci fence.latitude = 180.00; 2889762338dSopenharmony_ci fence.longitude = 180.00; 2899762338dSopenharmony_ci fence.radius = 180.00; 2909762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 2919762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 2929762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 2939762338dSopenharmony_ci} 2949762338dSopenharmony_ci 2959762338dSopenharmony_ci/** 2969762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1100 2979762338dSopenharmony_ci * @tc.name : testAddGnssGeofence010 2989762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 2999762338dSopenharmony_ci */ 3009762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence010, Function | MediumTest | Level1) 3019762338dSopenharmony_ci{ 3029762338dSopenharmony_ci GeofenceInfo fence; 3039762338dSopenharmony_ci fence.fenceIndex = 1; 3049762338dSopenharmony_ci fence.latitude = 1.00; 3059762338dSopenharmony_ci fence.longitude = 1.00; 3069762338dSopenharmony_ci fence.radius = 1.00; 3079762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 3089762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 3099762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 3109762338dSopenharmony_ci} 3119762338dSopenharmony_ci 3129762338dSopenharmony_ci/** 3139762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1200 3149762338dSopenharmony_ci * @tc.name : testAddGnssGeofence011 3159762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED 100times. 3169762338dSopenharmony_ci */ 3179762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence011, Function | MediumTest | Level1) 3189762338dSopenharmony_ci{ 3199762338dSopenharmony_ci int32_t ret = 0; 3209762338dSopenharmony_ci GeofenceInfo fence; 3219762338dSopenharmony_ci fence.fenceIndex = 1; 3229762338dSopenharmony_ci fence.latitude = 1.00; 3239762338dSopenharmony_ci fence.longitude = 1.00; 3249762338dSopenharmony_ci fence.radius = 1.00; 3259762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 3269762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 3279762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 3289762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 3299762338dSopenharmony_ci } 3309762338dSopenharmony_ci} 3319762338dSopenharmony_ci 3329762338dSopenharmony_ci/** 3339762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1300 3349762338dSopenharmony_ci * @tc.name : testAddGnssGeofence012 3359762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 3369762338dSopenharmony_ci */ 3379762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence012, Function | MediumTest | Level1) 3389762338dSopenharmony_ci{ 3399762338dSopenharmony_ci GeofenceInfo fence; 3409762338dSopenharmony_ci fence.fenceIndex = 1; 3419762338dSopenharmony_ci fence.latitude = 180.00; 3429762338dSopenharmony_ci fence.longitude = 1.00; 3439762338dSopenharmony_ci fence.radius = 1.00; 3449762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 3459762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 3469762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 3479762338dSopenharmony_ci} 3489762338dSopenharmony_ci 3499762338dSopenharmony_ci/** 3509762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1400 3519762338dSopenharmony_ci * @tc.name : testAddGnssGeofence013 3529762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 3539762338dSopenharmony_ci */ 3549762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence013, Function | MediumTest | Level1) 3559762338dSopenharmony_ci{ 3569762338dSopenharmony_ci GeofenceInfo fence; 3579762338dSopenharmony_ci fence.fenceIndex = 1; 3589762338dSopenharmony_ci fence.latitude = 180.00; 3599762338dSopenharmony_ci fence.longitude = 1.00; 3609762338dSopenharmony_ci fence.radius = 1.00; 3619762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 3629762338dSopenharmony_ci int32_t ret = 0; 3639762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 3649762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 3659762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 3669762338dSopenharmony_ci } 3679762338dSopenharmony_ci} 3689762338dSopenharmony_ci 3699762338dSopenharmony_ci/** 3709762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1500 3719762338dSopenharmony_ci * @tc.name : testAddGnssGeofence014 3729762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 3739762338dSopenharmony_ci */ 3749762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence014, Function | MediumTest | Level1) 3759762338dSopenharmony_ci{ 3769762338dSopenharmony_ci GeofenceInfo fence; 3779762338dSopenharmony_ci fence.fenceIndex = 1; 3789762338dSopenharmony_ci fence.latitude = 1.00; 3799762338dSopenharmony_ci fence.longitude = 180.00; 3809762338dSopenharmony_ci fence.radius = 1.00; 3819762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 3829762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 3839762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 3849762338dSopenharmony_ci} 3859762338dSopenharmony_ci 3869762338dSopenharmony_ci/** 3879762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1600 3889762338dSopenharmony_ci * @tc.name : testAddGnssGeofence015 3899762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 3909762338dSopenharmony_ci */ 3919762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence015, Function | MediumTest | Level1) 3929762338dSopenharmony_ci{ 3939762338dSopenharmony_ci GeofenceInfo fence; 3949762338dSopenharmony_ci fence.fenceIndex = 1; 3959762338dSopenharmony_ci fence.latitude = 1.00; 3969762338dSopenharmony_ci fence.longitude = 180.00; 3979762338dSopenharmony_ci fence.radius = 1.00; 3989762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 3999762338dSopenharmony_ci int32_t ret = 0; 4009762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 4019762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 4029762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 4039762338dSopenharmony_ci } 4049762338dSopenharmony_ci} 4059762338dSopenharmony_ci 4069762338dSopenharmony_ci/** 4079762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1700 4089762338dSopenharmony_ci * @tc.name : testAddGnssGeofence016 4099762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 4109762338dSopenharmony_ci */ 4119762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence016, Function | MediumTest | Level1) 4129762338dSopenharmony_ci{ 4139762338dSopenharmony_ci GeofenceInfo fence; 4149762338dSopenharmony_ci fence.fenceIndex = 1; 4159762338dSopenharmony_ci fence.latitude = 180.00; 4169762338dSopenharmony_ci fence.longitude = 180.00; 4179762338dSopenharmony_ci fence.radius = 1.00; 4189762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 4199762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 4209762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 4219762338dSopenharmony_ci} 4229762338dSopenharmony_ci 4239762338dSopenharmony_ci/** 4249762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1800 4259762338dSopenharmony_ci * @tc.name : testAddGnssGeofence017 4269762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 4279762338dSopenharmony_ci */ 4289762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence017, Function | MediumTest | Level1) 4299762338dSopenharmony_ci{ 4309762338dSopenharmony_ci GeofenceInfo fence; 4319762338dSopenharmony_ci fence.fenceIndex = 1; 4329762338dSopenharmony_ci fence.latitude = 180.00; 4339762338dSopenharmony_ci fence.longitude = 180.00; 4349762338dSopenharmony_ci fence.radius = 1.00; 4359762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 4369762338dSopenharmony_ci int32_t ret = 0; 4379762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 4389762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 4399762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 4409762338dSopenharmony_ci } 4419762338dSopenharmony_ci} 4429762338dSopenharmony_ci 4439762338dSopenharmony_ci/** 4449762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_1900 4459762338dSopenharmony_ci * @tc.name : testAddGnssGeofence018 4469762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_ENTERED. 4479762338dSopenharmony_ci */ 4489762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence018, Function | MediumTest | Level1) 4499762338dSopenharmony_ci{ 4509762338dSopenharmony_ci GeofenceInfo fence; 4519762338dSopenharmony_ci fence.fenceIndex = 1; 4529762338dSopenharmony_ci fence.latitude = 180.00; 4539762338dSopenharmony_ci fence.longitude = 180.00; 4549762338dSopenharmony_ci fence.radius = 180.00; 4559762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_ENTERED; 4569762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 4579762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 4589762338dSopenharmony_ci} 4599762338dSopenharmony_ci 4609762338dSopenharmony_ci/** 4619762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2000 4629762338dSopenharmony_ci * @tc.name : testAddGnssGeofence019 4639762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 4649762338dSopenharmony_ci */ 4659762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence019, Function | MediumTest | Level1) 4669762338dSopenharmony_ci{ 4679762338dSopenharmony_ci GeofenceInfo fence; 4689762338dSopenharmony_ci fence.fenceIndex = 1; 4699762338dSopenharmony_ci fence.latitude = 1.00; 4709762338dSopenharmony_ci fence.longitude = 1.00; 4719762338dSopenharmony_ci fence.radius = 1.00; 4729762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 4739762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 4749762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 4759762338dSopenharmony_ci} 4769762338dSopenharmony_ci 4779762338dSopenharmony_ci/** 4789762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2100 4799762338dSopenharmony_ci * @tc.name : testAddGnssGeofence020 4809762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED 100times. 4819762338dSopenharmony_ci */ 4829762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence020, Function | MediumTest | Level1) 4839762338dSopenharmony_ci{ 4849762338dSopenharmony_ci int32_t ret = 0; 4859762338dSopenharmony_ci GeofenceInfo fence; 4869762338dSopenharmony_ci fence.fenceIndex = 1; 4879762338dSopenharmony_ci fence.latitude = 1.00; 4889762338dSopenharmony_ci fence.longitude = 1.00; 4899762338dSopenharmony_ci fence.radius = 1.00; 4909762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 4919762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 4929762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 4939762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 4949762338dSopenharmony_ci } 4959762338dSopenharmony_ci} 4969762338dSopenharmony_ci 4979762338dSopenharmony_ci/** 4989762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2200 4999762338dSopenharmony_ci * @tc.name : testAddGnssGeofence021 5009762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 5019762338dSopenharmony_ci */ 5029762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence021, Function | MediumTest | Level1) 5039762338dSopenharmony_ci{ 5049762338dSopenharmony_ci GeofenceInfo fence; 5059762338dSopenharmony_ci fence.fenceIndex = 1; 5069762338dSopenharmony_ci fence.latitude = 180.00; 5079762338dSopenharmony_ci fence.longitude = 1.00; 5089762338dSopenharmony_ci fence.radius = 1.00; 5099762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 5109762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 5119762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 5129762338dSopenharmony_ci} 5139762338dSopenharmony_ci 5149762338dSopenharmony_ci/** 5159762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2300 5169762338dSopenharmony_ci * @tc.name : testAddGnssGeofence022 5179762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 5189762338dSopenharmony_ci */ 5199762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence022, Function | MediumTest | Level1) 5209762338dSopenharmony_ci{ 5219762338dSopenharmony_ci GeofenceInfo fence; 5229762338dSopenharmony_ci fence.fenceIndex = 1; 5239762338dSopenharmony_ci fence.latitude = 180.00; 5249762338dSopenharmony_ci fence.longitude = 1.00; 5259762338dSopenharmony_ci fence.radius = 1.00; 5269762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 5279762338dSopenharmony_ci int32_t ret = 0; 5289762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 5299762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 5309762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 5319762338dSopenharmony_ci } 5329762338dSopenharmony_ci} 5339762338dSopenharmony_ci 5349762338dSopenharmony_ci/** 5359762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2400 5369762338dSopenharmony_ci * @tc.name : testAddGnssGeofence023 5379762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 5389762338dSopenharmony_ci */ 5399762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence023, Function | MediumTest | Level1) 5409762338dSopenharmony_ci{ 5419762338dSopenharmony_ci GeofenceInfo fence; 5429762338dSopenharmony_ci fence.fenceIndex = 1; 5439762338dSopenharmony_ci fence.latitude = 1.00; 5449762338dSopenharmony_ci fence.longitude = 180.00; 5459762338dSopenharmony_ci fence.radius = 1.00; 5469762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 5479762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 5489762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 5499762338dSopenharmony_ci} 5509762338dSopenharmony_ci 5519762338dSopenharmony_ci/** 5529762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2500 5539762338dSopenharmony_ci * @tc.name : testAddGnssGeofence024 5549762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 5559762338dSopenharmony_ci */ 5569762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence024, Function | MediumTest | Level1) 5579762338dSopenharmony_ci{ 5589762338dSopenharmony_ci GeofenceInfo fence; 5599762338dSopenharmony_ci fence.fenceIndex = 1; 5609762338dSopenharmony_ci fence.latitude = 1.00; 5619762338dSopenharmony_ci fence.longitude = 180.00; 5629762338dSopenharmony_ci fence.radius = 1.00; 5639762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 5649762338dSopenharmony_ci int32_t ret = 0; 5659762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 5669762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 5679762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 5689762338dSopenharmony_ci } 5699762338dSopenharmony_ci} 5709762338dSopenharmony_ci 5719762338dSopenharmony_ci/** 5729762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2600 5739762338dSopenharmony_ci * @tc.name : testAddGnssGeofence025 5749762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 5759762338dSopenharmony_ci */ 5769762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence025, Function | MediumTest | Level1) 5779762338dSopenharmony_ci{ 5789762338dSopenharmony_ci GeofenceInfo fence; 5799762338dSopenharmony_ci fence.fenceIndex = 1; 5809762338dSopenharmony_ci fence.latitude = 180.00; 5819762338dSopenharmony_ci fence.longitude = 180.00; 5829762338dSopenharmony_ci fence.radius = 1.00; 5839762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 5849762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 5859762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 5869762338dSopenharmony_ci} 5879762338dSopenharmony_ci 5889762338dSopenharmony_ci/** 5899762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2700 5909762338dSopenharmony_ci * @tc.name : testAddGnssGeofence026 5919762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 5929762338dSopenharmony_ci */ 5939762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence026, Function | MediumTest | Level1) 5949762338dSopenharmony_ci{ 5959762338dSopenharmony_ci GeofenceInfo fence; 5969762338dSopenharmony_ci fence.fenceIndex = 1; 5979762338dSopenharmony_ci fence.latitude = 180.00; 5989762338dSopenharmony_ci fence.longitude = 180.00; 5999762338dSopenharmony_ci fence.radius = 1.00; 6009762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 6019762338dSopenharmony_ci int32_t ret = 0; 6029762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 6039762338dSopenharmony_ci ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 6049762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 6059762338dSopenharmony_ci } 6069762338dSopenharmony_ci} 6079762338dSopenharmony_ci 6089762338dSopenharmony_ci/** 6099762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_AddGnssGeofence_2800 6109762338dSopenharmony_ci * @tc.name : testAddGnssGeofence027 6119762338dSopenharmony_ci * @tc.desc : Call function AddGnssGeofence with GeofenceEvent as GEOFENCE_EVENT_EXITED. 6129762338dSopenharmony_ci */ 6139762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testAddGnssGeofence027, Function | MediumTest | Level1) 6149762338dSopenharmony_ci{ 6159762338dSopenharmony_ci GeofenceInfo fence; 6169762338dSopenharmony_ci fence.fenceIndex = 1; 6179762338dSopenharmony_ci fence.latitude = 180.00; 6189762338dSopenharmony_ci fence.longitude = 180.00; 6199762338dSopenharmony_ci fence.radius = 180.00; 6209762338dSopenharmony_ci GeofenceEvent geoevent = GeofenceEvent::GEOFENCE_EVENT_EXITED; 6219762338dSopenharmony_ci int32_t ret = g_igeofenceHci->AddGnssGeofence(fence, geoevent); 6229762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 6239762338dSopenharmony_ci} 6249762338dSopenharmony_ci 6259762338dSopenharmony_ci/** 6269762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_DeleteGnssGeofence_0200 6279762338dSopenharmony_ci * @tc.name : testDeleteGnssGeofence001 6289762338dSopenharmony_ci * @tc.desc : Call function DeleteGnssGeofence with fenceIndex as 5 100times. 6299762338dSopenharmony_ci */ 6309762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testDeleteGnssGeofence001, Function | MediumTest | Level1) 6319762338dSopenharmony_ci{ 6329762338dSopenharmony_ci int fenceIndex = 5; 6339762338dSopenharmony_ci int32_t ret = 0; 6349762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 6359762338dSopenharmony_ci ret = g_igeofenceHci->DeleteGnssGeofence(fenceIndex); 6369762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 6379762338dSopenharmony_ci } 6389762338dSopenharmony_ci} 6399762338dSopenharmony_ci 6409762338dSopenharmony_ci/** 6419762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_DeleteGnssGeofence_0300 6429762338dSopenharmony_ci * @tc.name : testDeleteGnssGeofence002 6439762338dSopenharmony_ci * @tc.desc : Call function DeleteGnssGeofence with fenceIndex as 0. 6449762338dSopenharmony_ci */ 6459762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testDeleteGnssGeofence002, Function | MediumTest | Level1) 6469762338dSopenharmony_ci{ 6479762338dSopenharmony_ci int fenceIndex = 0; 6489762338dSopenharmony_ci int32_t ret = g_igeofenceHci->DeleteGnssGeofence(fenceIndex); 6499762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 6509762338dSopenharmony_ci} 6519762338dSopenharmony_ci 6529762338dSopenharmony_ci/** 6539762338dSopenharmony_ci * @tc.number: SUB_Location_Geofence_SetGeofenceCallback_0200 6549762338dSopenharmony_ci * @tc.name : testSetGeofenceCallback001 6559762338dSopenharmony_ci * @tc.desc : Call function SetGeofenceCallback 100times. 6569762338dSopenharmony_ci */ 6579762338dSopenharmony_ciHWTEST_F(LocationGeofenceAdditionalTest, testSetGeofenceCallback001, Function | MediumTest | Level1) 6589762338dSopenharmony_ci{ 6599762338dSopenharmony_ci int32_t ret = 0; 6609762338dSopenharmony_ci sptr<IGeofenceCallback> geo_callback = new (std::nothrow) GeofenceCallbackImpl(); 6619762338dSopenharmony_ci if (geo_callback == nullptr) { 6629762338dSopenharmony_ci ASSERT_NE(nullptr, geo_callback); 6639762338dSopenharmony_ci return; 6649762338dSopenharmony_ci } 6659762338dSopenharmony_ci for (int i = 0; i < 100; i++) { 6669762338dSopenharmony_ci ret = g_igeofenceHci->SetGeofenceCallback(geo_callback); 6679762338dSopenharmony_ci EXPECT_EQ(HDF_SUCCESS, ret); 6689762338dSopenharmony_ci } 6699762338dSopenharmony_ci} 6709762338dSopenharmony_ci#endif