mirror of
https://github.com/romanz/amodem.git
synced 2026-04-01 00:36:50 +08:00
test saturation errors
This commit is contained in:
@@ -51,3 +51,12 @@ def test_dumps_loads():
|
||||
x = np.array([.1, .4, .2, .6, .3, .5])
|
||||
y = common.loads(common.dumps(x))
|
||||
assert all(x == y)
|
||||
|
||||
|
||||
def test_saturation():
|
||||
x = np.array([1, -1, 1, -1]) * 1.01
|
||||
try:
|
||||
common.check_saturation(x)
|
||||
assert False
|
||||
except common.SaturationError as e:
|
||||
assert e.args == (1.01,)
|
||||
|
||||
Reference in New Issue
Block a user