# QtTest regression tests Open the repository's root `dbc.pro` in Qt Creator. It contains `core` (a static C++17 library) and `tests` (the `dbc_tests` QtTest executable). Core is built first; tests link its archive rather than compiling its implementation again. Qt Core and Qt Test development packages are required for tests only. Build from the repository root with Qt 6 (use `qmake` for Qt 5): ```sh mkdir build cd build qmake6 ../dbc.pro make -j make check ``` Or run `./tests/dbc_tests` directly. Both parser and decoder suites run, and the executable returns nonzero when either suite fails. Decoder cases appear as individual QtTest data rows; parser checks are grouped into named test slots. Checks also run in release builds. To build tests separately against an existing core build: ```sh mkdir /tmp/dbc-tests-build cd /tmp/dbc-tests-build qmake6 /absolute/path/to/dbc/tests/tests.pro \ DBC_CORE_BUILD_DIR=/absolute/path/to/build/core make make check ``` `parser_tests.pri` and `decoder_tests.pri` include the test sources. `../core/core.pri` supplies the library include path and linkage. ## Decoder coverage Coverage includes Motorola bit numbering within and across bytes, unaligned signals, signed values, scaling, 64-bit extraction, signed/unsigned boundary values (including `INT64_MIN`, `INT64_MAX`, and `UINT64_MAX`), numeric output, invalid lengths, insufficient payloads, and Intel regression cases. Frame validity means the definition was found; insufficient payloads are checked through signal validity. ## Parser coverage Parser tests cover standard and extended CAN IDs, whitespace, payload storage boundaries, missing fields, malformed and overflowing numbers, reserved ID bits, error paths and line numbers, and integration with signals and comments. Signal tests cover complete syntax and numeric validation, scientific notation, finite physical parameters and ordered ranges, spaces and tabs, receiver lists, unsupported multiplexing, and Intel/Motorola declared-payload boundaries. Temporary DBC fixtures are created in the system temporary directory and removed automatically. Dispatch tests also verify exact keyword matching, handler construction and reuse, unknown statements, and independent parsing sessions, including recovery after errors.