# Copyright (C) 2023 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_sync_callback_client_test") { module_out_path = "filemanagement/dfs_service" sources = [ "cloud_sync_callback_client_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/log/include", ] deps = [ "//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" ] use_exceptions = true } ohos_unittest("cloud_sync_callback_stub_test") { module_out_path = "filemanagement/dfs_service" sources = [ "cloud_sync_callback_stub_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/log/include", ] deps = [ "//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" ] use_exceptions = true } ohos_unittest("cloud_sync_manager_impl_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 = [ "${distributedfile_path}/test/mock/ipc/cloud_sync_service_proxy_mock.cpp", "cloud_sync_manager_impl_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", "${services_path}/cloudsyncservice/include/ipc", "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include", "${distributedfile_path}/test/mock/ipc", "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", "${distributedfile_path}/utils/log/include", ] deps = [ "${services_path}/cloudsyncservice:cloudsync_sa_static", "//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" ] use_exceptions = true } ohos_unittest("cloud_sync_manager_impl_unnomal_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/test/mock/ipc/cloud_sync_service_proxy_unnomal_mock.cpp", "cloud_sync_manager_impl_unnomal_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", "${services_path}/cloudsyncservice/include/ipc", "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include", "${distributedfile_path}/test/mock/ipc", "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", "${distributedfile_path}/utils/log/include", ] deps = [ "${services_path}/cloudsyncservice:cloudsync_sa_static", "//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" ] use_exceptions = true } ohos_unittest("cloud_sync_manager_test") { module_out_path = "filemanagement/dfs_service" sources = [ "cloud_sync_manager_test.cpp" ] include_dirs = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", ] 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" ] use_exceptions = true } ohos_unittest("cloud_sync_service_proxy_test") { module_out_path = "filemanagement/dfs_service" sources = [ "cloud_sync_service_proxy_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/log/include", ] deps = [ "//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" ] use_exceptions = true } ohos_unittest("cloud_download_callback_client_test") { module_out_path = "filemanagement/dfs_service" sources = [ "cloud_download_callback_client_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}/interfaces/inner_api/native/cloudsync_kit_inner", "${distributedfile_path}/utils/log/include", ] deps = [ "//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", "LOG_DOMAIN=0xD004307", "LOG_TAG=\"CLOUDSYNC_TEST\"", ] use_exceptions = true } ohos_unittest("cloud_download_callback_stub_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_stub.cpp", "../../../mock/cloud_download_uri_manager_hook.cpp", "cloud_download_callback_stub_test.cpp", ] include_dirs = [ "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include", "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", "${distributedfile_path}/utils/log/include", ] deps = [ "//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", "protected=public", "LOG_DOMAIN=0xD004307", "LOG_TAG=\"CLOUDSYNC_TEST\"", ] use_exceptions = true } ohos_unittest("cloud_download_uri_manager_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_uri_manager.cpp", "cloud_download_uri_manager_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", ] 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" ] use_exceptions = true } ohos_unittest("cloud_sync_common_test") { module_out_path = "filemanagement/dfs_service" sources = [ "cloud_sync_common_test.cpp", "file_hook/parcel.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", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "dfs_service:cloudsync_kit_inner", "ipc:ipc_single", ] defines = [ "private=public" ] use_exceptions = true } ohos_unittest("cloud_sync_asset_manager_impl_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_asset_manager_impl.cpp", "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/download_asset_callback_client.cpp", "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/download_asset_callback_stub.cpp", "cloud_sync_asset_manager_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/log/include", ] deps = [ "//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" ] use_exceptions = true } ohos_unittest("cloud_sync_asset_manager_impl_unnomal_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_asset_manager_impl.cpp", "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/download_asset_callback_client.cpp", "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/download_asset_callback_stub.cpp", "${distributedfile_path}/test/mock/ipc/cloud_sync_service_proxy_unnomal_mock.cpp", "cloud_sync_asset_manager_impl_unnomal_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", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "dfs_service:cloudsync_asset_kit_inner", "hilog:libhilog", "ipc:ipc_single", ] defines = [ "private=public" ] use_exceptions = true } ohos_unittest("cloud_sync_asset_manager_test") { module_out_path = "filemanagement/dfs_service" sources = [ "cloud_sync_asset_manager_test.cpp" ] include_dirs = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "dfs_service:cloudsync_asset_kit_inner", "hilog:libhilog", "ipc:ipc_single", ] defines = [ "private=public" ] use_exceptions = true } ohos_unittest("download_asset_callback_client_test") { module_out_path = "filemanagement/dfs_service" sources = [ "download_asset_callback_client_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}/interfaces/inner_api/native/cloudsync_kit_inner", ] 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", "LOG_DOMAIN=0xD004307", "LOG_TAG=\"CLOUDSYNC_TEST\"", ] use_exceptions = true } ohos_unittest("download_asset_callback_stub_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/download_asset_callback_stub.cpp", "../../../mock/cloud_download_uri_manager_hook.cpp", "download_asset_callback_stub_test.cpp", ] include_dirs = [ "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include", "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", ] 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", "protected=public", "LOG_DOMAIN=0xD004307", "LOG_TAG=\"CLOUDSYNC_TEST\"", ] use_exceptions = true } group("cloudsync_impl_test") { testonly = true deps = [ ":cloud_download_callback_client_test", ":cloud_download_callback_stub_test", ":cloud_download_uri_manager_test", ":cloud_sync_asset_manager_impl_test", ":cloud_sync_asset_manager_impl_unnomal_test", ":cloud_sync_asset_manager_test", ":cloud_sync_callback_client_test", ":cloud_sync_callback_stub_test", ":cloud_sync_common_test", ":cloud_sync_manager_impl_test", ":cloud_sync_manager_impl_unnomal_test", ":cloud_sync_manager_test", ":cloud_sync_service_proxy_test", ":download_asset_callback_client_test", ":download_asset_callback_stub_test", ] }