From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 4/5] libqtest: Inline g_assert_no_errno()
Date: Wed, 10 Oct 2018 08:11:12 +0200 [thread overview]
Message-ID: <20181010061113.6057-5-armbru@redhat.com> (raw)
In-Reply-To: <20181010061113.6057-1-armbru@redhat.com>
Macro g_assert_no_errno() intrudes into GLib's namespace. It's also
pretty pointless. Inline.
At one call site, its redundancy is now obvious. Delete it there.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180926122933.3858-1-armbru@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
tests/libqtest.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 2cd5736642..44ce118cfc 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -48,10 +48,6 @@ struct QTestState
static GHookList abrt_hooks;
static struct sigaction sigact_old;
-#define g_assert_no_errno(ret) do { \
- g_assert_cmpint(ret, !=, -1); \
-} while (0)
-
static int qtest_query_target_endianness(QTestState *s);
static int init_socket(const char *socket_path)
@@ -61,7 +57,7 @@ static int init_socket(const char *socket_path)
int ret;
sock = socket(PF_UNIX, SOCK_STREAM, 0);
- g_assert_no_errno(sock);
+ g_assert_cmpint(sock, !=, -1);
addr.sun_family = AF_UNIX;
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path);
@@ -70,9 +66,9 @@ static int init_socket(const char *socket_path)
do {
ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr));
} while (ret == -1 && errno == EINTR);
- g_assert_no_errno(ret);
+ g_assert_cmpint(ret, !=, -1);
ret = listen(sock, 1);
- g_assert_no_errno(ret);
+ g_assert_cmpint(ret, !=, -1);
return sock;
}
@@ -325,7 +321,6 @@ static void socket_send(int fd, const char *buf, size_t size)
continue;
}
- g_assert_no_errno(len);
g_assert_cmpint(len, >, 0);
offset += len;
--
2.17.1
next prev parent reply other threads:[~2018-10-10 6:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 6:11 [Qemu-devel] [PULL 0/5] Miscellaneous patches for 2018-10-10 Markus Armbruster
2018-10-10 6:11 ` [Qemu-devel] [PULL 1/5] tests/check-qjson: fix a leak Markus Armbruster
2018-10-10 6:11 ` [Qemu-devel] [PULL 2/5] qapi/misc.json: Remove superfluous words in CpuModelExpansionType Markus Armbruster
2018-10-10 6:11 ` [Qemu-devel] [PULL 3/5] tests: Restore check-qdict unit test Markus Armbruster
2018-10-10 16:43 ` Eric Blake
2018-10-10 16:57 ` Philippe Mathieu-Daudé
2018-10-10 6:11 ` Markus Armbruster [this message]
2018-10-10 6:11 ` [Qemu-devel] [PULL 5/5] ivshmem: Fix unplug of device "ivshmem-plain" Markus Armbruster
2018-10-11 11:57 ` [Qemu-devel] [PULL 0/5] Miscellaneous patches for 2018-10-10 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181010061113.6057-5-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).