Same bug class asdae8a50and6d8087f: under -DNDEBUG (CMake's default for Release, which CI uses) the assert macro expands to ((void)0) and the wrapped expression is not evaluated. Calls inside assert() are silently dropped. Found 6 occurrences in test_ots.c (uc2_ots_varint_decode, parse_file) where the call writes through output pointers. Under Release builds these tests silently no-op rather than testing anything. Converted to capture-then-check. Audit otherwise clean: production code (lib/, cli/) has only one assert-on-call, and it wraps a pure arithmetic helper. Adds tests/scripts/check_assert_side_effects.py as a CI gate to keep this class of bug out: matches assert(IDENT(...)) where IDENT contains a side-effect verb (encode/decode/parse/...). Pure queries (_equal, _match, _verify, _has_, _is_, _id, _root, _attest_name, memcmp, ...) are not flagged. Wired into build.yml on the Linux runner. Also gitignore Testing/ (CTest run outputs) and __pycache__/.
3.2 KiB
Executable File
3.2 KiB
Executable File