• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("disk_manager_service_test") {
18  branch_protector_ret = "pac_ret"
19  sanitize = {
20    integer_overflow = true
21    ubsan = true
22    boundary_sanitize = true
23    cfi = true
24    cfi_cross_dso = true
25    debug = false
26    blocklist = "${storage_service_path}/cfi_blocklist.txt"
27  }
28  module_out_path = "storage_service/storage_service/storage_manager"
29
30  sources = [
31    "${storage_daemon_path}/mock/file_utils_mock.cpp",
32    "${storage_manager_path}/disk/src/disk_manager_service.cpp",
33    "${storage_manager_path}/storage_daemon_communication/src/storage_daemon_communication.cpp",
34    "disk_manager_service_test.cpp",
35  ]
36
37  include_dirs = [
38    "${storage_daemon_path}/include",
39    "${storage_daemon_path}/include/mock",
40    "${storage_interface_path}/innerkits/storage_manager/native",
41    "${storage_service_common_path}/include",
42    "${storage_manager_path}/include",
43    "${storage_service_path}/utils/include",
44    "include",
45  ]
46
47  defines = [
48    "STORAGE_LOG_TAG = \"StorageManager\"",
49    "LOG_DOMAIN = 0xD004300",
50  ]
51
52  deps = [
53    "${storage_daemon_path}:storage_common_utils",
54    "${storage_daemon_path}:storage_daemon_ipc",
55  ]
56
57  external_deps = [
58    "ability_base:base",
59    "ability_base:want",
60    "c_utils:utils",
61    "c_utils:utils",
62    "common_event_service:cesfwk_innerkits",
63    "eventhandler:libeventhandler",
64    "googletest:gmock_main",
65    "googletest:gtest_main",
66    "hilog:libhilog",
67    "ipc:ipc_single",
68    "os_account:os_account_innerkits",
69    "safwk:system_ability_fwk",
70    "samgr:samgr_proxy",
71    "storage_service:storage_manager_sa_proxy",
72  ]
73
74  if (enable_screenlock_manager) {
75    defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
76    external_deps += [ "screenlock_mgr:screenlock_client" ]
77  }
78}
79
80group("storage_manager_disk_test") {
81  testonly = true
82  deps = [ ":disk_manager_service_test" ]
83}
84