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:
Katerina Barone-Adesi 2013-03-12 10:23:52 +01:00 committed by Holger Hans Peter Freyther
parent 1a02cfc24d
commit 55cf02221f
1 changed files with 2 additions and 1 deletions

View File

@ -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(); \
}