libnm-glib: evaluate assert check only once in test-remote-settings-client

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-07-21 11:58:03 +02:00
parent 02a5b972e6
commit faa6c34db1

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)
/*******************************************************************/