Skip to main content
5 votes

Stub-Based Unit Testing 5 Read Routines

One tiny quibble... Existing code: ...
Fe2O3's user avatar
  • 1,179
4 votes
Accepted

Generic Max() for Integer Types (including Boolean)

Tests The assert() tests are not useful in release mode as that replaces assert() with empty code. The test within the ...
chux - Reinstate Monica's user avatar
3 votes
Accepted

Stub-Based Unit Testing 5 Read Routines

The tests seem to be including the source of the code under test, which I don't recommend. It's better if you can link the exact binaries that you built for production, rather than something slightly ...
Toby Speight's user avatar
  • 77.1k
3 votes
Accepted

Generic Min() for Integer Types (including Boolean)

With your header in min.h, the test code in test-min.c, and max.h — which has to be ...
Jonathan Leffler's user avatar
2 votes

Generic Max() for Integer Types (including Boolean)

Wrong check for C23: #if defined(__STDC_VERSION__) && __STDC_VERSION >= 202311L This check was expected to suffice for GCC 14.1 and Clang 18.1, as they ...
Harith's user avatar
  • 9,038
2 votes

Stub-Based Unit Testing 5 Read Routines

Problem: We have 18 similar source files that only differ in include directives, and the read routine being tested, and the name of the function that is testing the ...
Harith's user avatar
  • 9,038

Only top scored, non community-wiki answers of a minimum length are eligible