• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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/config/features.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17import("../../../../os_account.gni")
18
19ohos_fuzztest("IsOsAccountDeactivatingStubFuzzTest") {
20  module_out_path = fuzz_output_path
21  fuzz_config_file = "."
22  include_dirs = [
23    "${services_path}/accountmgr/include/bundle_manager_adapter",
24    "${services_path}/accountmgr/include",
25    "${services_path}/accountmgr/include/osaccount",
26    "${os_account_innerkits_native_path}/include",
27    "${os_account_path}/test/fuzztest/osaccount_stub/common",
28  ]
29  cflags = [
30    "-g",
31    "-O0",
32    "-Wno-unused-variable",
33    "-fno-omit-frame-pointer",
34  ]
35  if (use_libfuzzer) {
36    cflags += [ "-DFUZZ_TEST" ]
37  }
38  if (target_cpu == "arm") {
39    cflags += [ "-DBINDER_IPC_32BIT" ]
40  }
41  sources = [
42    "${os_account_path}/services/accountmgr/src/osaccount/os_account_manager_service.cpp",
43    "isosaccountdeactivatingstub_fuzzer.cpp",
44  ]
45  deps = [
46    "${os_account_path}/frameworks/common:libaccount_common",
47    "${os_account_path}/frameworks/osaccount/native:os_account_innerkits",
48    "${os_account_path}/services/accountmgr:accountmgr",
49  ]
50  external_deps = [
51    "ability_base:want",
52    "ability_runtime:app_manager",
53    "ability_runtime:wantagent_innerkits",
54    "access_token:libaccesstoken_sdk",
55    "access_token:libtokenid_sdk",
56    "bundle_framework:appexecfwk_base",
57    "cJSON:cjson",
58    "c_utils:utils",
59    "hilog:libhilog",
60    "ipc:ipc_single",
61    "kv_store:distributeddata_inner",
62    "safwk:system_ability_fwk",
63    "samgr:samgr_proxy",
64  ]
65  defines = [
66    "ACCOUNT_LOG_TAG = \"OsAccountFuzzTest\"",
67    "LOG_DOMAIN = 0xD001B00",
68  ]
69}
70