mirror of https://gerrit.osmocom.org/libosmocore
utils: Use fprintf to print the assertion and generate a backtrace
This is changing the semantic of the assert. The regression tests now either need to check the stderr result, the exit status or print a message when all tests are completed. This is not that bad as the osmo_generate_backtrace is printing to the stdout right now.
This commit is contained in:
parent
1a02cfc24d
commit
55cf02221f
|
@ -53,7 +53,8 @@ do { \
|
|||
|
||||
#define OSMO_ASSERT(exp) \
|
||||
if (!(exp)) { \
|
||||
printf("Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
|
||||
fprintf(stderr, "Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
|
||||
osmo_generate_backtrace(); \
|
||||
abort(); \
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue