From 95b40ae03f1eecbddac1d2d66fce0455ed4ec983 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 21 Jul 2014 11:58:03 +0200 Subject: [PATCH] libnm-glib: evaluate assert check only once in test-remote-settings-client Signed-off-by: Thomas Haller (cherry picked from commit faa6c34db1a24e268982c8309f885f9c6a76c638) --- libnm-glib/tests/test-remote-settings-client.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libnm-glib/tests/test-remote-settings-client.c b/libnm-glib/tests/test-remote-settings-client.c index 301a48d883..a13e8311cb 100644 --- a/libnm-glib/tests/test-remote-settings-client.c +++ b/libnm-glib/tests/test-remote-settings-client.c @@ -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) /*******************************************************************/