[network-manager-openvpn] nmtst: allow non-boolean argument to nmtst_assert_success()
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn] nmtst: allow non-boolean argument to nmtst_assert_success()
- Date: Mon, 9 May 2016 11:35:07 +0000 (UTC)
commit 3d0ac3ca94b4bf24f77306cef5a95172ddaf5fc4
Author: Thomas Haller <thaller redhat com>
Date: Mon May 9 13:34:08 2016 +0200
nmtst: allow non-boolean argument to nmtst_assert_success()
Reimplement nmtst_assert_success() as a macro which allows non-boolean @success
arguments.
(re-import file from NetworkManager's shared directory)
shared/nm-test-utils.h | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/shared/nm-test-utils.h b/shared/nm-test-utils.h
index 0759b3c..0875518 100644
--- a/shared/nm-test-utils.h
+++ b/shared/nm-test-utils.h
@@ -153,13 +153,11 @@
g_assert_not_reached (); \
} G_STMT_END
-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
: "(no error)");
-}
-#define nmtst_assert_success(success, error) _nmtst_assert_success ((success), (error), __FILE__, __LINE__)
+#define nmtst_assert_success(success, error) \
+ G_STMT_START { \
+ g_assert_no_error (error); \
+ g_assert ((success)); \
+ } G_STMT_END
#define nmtst_assert_no_success(success, error) \
G_STMT_START { \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]