mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-05 22:03:45 +08:00
33d5cfc393
date: 2025-12-18T23:23:16 master commit: 3cdee7b54718ee14bd85befd6c5bad3d699c5479
22 lines
588 B
Python
22 lines
588 B
Python
from opendbc.can import CANParser
|
|
from opendbc.can.tests import ALL_DBCS
|
|
|
|
|
|
class TestDBCParser:
|
|
def test_enough_dbcs(self):
|
|
# sanity check that we're running on the real DBCs
|
|
assert len(ALL_DBCS) > 20
|
|
|
|
def test_parse_all_dbcs(self, subtests):
|
|
"""
|
|
Dynamic DBC parser checks:
|
|
- Checksum and counter length, start bit, endianness
|
|
- Duplicate message addresses and names
|
|
- Signal out of bounds
|
|
- All BO_, SG_, VAL_ lines for syntax errors
|
|
"""
|
|
|
|
for dbc in ALL_DBCS:
|
|
with subtests.test(dbc=dbc):
|
|
CANParser(dbc, [], 0)
|