diff --git a/tests/test_recv.py b/tests/test_recv.py index aee6131..3649af7 100644 --- a/tests/test_recv.py +++ b/tests/test_recv.py @@ -5,6 +5,7 @@ from amodem import recv from amodem import train from amodem import sampling + def test_detect(): P = sum(train.prefix) t = np.arange(P * config.Nsym) * config.Ts @@ -19,6 +20,7 @@ def test_detect(): except ValueError: pass + def test_prefix(): symbol = np.cos(2 * np.pi * config.Fc * np.arange(config.Nsym) * config.Ts) signal = np.concatenate([c * symbol for c in train.prefix]) @@ -34,6 +36,7 @@ def test_prefix(): except ValueError: pass + def test_find_start(): sym = np.cos(2 * np.pi * config.Fc * np.arange(config.Nsym) * config.Ts) @@ -47,3 +50,7 @@ def test_find_start(): start = recv.find_start(buf, length*config.Nsym) expected = offset + len(prefix) assert expected == start + + +def test_decode(): + assert list(recv.decode([])) == []