the Compartmented Robust Posix C++ Unit Test system | hosted by |
---|
Special value denoting any exit-code.
Used in: an EXPECT_EXIT(num)
modifier. See TEST(name, ...)
.
Example: The test program
#include <crpcut.hpp> TEST(expected_exit, EXPECT_EXIT(ANY_CODE)) { exit(3); } TEST(unexpected_no_exit, EXPECT_EXIT(ANY_CODE)) { // do nothing } int main(int argc, char *argv[]) { return crpcut::run(argc, argv); }
reports one failed test:
FAILED: unexpected_no_exit phase="running" -------------------------------------------------------------- Unexpectedly survived Expected exit with any code ------------------------------------------------------------------------------- =============================================================================== Total 2 test cases selected UNTESTED : 0 PASSED : 1 FAILED : 1