Further improvements to the ASSERT-macro: replaced fprintf with std::cerr and added std::-prefix to abort
This commit is contained in:
parent
e716cd9764
commit
ded57636dd
1 changed files with 2 additions and 1 deletions
|
|
@ -2,7 +2,8 @@
|
|||
#define TESTS_ASSERT_HPP
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#define ASSERT(e) ((void)((e) ? ((void)0) : ((void)fprintf(stderr, "Assertion failed: (%s), function %s, file %s, line %u.\n", #e, __func__, __FILE__, __LINE__), abort())))
|
||||
#define ASSERT(e) ((void)((e) ? ((void)0) : ((void)(std::cerr << "Assertion failed: (" << #e << "), function " << __func__ << ", file " << __FILE__ << ", line " << __LINE__ << ".\n"), std::abort())))
|
||||
|
||||
#endif /* TESTS_ASSERT_HPP */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue