All languages

C

You're viewing a free preview. Sign in free to read every script.

Why this exists C gives no safety net, so tests matter more, not less. A small test program that exercises your functions on normal and awkward input, run under the sanitizers on every commit, finds most memory bugs…

Unit Testing C: A Minimal Harness, Edge Cases, Sanitizers and Coverage in CI

Test C code without a framework: a tiny assertion harness, tests for normal and edge cases including NULL and empty input, running them under AddressSanitizer and UBSan, measuring coverage with gcov, and wiring it into CTest and a pipeline.

Sign in free to read this script, along with the rest of the library.

Sign in free