# Copyright (C) 2023-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("//foundation/filemanagement/dfs_service/distributedfile.gni") ohos_unittest("cloud_pref_impl_test") { module_out_path = "filemanagement/dfs_service" sources = [ "../../../../../distributeddatamgr/preferences/frameworks/native/src/preferences_value.cpp", "../../../utils/preference/src/cloud_pref_impl.cpp", "../../mock/preference_helper_mock.cpp", "./preference/cloud_pref_impl_test.cpp", ] include_dirs = [ "${services_path}/cloudsyncservice/include/ipc", "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include", "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", "${distributedfile_path}/utils/dentry/include", "${distributedfile_path}/utils/log/include", "${distributedfile_path}/utils/preference/include", "../../../../../distributeddatamgr/preferences/interfaces/inner_api/include", "../../../../../distributeddatamgr/preferences/frameworks/native/include", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "dfs_service:cloudsync_kit_inner", "hilog:libhilog", "ipc:ipc_single", ] defines = [ "private=public" ] defines += [ "LOG_DOMAIN=0xD004307", "LOG_TAG=\"UTILS\"", ] use_exceptions = true } ohos_unittest("utils_directory_test") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true cfi = true cfi_cross_dso = true debug = false blocklist = "${distributedfile_path}/cfi_blocklist.txt" } module_out_path = "filemanagement/dfs_service" sources = [ "./system/utils_directory_test.cpp" ] include_dirs = [ "${utils_path}/system/include", "${utils_path}/log/include", "//foundation/multimedia/image_framework/mock/native/include/log/", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "json:nlohmann_json_static", ] defines = [ "private=public" ] defines += [ "LOG_DOMAIN=0xD004307", "LOG_TAG=\"CLOUDSYNC_SA\"", ] use_exceptions = true } ohos_unittest("cloud_file_utils_test") { module_out_path = "filemanagement/dfs_service" sources = [ "./cloud_disk/cloud_file_utils_test.cpp" ] include_dirs = [ "${utils_path}/cloud_disk/include", "${utils_path}/log/include", "//foundation/multimedia/image_framework/mock/native/include/log/", ] deps = [ "${utils_path}:libdistributedfiledentry", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "hilog:libhilog", ] defines = [ "private=public" ] defines += [ "LOG_DOMAIN=0xD004307", "LOG_TAG=\"CLOUDSYNC_SA\"", ] use_exceptions = true } ohos_unittest("plugin_loader_test") { module_out_path = "filemanagement/dfs_service" sources = [ "./load/plugin_loader_test.cpp" ] include_dirs = [ "${utils_path}/load/include", "${utils_path}/load/src", ] deps = [ "${utils_path}:libdistributedfileutils", "${utils_path}:libdistributedfileutils_lite", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "hilog:libhilog", ] defines = [ "private=public" ] defines += [ "LOG_DOMAIN=0xD004307", "LOG_TAG=\"UTILS\"", ] use_exceptions = true } group("utils_test") { testonly = true deps = [ ":cloud_file_utils_test", ":cloud_pref_impl_test", ":plugin_loader_test", ":utils_directory_test", ] }