6adb63b915
date: 2026-06-04T09:49:56 master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
23 lines
612 B
Python
23 lines
612 B
Python
import unittest
|
|
from opendbc.can import CANParser
|
|
from opendbc.can.tests import ALL_DBCS
|
|
|
|
|
|
class TestDBCParser(unittest.TestCase):
|
|
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):
|
|
"""
|
|
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 self.subTest(dbc=dbc):
|
|
CANParser(dbc, [], 0)
|