# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("../../../../access_token.gni") ohos_unittest("libdatabase_test") { subsystem_name = "security" part_name = "access_token" module_out_path = part_name + "/" + part_name sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" include_dirs = [ "${access_token_path}/frameworks/accesstoken/include", "${access_token_path}/frameworks/common/include", "${access_token_path}/interfaces/innerkits/accesstoken/include", "${access_token_path}/services/common/database/include", "${access_token_path}/services/common/utils/include", "${access_token_path}/services/accesstokenmanager/main/cpp/include/callback", "${access_token_path}/services/accesstokenmanager/main/cpp/include/database", "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission", "${access_token_path}/services/accesstokenmanager/main/cpp/include/token", ] sources = [ "${access_token_path}/services/accesstokenmanager/main/cpp/src/callback/accesstoken_callback_proxys.cpp", "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/access_token_db.cpp", "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/access_token_db_util.cpp", "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/access_token_open_callback.cpp", "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/data_translator.cpp", "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/token_field_const.cpp", "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_validator.cpp", "unittest/database_test.cpp", ] configs = [ "${access_token_path}/config:coverage_flags" ] cflags_cc = [ "-DHILOG_ENABLE" ] deps = [ "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", "${access_token_path}/frameworks/common:accesstoken_common_cxx", "${access_token_path}/services/common:accesstoken_service_common", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "relational_store:native_rdb", "sqlite:sqlite", ] } group("unittest") { testonly = true deps = [ ":libdatabase_test" ] }