12 lines
294 B
Python
12 lines
294 B
Python
from app.fit.crc import fit_crc
|
|
|
|
|
|
def test_empty_crc_is_zero() -> None:
|
|
assert fit_crc(b"") == 0
|
|
|
|
|
|
def test_crc_is_incremental_equivalent() -> None:
|
|
payload = b".FIT-device-metadata"
|
|
assert fit_crc(payload) == fit_crc(memoryview(payload))
|
|
assert 0 <= fit_crc(payload) <= 0xFFFF
|