Test double injection techniques in C/C++
From Hidden In Plain Sight
How you inject your test doubles depends on what you're trying to achieve and what methods are available to you.
There are three points where test doubles can be injected in C/C++.
- Run time substitution
- Link time
- Linking other object files (C/C++)
- Weak leaking functions (C)
- Compile time
- Macros (C/C++)
- Templates (C++)
- Testing drivers
- Testing error cases from hardware
- Developing before the hardware is ready