Skip to content

Commit 059410f

Browse files
committed
TST: A little update to the dB tests
1 parent b676d2f commit 059410f

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

tests/test_util.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,20 @@ def test_direction_vector(input, vector):
5151

5252
db_data = [
5353
(0, -np.inf),
54+
(0.5, -3.01029995663981),
5455
(1, 0),
56+
(2, 3.01029995663981),
5557
(10, 10),
56-
(10 * 2, (10 + 3.010299956639813)),
57-
(10 * 10, (10 + 10)),
58-
(10 * 3, (10 + 4.771212547196624)),
59-
(10 * 4, (10 + 6.02059991327962)),
60-
(10 * 0.5, (10 - 3.01029995663981198)),
61-
(10 * 0.1, (10 - 10)),
62-
(10 * 0.25, (10 - 6.02059991327962396))
63-
]
58+
]
6459

6560

66-
@pytest.mark.parametrize('linear, decibel', db_data)
67-
def test_db_amplitude(linear, decibel):
68-
d = sfs.util.db(linear, True)
69-
assert_allclose(d, decibel)
61+
@pytest.mark.parametrize('linear, power_db', db_data)
62+
def test_db_amplitude(linear, power_db):
63+
d = sfs.util.db(linear)
64+
assert_allclose(d, power_db * 2)
7065

7166

72-
@pytest.mark.parametrize('linear, decibel', db_data)
73-
def test_db_power(linear, decibel):
74-
d = sfs.util.db(linear)
75-
assert_allclose(d, 2 * decibel)
67+
@pytest.mark.parametrize('linear, power_db', db_data)
68+
def test_db_power(linear, power_db):
69+
d = sfs.util.db(linear, power=True)
70+
assert_allclose(d, power_db)

0 commit comments

Comments
 (0)