Commit d5dec995 authored by Jan Kiene's avatar Jan Kiene
Browse files

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
parent a22a6810
Loading
Loading
Loading
Loading
Loading
+58 −31
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import os
import sys
import uuid
from typing import Optional
from pathlib import Path

import pytest

@@ -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)