1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "geofence_sdk_test.h"
17 #include "location_log.h"
18
19 using namespace testing::ext;
20 namespace OHOS {
21 namespace Location {
SetUp()22 void GeofenceSdkTest::SetUp()
23 {
24 geofenceManager_ = GeofenceManager::GetInstance();
25 }
26
TearDown()27 void GeofenceSdkTest::TearDown()
28 {
29 }
30
31 HWTEST_F(GeofenceSdkTest, AddGnssGeofenceTest001, TestSize.Level1)
32 {
33 GTEST_LOG_(INFO)
34 << "GeofenceSdkTest, AddGnssGeofenceTest001, TestSize.Level1";
35 LBSLOGI(GEOFENCE_SDK_TEST, "[GeofenceSdkTest] AddGnssGeofenceTest001 begin");
36 ASSERT_TRUE(geofenceManager_ != nullptr);
37 std::shared_ptr<GeofenceRequest> gnssGeofenceRequest = std::make_shared<GeofenceRequest>();
38 geofenceManager_->AddGnssGeofence(gnssGeofenceRequest);
39 LBSLOGI(GEOFENCE_SDK_TEST, "[GeofenceSdkTest] AddGnssGeofenceTest001 end");
40 }
41
42 HWTEST_F(GeofenceSdkTest, RemoveGnssGeofenceTest001, TestSize.Level1)
43 {
44 GTEST_LOG_(INFO)
45 << "GeofenceSdkTest, RemoveGnssGeofenceTest001, TestSize.Level1";
46 LBSLOGI(GEOFENCE_SDK_TEST, "[GeofenceSdkTest] RemoveGnssGeofenceTest001 begin");
47 ASSERT_TRUE(geofenceManager_ != nullptr);
48 std::shared_ptr<GeofenceRequest> gnssGeofenceRequest = std::make_shared<GeofenceRequest>();
49 geofenceManager_->RemoveGnssGeofence(gnssGeofenceRequest);
50 LBSLOGI(GEOFENCE_SDK_TEST, "[GeofenceSdkTest] RemoveGnssGeofenceTest001 end");
51 }
52
53 HWTEST_F(GeofenceSdkTest, GetGeofenceSupportedCoordTypesTest001, TestSize.Level1)
54 {
55 GTEST_LOG_(INFO)
56 << "GeofenceSdkTest, GetGeofenceSupportedCoordTypesTest001, TestSize.Level1";
57 LBSLOGI(GEOFENCE_SDK_TEST, "[GeofenceSdkTest] GetGeofenceSupportedCoordTypesTest001 begin");
58 ASSERT_TRUE(geofenceManager_ != nullptr);
59 std::vector<CoordinateSystemType> coordinateSystemTypes;
60 geofenceManager_->GetGeofenceSupportedCoordTypes(coordinateSystemTypes);
61 LBSLOGI(GEOFENCE_SDK_TEST, "[GeofenceSdkTest] GetGeofenceSupportedCoordTypesTest001 end");
62 }
63 } // namespace Location
64 } // namespace OHOS