# Copyright (c) 2025 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/config/features.gni")
import("//build/test.gni")
import("./../../../multimedia_camera_framework.gni")
 
ohos_fuzztest("CameraOutputCapabilityFuzzTest") {
  module_out_path = "camera_framework/camera_framework"
  fuzz_config_file = "../cameraoutputcapability_fuzzer"
 
  include_dirs = [
    "${multimedia_camera_framework_path}/interfaces/inner_api/native/camera/include",
    "${multimedia_camera_framework_path}/interfaces/inner_api/native/camera/include/output/",
    "${multimedia_camera_framework_path}/services/camera_service/include",
    "${multimedia_camera_framework_path}/services/camera_service/binder/base/include",
    "${multimedia_camera_framework_path}/services/camera_service/binder/client/include",
    "${multimedia_camera_framework_path}/services/camera_service/binder/server/include",
  ]
 
  cflags = [
    "-g",
    "-O0",
    "-Wno-unused-variable",
    "-fno-omit-frame-pointer",
    "-fno-access-control",
  ]
 
  sources = [ "camera_outputcapability_fuzzer.cpp" ]
 
  deps = [ "${multimedia_camera_framework_path}/frameworks/native/camera/base:camera_framework" ]
  external_deps = [
    "ability_base:want",
    "access_token:libaccesstoken_sdk",
    "access_token:libnativetoken",
    "access_token:libprivacy_sdk",
    "access_token:libtoken_setproc",
    "bundle_framework:appexecfwk_base",
    "bundle_framework:appexecfwk_core",
    "c_utils:utils",
    "drivers_interface_camera:libbuffer_handle_sequenceable_1.0",
    "drivers_interface_camera:libcamera_proxy_1.0",
    "drivers_interface_camera:libcamera_proxy_1.1",
    "drivers_interface_camera:libmap_data_sequenceable_1.0",
    "drivers_interface_camera:metadata",
    "graphic_2d:librender_service_client",
    "graphic_surface:surface",
    "hdf_core:libhdi",
    "hicollie:libhicollie",
    "hilog:libhilog",
    "hisysevent:libhisysevent",
    "hitrace:hitrace_meter",
    "ipc:ipc_core",
    "ipc:ipc_single",
    "safwk:system_ability_fwk",
    "samgr:samgr_proxy",
    "window_manager:libdm",
  ]
}
 
group("fuzztest") {
  testonly = true
  deps = [ ":CameraOutputCapabilityFuzzTest" ]
}