From d5dec995681328b415d42c920bd4aefefd97ad84 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 24 Nov 2025 14:51:23 +0100 Subject: [PATCH] add xfails to hrtf_loading tests for all cases when comparing between ROM and a differing hrtf loaded from file, the respective testcase is now reported as xfail previously, it was reported as fail, but warnings about delay differences were reported, which felt wrong --- tests/hrtf_binary_loading/utils.py | 89 +++++++++++++++++++----------- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 1aca3033e9..7eae84bcf6 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -1,39 +1,40 @@ #!/usr/bin/env python3 """ - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. """ import os import sys import uuid from typing import Optional +from pathlib import Path import pytest @@ -274,7 +275,7 @@ def check_binary_file(hrtf_tag, out_fs): and (config["sampling_frequency"] != hrtf_config["sampling_frequency"]) ): pytest.fail( - f"Bad sampling frequency for configuration (renderer_type : {hrtf_config['renderer_type']} - input_configuration : {hrtf_config['input_configuration']}) : {config['sampling_frequency']} instead of {int(out_fs)*1000}!" + f"Bad sampling frequency for configuration (renderer_type : {hrtf_config['renderer_type']} - input_configuration : {hrtf_config['input_configuration']}) : {config['sampling_frequency']} instead of {int(out_fs) * 1000}!" ) @@ -306,7 +307,12 @@ def compare_rom_vs_binary( input_path = TESTV_DIR.joinpath(in_file).with_suffix(".wav") bitstream_path = BITSTREAM_DIR.joinpath(in_file + file_ext) run_encoder( - test_info, bitrate, in_fs, input_path, bitstream_path, add_option_list=option_list_enc + test_info, + bitrate, + in_fs, + input_path, + bitstream_path, + add_option_list=option_list_enc, ) if trj_file is not None: @@ -316,7 +322,12 @@ def compare_rom_vs_binary( option_list_dec = None out_rom_path = DEC_ROM_DIR.joinpath(in_file + file_ext).with_suffix(".wav") run_decoder( - test_info, out_fmt, out_fs, bitstream_path, out_rom_path, add_option_list=option_list_dec + test_info, + out_fmt, + out_fs, + bitstream_path, + out_rom_path, + add_option_list=option_list_dec, ) out_rom, out_rom_fs = pyaudio3dtools.audiofile.readfile(out_rom_path) @@ -328,7 +339,12 @@ def compare_rom_vs_binary( out_bin_path = DEC_BINARY_DIR.joinpath(in_file + file_ext).with_suffix(".wav") run_decoder( - test_info, out_fmt, out_fs, bitstream_path, out_bin_path, add_option_list=option_list_dec + test_info, + out_fmt, + out_fs, + bitstream_path, + out_bin_path, + add_option_list=option_list_dec, ) out_bin, out_bin_fs = pyaudio3dtools.audiofile.readfile(out_bin_path) @@ -344,6 +360,10 @@ def compare_rom_vs_binary( pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" ) + elif diff_found and xfail: + pytest.xfail( + f"Expected CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" + ) elif not diff_found and xfail: pytest.fail("Difference expected, but none found.") else: @@ -430,6 +450,13 @@ def compare_renderer_vs_renderer_with_binary_hrir( pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" ) + elif diff_found and xfail: + if keep_file != "if failed": + os.remove(ref_out) + os.remove(cut_out) + pytest.xfail( + f"Expected CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" + ) elif not diff_found and xfail: if keep_file != "if failed": os.remove(ref_out) -- GitLab