mirror of
https://github.com/romanz/amodem.git
synced 2026-05-01 23:17:24 +08:00
Test ECC codec.
This commit is contained in:
5
ecc.py
5
ecc.py
@@ -43,8 +43,9 @@ def decode(data, nsym=DEFAULT_NSYM):
|
|||||||
|
|
||||||
|
|
||||||
def test_codec():
|
def test_codec():
|
||||||
import os
|
import random
|
||||||
x = bytearray(os.urandom(1024))
|
r = random.Random(0)
|
||||||
|
x = bytearray(r.randrange(0, 256) for i in range(16 * 1024))
|
||||||
y = encode(x)
|
y = encode(x)
|
||||||
assert len(y) % BLOCK_SIZE == 0
|
assert len(y) % BLOCK_SIZE == 0
|
||||||
x_ = decode(y)
|
x_ = decode(y)
|
||||||
|
|||||||
Reference in New Issue
Block a user