diff options
Diffstat (limited to 'include/nm-test-utils.h')
-rw-r--r-- | include/nm-test-utils.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h index 0cde9a4b91..4610ee62a6 100644 --- a/include/nm-test-utils.h +++ b/include/nm-test-utils.h @@ -123,6 +123,14 @@ nmtst_assert_error (GError *error, } } +inline static void +_nmtst_assert_success (gboolean success, GError *error, const char *file, int line) +{ + if (!success || error) + g_error ("(%s:%d) FAILURE success=%d, error=%s", file, line, success, error && error->message ? error->message : "(no error)"); +} +#define nmtst_assert_success(success, error) _nmtst_assert_success ((success), (error), __FILE__, __LINE__) + /*******************************************************************************/ struct __nmtst_internal |