1# Copyright (c) 2024 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/test.gni") 16import("../../../accessibility.gni") 17import("../../../bluetooth_part.gni") 18import("../../../config.gni") 19 20ohos_fuzztest("AudioBufferBaseFuzzTest") { 21 module_out_path = "audio_framework/audio_framework_route" 22 fuzz_config_file = "../audiobufferbase_fuzzer" 23 24 include_dirs = [ 25 "../../../services/audio_service/common/include", 26 ] 27 cflags = [ 28 "-g", 29 "-O0", 30 "-Wno-unused-variable", 31 "-fno-omit-frame-pointer", 32 "-fno-access-control", 33 ] 34 configs = [ "../../../services/audio_policy:audio_policy_public_config" ] 35 36 sources = [ 37 "../../../services/audio_service/common/src/oh_audio_buffer_base.cpp", 38 "oh_audio_buffer_base_fuzzer.cpp", 39 ] 40 41 deps = [ 42 "../../../services/audio_service/idl:audio_framework_interface", 43 "../../../frameworks/native/audioutils:audio_utils", 44 "../../../frameworks/native/bluetoothclient:audio_bluetooth_client", 45 "../../../services/audio_policy:audio_policy_service_static", 46 ] 47 48 external_deps = [ 49 "ability_base:want", 50 "ability_runtime:extension_manager", 51 "ability_runtime:wantagent_innerkits", 52 "access_token:libaccesstoken_sdk", 53 "access_token:libnativetoken_shared", 54 "access_token:libprivacy_sdk", 55 "access_token:libtokenid_sdk", 56 "access_token:libtokensetproc_shared", 57 "background_task_mgr:bgtaskmgr_innerkits", 58 "bounds_checking_function:libsec_shared", 59 "bundle_framework:appexecfwk_base", 60 "bundle_framework:appexecfwk_core", 61 "c_utils:utils", 62 "data_share:datashare_common", 63 "data_share:datashare_consumer", 64 "eventhandler:libeventhandler", 65 "hdf_core:libhdf_ipc_adapter", 66 "hdf_core:libhdi", 67 "hdf_core:libpub_utils", 68 "hicollie:libhicollie", 69 "hilog:libhilog", 70 "hisysevent:libhisysevent", 71 "hitrace:hitrace_meter", 72 "init:libbegetutil", 73 "ipc:ipc_single", 74 "kv_store:distributeddata_inner", 75 "media_foundation:media_monitor_client", 76 "media_foundation:media_monitor_common", 77 "os_account:os_account_innerkits", 78 "power_manager:powermgr_client", 79 "relational_store:native_appdatafwk", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 ] 83 if (sonic_enable == true) { 84 external_deps += [ "pulseaudio:sonic" ] 85 } 86 if (accessibility_enable == true) { 87 external_deps += [ 88 "accessibility:accessibility_common", 89 "accessibility:accessibilityconfig", 90 ] 91 } 92 93 defines = [] 94 if (use_libfuzzer || use_clang_coverage) { 95 defines += [ "TEST_COVERAGE" ] 96 } 97 if (bluetooth_part_enable == true) { 98 external_deps += [ "bluetooth:btframework" ] 99 } 100} 101 102group("fuzztest") { 103 testonly = true 104 deps = [ ":AudioBufferBaseFuzzTest" ] 105} 106