qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 10/15] test-qapi-util: Use ERR_IS_* macros


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC 10/15] test-qapi-util: Use ERR_IS_* macros
Date: Tue, 13 Jun 2017 13:53:08 -0300

Signed-off-by: Eduardo Habkost <address@hidden>
---
 tests/test-qapi-util.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/test-qapi-util.c b/tests/test-qapi-util.c
index 374fa30078..fe232ef9ed 100644
--- a/tests/test-qapi-util.c
+++ b/tests/test-qapi-util.c
@@ -77,25 +77,25 @@ static void test_parse_qapi_name(void)
 
 static void successfn(Error **errp)
 {
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 }
 
 static void fail1(Error **errp)
 {
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 
     error_setg(errp, "error1");
 
-    g_assert(!errp || *errp);
+    g_assert(ERR_IS_IGNORED(errp) || ERR_IS_SET(errp));
 }
 
 static void fail2(Error **errp)
 {
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 
     error_setg(errp, "error2");
 
-    g_assert(!errp || *errp);
+    g_assert(ERR_IS_IGNORED(errp) || ERR_IS_SET(errp));
 }
 
 static void multifn(Error **errp)
@@ -124,13 +124,13 @@ static void test_propagate(void (*fn)(Error **), Error 
**errp)
     bool failed;
     Error *local_err = NULL;
 
-    g_assert(!errp || !*errp);
+    g_assert(ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
 
     fn(&local_err);
     failed = !!local_err;
     error_propagate(errp, local_err);
 
-    g_assert(!errp || (failed == !!*errp));
+    g_assert(ERR_IS_IGNORED(errp) || (failed == !!ERR_IS_SET(errp)));
 }
 
 static void test_error_api(void)
-- 
2.11.0.259.g40922b1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]