-
Book Overview & Buying
-
Table Of Contents
Test-Driven Development with C++
By :
It’s getting more and more common for developers to avoid macros in their code. And I agree that there is almost no need for macros anymore. With std::source_location from the previous section, one of the last reasons to use macros has been eliminated.
Some companies might even have rules against using macros anywhere in their code. I think that’s a bit too much especially given the trouble with std::source_location. Macros still have the ability to wrap up code so that it can be inserted instead of the macro itself.
As the previous section shows, the CONFIRM_TRUE, CONFIRM_FALSE, and CONFIRM macros may no longer be absolutely necessary. I still like them. But if you don’t want to use them, then you don’t have to – at least once std::source_location works reliably in a large project.
The TEST and TEST_EX macros are still needed because they wrap up the declaration of the derived test classes, give them unique names...