forked from hifiberry/hifiberry-dsp
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LG Sound Sync] Test SPDIF status register parsing
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from unittest import TestCase | ||
|
||
from hifiberrydsp.lg.soundsync import SoundSync | ||
|
||
class TestSoundSync(TestCase): | ||
def test_parse_volume_with_missing_sound_sync_signature(self): | ||
assert SoundSync.parse_volume_from_status(b'\xff\xff\xff\xff\xff\xff') is None | ||
|
||
def test_parse_out_of_range_volume(self): | ||
assert SoundSync.parse_volume_from_status(b'\x00\x1f\xff\x04\x8a\x62') is None | ||
|
||
def test_parse_volume_of_0(self): | ||
assert SoundSync.parse_volume_from_status(b'\x00\x10\x0f\x04\x8a\x62') == 0 | ||
|
||
def test_parse_volume_of_50(self): | ||
assert SoundSync.parse_volume_from_status(b'\x00\x13\x2f\x04\x8a\x62') == 50 | ||
|
||
def test_parse_volume_of_100(self): | ||
assert SoundSync.parse_volume_from_status(b'\x00\x16\x4f\x04\x8a\x62') == 100 |