1# Copyright (c) 2021-2025 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("//foundation/filemanagement/storage_service/storage_service_aafwk.gni") 16 17ohos_unittest("file_utils_test") { 18 branch_protector_ret = "pac_ret" 19 sanitize = { 20 integer_overflow = true 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 module_out_path = "storage_service/storage_service/storage_daemon" 26 27 defines = [ 28 "STORAGE_LOG_TAG = \"StorageDaemon\"", 29 "LOG_DOMAIN = 0xD004301", 30 ] 31 32 include_dirs = [ 33 "${storage_daemon_path}/include", 34 "${storage_service_common_path}/include", 35 "${storage_interface_path}/innerkits/storage_manager/native", 36 ] 37 38 sources = [ 39 "common/help_utils.cpp", 40 "file_utils_test.cpp", 41 ] 42 43 deps = [ 44 "${storage_daemon_path}:storage_common_utils", 45 "${storage_daemon_path}:storage_daemon_header", 46 ] 47 48 external_deps = [ 49 "c_utils:utils", 50 "googletest:gmock_main", 51 "googletest:gtest_main", 52 "hilog:libhilog", 53 "ipc:ipc_single", 54 "ipc:libdbinder", 55 "init:libbegetutil", 56 ] 57} 58 59ohos_unittest("hi_audit_test") { 60 branch_protector_ret = "pac_ret" 61 sanitize = { 62 integer_overflow = true 63 cfi = true 64 cfi_cross_dso = true 65 debug = false 66 } 67 module_out_path = "storage_service/storage_service/storage_daemon" 68 69 defines = [ 70 "STORAGE_LOG_TAG = \"StorageDaemon\"", 71 "LOG_DOMAIN = 0xD004301", 72 "private = public", 73 ] 74 75 include_dirs = [ 76 "${storage_daemon_path}/include", 77 "${storage_service_common_path}/include", 78 "${storage_interface_path}/innerkits/storage_manager/native", 79 ] 80 81 sources = [ "hi_audit_test.cpp" ] 82 83 deps = [ "${storage_daemon_path}:storage_common_utils" ] 84 85 external_deps = [ 86 "c_utils:utils", 87 "googletest:gtest_main", 88 "hilog:libhilog", 89 "hisysevent:libhisysevent", 90 "ipc:ipc_single", 91 "ipc:libdbinder", 92 ] 93} 94 95ohos_unittest("storage_statistics_radar_test") { 96 branch_protector_ret = "pac_ret" 97 sanitize = { 98 integer_overflow = true 99 cfi = true 100 cfi_cross_dso = true 101 debug = false 102 } 103 module_out_path = "storage_service/storage_service/storage_daemon" 104 105 defines = [ 106 "STORAGE_LOG_TAG = \"StorageDaemon\"", 107 "LOG_DOMAIN = 0xD004301", 108 "private = public", 109 ] 110 111 include_dirs = [ 112 "${storage_daemon_path}/include", 113 "${storage_service_common_path}/include", 114 "${storage_interface_path}/innerkits/storage_manager/native", 115 ] 116 117 sources = [ "storage_statistic_radar_test.cpp" ] 118 119 deps = [ "${storage_daemon_path}:storage_common_utils" ] 120 121 external_deps = [ 122 "c_utils:utils", 123 "googletest:gmock_main", 124 "googletest:gtest_main", 125 "hilog:libhilog", 126 "huks:libhukssdk", 127 "ipc:ipc_single", 128 "ipc:libdbinder", 129 ] 130} 131 132group("storage_daemon_utils_test") { 133 testonly = true 134 deps = [ 135 ":file_utils_test", 136 ":hi_audit_test", 137 ":storage_statistics_radar_test", 138 ] 139} 140