> Worse yet, without some kind of comprehensive fault-injection framework, those error paths are difficult to test.
I was playing around with the idea of a simple script that could extract parts of a C(++) file and make simple changes based on something similar to Doxygen comments in order to unit test that sort of thing. That is, your script extracts the body code of the functions you want to unit test, glues on alternative header and footer code that you write in the doxygen comments, and replaces function calls where you want to test failure conditions with simple checks against a function parameter that you supply.