Writing a Unit Test Framework in C

The C programming language was one of the first programming languages I ever learned (after learning Basic, APL, and Fortran). I haven’t written much in C lately and I miss it, so I decided I needed a project to write C on a regular basis.

One of the problems with writing C code is making sure it does what you intend it to do. I’ve made lots of mistakes in the past, and I’d like to reduce their likelihood a little. One way to do that is to test code thoroughly, so a unit-test framework would be useful.

A Deep Look at a Memory Allocator

Doug Lea’s allocator, often referred to as dlmalloc, provides implementations of the standard C memory functions malloc(), free(), realloc(), and friends. I need a memory allocator for a personal project and Lea generously put his code in the public domain, so I thought to adapt it to my needs. Note that the latest release in 2023 relicensed it under the “MIT No Attribution” (MIT-0) License, which is supposed to be more palatable than the public domain.