Or Can I use it in regular code?
If the answer is "no", then is there C++ library that will provide me with all the macros like CHECK_EQUAL, CHECK_CLOSE, etc.?
Or Can I use it in regular code?
If the answer is "no", then is there C++ library that will provide me with all the macros like CHECK_EQUAL, CHECK_CLOSE, etc.?
It is only meaningful in unit tests, since its purpose is to alert the unit testing framework that a test failed, and then continue. If the unit testing framework isn't running, that won't work.
Outside unit tests, you'll usually want to use some flavor of assert instead.
If the answer is "no", then is there C++ library that will provide me with all the macros like
CHECK_EQUAL
,CHECK_CLOSE
, etc.?
The short answer is no. The longer answer: These macros are part of Boost.Test. So, if you are not using Boost.Test you will have to roll your own.
It's fairly easy to write this functionality based on boost/assert or cassert.
Note, however, that assertions may require some definitions (such as DEBUG)