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

use both HRTF sets in test_binary_file test

parent 368e3642
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@ DECODER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_dec"))]

RENDERER_CMD = [str(TESTS_DIR.parent.parent.joinpath("IVAS_rend"))]

HRTF_BINARY_FILE = "ivas_binaural_{}kHz.bin"
# HRTF_BINARY_FILE = "ivas_binaural_51_brir-lc_{}kHz.bin"
HRTF_BINARY_FILE_SAME_AS_ROM = "ivas_binaural_{}kHz.bin"
HRTF_BINARY_FILE_DIFF_FROM_ROM = "ivas_binaural_51_brir-lc_{}kHz.bin"
SAMPLE_RATE = ["16", "32", "48"]

INPUT_FORMATS_MC = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]  # "MONO", "STEREO",
+4 −2
Original line number Diff line number Diff line
@@ -32,13 +32,15 @@
import pytest

from tests.hrtf_binary_loading.utils import *
from .constants import HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM

""" Binary file """


@pytest.mark.parametrize("out_fs", SAMPLE_RATE)
def test_binary_file(test_info, out_fs):
    check_binary_file(out_fs)
@pytest.mark.parametrize("hrtf_file", [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM])
def test_binary_file(test_info, hrtf_file, out_fs):
    check_binary_file(hrtf_file, out_fs)


""" Multichannel """
+3 −3
Original line number Diff line number Diff line
@@ -140,9 +140,9 @@ def get_option_list_str(option_list):
    return option_list_str


def check_binary_file(out_fs):
def check_binary_file(hrtf_file, out_fs):
    with open(
        str(HRTF_BINARY_DIR.joinpath(HRTF_BINARY_FILE.format(out_fs))), "rb"
        str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))), "rb"
    ) as file:
        binary_data = file.read()

@@ -153,7 +153,7 @@ def check_binary_file(out_fs):
        #      Max length of HRTF data (4 bytes)

        binary_file_size = os.path.getsize(
            str(HRTF_BINARY_DIR.joinpath(HRTF_BINARY_FILE.format(out_fs)))
            str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs)))
        )
        if binary_file_size < 18:
            pytest.fail("HRTF binary file not compliant (size of file header)")