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:
Thomas Haller 2014-07-21 11:58:03 +02:00
parent c065476f20
commit 95b40ae03f

View file

@ -49,9 +49,12 @@ cleanup (void)
#define test_assert(condition) \
do { \
if (!G_LIKELY (condition)) \
gboolean _condition = ( condition ); \
\
if (G_UNLIKELY (!_condition)) { \
cleanup (); \
g_assert (condition); \
g_assert (!"test_assert() failed for" # condition); \
} \
} while (0)
/*******************************************************************/