mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 13:38:43 +02:00
libnm-glib: evaluate assert check only once in test-remote-settings-client
Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit faa6c34db1)
This commit is contained in:
parent
c065476f20
commit
95b40ae03f
1 changed files with 5 additions and 2 deletions
|
|
@ -49,9 +49,12 @@ cleanup (void)
|
||||||
|
|
||||||
#define test_assert(condition) \
|
#define test_assert(condition) \
|
||||||
do { \
|
do { \
|
||||||
if (!G_LIKELY (condition)) \
|
gboolean _condition = ( condition ); \
|
||||||
|
\
|
||||||
|
if (G_UNLIKELY (!_condition)) { \
|
||||||
cleanup (); \
|
cleanup (); \
|
||||||
g_assert (condition); \
|
g_assert (!"test_assert() failed for" # condition); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue