Testlib: Make QTEST_ASSERT usable in constexpr functions
Commit 8ea27bb1c6 adapted the definition
of Q_ASSERT already.
Adopt the same logic for QTEST_ASSERT.
Pick-to: 6.5 6.6
Change-Id: I5a5d0f62df79b18635d3b426a439c35b25d739c2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
bb10
parent
0493504f34
commit
d4d600d411
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#define QTEST_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
|
||||
|
||||
#define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
|
||||
|
||||
#define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
|
||||
#define QTEST_ASSERT_X(cond, where, what) ((cond) ? static_cast<void>(0) : qt_assert_x(where, what, __FILE__, __LINE__))
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue