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/test.gni") 15import("//foundation/multimedia/av_codec/config.gni") 16 17module_output_path = "av_codec/unittest" 18sample_queue_test_sources = [ 19 "$av_codec_root_dir/services/media_engine/modules/demuxer/sample_queue.cpp", 20] 21config("sample_queue_unittest_cfg") { 22 defines = [ 23 "HST_ANY_WITH_NO_RTTI", 24 "MEDIA_OHOS", 25 "TESTING", 26 ] 27 28 cflags = [ 29 "-Wno-sign-compare", 30 "-fno-exceptions", 31 "-fno-common", 32 "-fstack-protector-all", 33 "-Wshadow", 34 "-FPIC", 35 "-FS", 36 "-O2", 37 "-D_FORTIFY_SOURCE=2", 38 "-Wformat=2", 39 "-Wdate-time", 40 "-Dprivate=public", 41 "-Dprotected=public", 42 ] 43 44 cflags_cc = [ 45 "-std=c++17", 46 "-fno-rtti", 47 ] 48 49 include_dirs = [ 50 "$av_codec_root_dir/interfaces", 51 "$av_codec_root_dir/interfaces/inner_api", 52 "$av_codec_root_dir/interfaces/inner_api/native", 53 "$av_codec_root_dir/services/media_engine/modules", 54 "$av_codec_root_dir/services/media_engine/modules/demuxer", 55 "$av_codec_root_dir/test/unittest/common", 56 ] 57} 58 59################################################################################################################# 60ohos_unittest("sample_queue_unit_test") { 61 sanitize = av_codec_test_sanitize 62 module_out_path = module_output_path 63 testonly = true 64 configs = [ 65 ":sample_queue_unittest_cfg", 66 "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config", 67 ] 68 sources = sample_queue_test_sources + [ "sample_queue_unit_test.cpp" ] 69 deps = [ "$av_codec_root_dir/services/dfx:av_codec_service_dfx" ] 70 71 external_deps = [ 72 "c_utils:utils", 73 "hilog:libhilog", 74 "hisysevent:libhisysevent", 75 "ipc:ipc_single", 76 "media_foundation:media_foundation", 77 "netmanager_base:net_conn_manager_if", 78 "safwk:system_ability_fwk", 79 ] 80 resource_config_file = 81 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 82} 83