|
30 | 30 | #include "qp_port.h" //required for Q_NORETURN definition, needed by qsafe.h |
31 | 31 | #include "qsafe.h" |
32 | 32 | #include "cmsQAssertMockSupport.hpp" |
| 33 | +#include "qassert-meta.h" |
| 34 | + |
| 35 | +static bool m_printAssertMeta = true; |
| 36 | + |
| 37 | +void cms::test::QAssertMetaOutputEnable() |
| 38 | +{ |
| 39 | + m_printAssertMeta = true; |
| 40 | +} |
| 41 | + |
| 42 | +void cms::test::QAssertMetaOutputDisable() |
| 43 | +{ |
| 44 | + m_printAssertMeta = false; |
| 45 | +} |
33 | 46 |
|
34 | 47 | void Q_onError(char const* const module, int_t const id) |
35 | 48 | { |
36 | | - //fprintf(stderr, "%s(%s , %d)\n", __FUNCTION__ , module, id); |
| 49 | + if (m_printAssertMeta) |
| 50 | + { |
| 51 | + fprintf(stdout, "\n%s(%s:%d)\n", __FUNCTION__ , module, id); |
| 52 | + QAssertMetaDescription meta; |
| 53 | + bool found = QAssertMetaGetDescription(module, id, &meta); |
| 54 | + if (found) |
| 55 | + { |
| 56 | + fprintf(stdout, "Additional details on (%s:%d): %s\n", module, id, meta.brief); |
| 57 | + fprintf(stdout, "Tips/More:\n%s\n", meta.tips); |
| 58 | + fprintf(stdout, "URL: %s\n", meta.url); |
| 59 | + } |
| 60 | + } |
37 | 61 |
|
38 | 62 | // The TEST_EXIT macro used below is throwing an exception. |
39 | 63 | // However, many of QP/QF methods are marked as 'noexcept' |
|
0 commit comments