1# Copyright (c) 2022-2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/test.gni") 15import("../../../../access_token.gni") 16 17ohos_unittest("libdatabase_test") { 18 subsystem_name = "security" 19 part_name = "access_token" 20 module_out_path = part_name + "/" + part_name 21 sanitize = { 22 cfi = true 23 cfi_cross_dso = true 24 debug = false 25 } 26 branch_protector_ret = "pac_ret" 27 28 include_dirs = [ 29 "${access_token_path}/frameworks/accesstoken/include", 30 "${access_token_path}/frameworks/common/include", 31 "${access_token_path}/interfaces/innerkits/accesstoken/include", 32 "${access_token_path}/services/common/database/include", 33 "${access_token_path}/services/accesstokenmanager/main/cpp/include/callback", 34 "${access_token_path}/services/accesstokenmanager/main/cpp/include/database", 35 "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission", 36 "${access_token_path}/services/accesstokenmanager/main/cpp/include/token", 37 "//third_party/googletest/include", 38 ] 39 40 sources = [ 41 "${access_token_path}/services/accesstokenmanager/main/cpp/src/callback/permission_state_change_callback_proxy.cpp", 42 "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/access_token_db.cpp", 43 "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/data_translator.cpp", 44 "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/token_field_const.cpp", 45 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_validator.cpp", 46 "unittest/database_test.cpp", 47 ] 48 49 configs = [ "${access_token_path}/config:coverage_flags" ] 50 51 cflags_cc = [ "-DHILOG_ENABLE" ] 52 53 deps = [ 54 "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", 55 "${access_token_path}/frameworks/common:accesstoken_common_cxx", 56 "${access_token_path}/services/common:accesstoken_service_common", 57 "//third_party/sqlite:sqlite", 58 ] 59 60 external_deps = [ 61 "c_utils:utils", 62 "hilog:libhilog", 63 "hisysevent:libhisysevent", 64 "ipc:ipc_core", 65 ] 66} 67 68group("unittest") { 69 testonly = true 70 deps = [ ":libdatabase_test" ] 71} 72