# Copyright (C) 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("distributed_file_daemon_proxy_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}/frameworks/native/distributed_file_inner/src/distributed_file_daemon_proxy.cpp", "${distributedfile_path}/test/mock/message_parcel_mock.cpp", "distributed_file_daemon_proxy_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/test/mock", "${distributedfile_path}/test/unittests/distributed_file_daemon/include", "include", "${services_path}/distributedfiledaemon/include/", "${services_path}/distributedfiledaemon/include/ipc", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "device_manager:devicemanagersdk", "hilog:libhilog", "ipc:ipc_core", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("file_trans_listener_stub_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}/frameworks/native/distributed_file_inner/src/file_trans_listener_stub.cpp", "${distributedfile_path}/test/mock/message_parcel_mock.cpp", "file_trans_listener_stub_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/test/mock", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "device_manager:devicemanagersdk", "hilog:libhilog", "ipc:ipc_core", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("asset_recv_callback_stub_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}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp", "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_recv_callback_stub.cpp", "asset/asset_recv_callback_stub_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/test/unittests/distributed_file_daemon/include", "include", "${services_path}/distributedfiledaemon/include/", "${services_path}/distributedfiledaemon/include/ipc", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "device_manager:devicemanagersdk", "hilog:libhilog", "ipc:ipc_core", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("asset_send_callback_stub_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}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp", "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_send_callback_stub.cpp", "asset/asset_send_callback_stub_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/test/unittests/distributed_file_daemon/include", "include", "${services_path}/distributedfiledaemon/include/", "${services_path}/distributedfiledaemon/include/ipc", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "device_manager:devicemanagersdk", "hilog:libhilog", "ipc:ipc_core", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } group("distributed_file_inner") { testonly = true deps = [ ":asset_recv_callback_stub_test", ":asset_send_callback_stub_test", ":distributed_file_daemon_proxy_test", ":file_trans_listener_stub_test", ] }