From: Thomas Huth <thuth@redhat.com>
To: zhujun2 <zhujun2@cmss.chinamobile.com>, chen.zhang@intel.com
Cc: lvivier@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] tests/qtest: check the return value
Date: Tue, 21 Nov 2023 07:41:33 +0100 [thread overview]
Message-ID: <08e7104d-5a6c-4a4a-a737-200f04fffd57@redhat.com> (raw)
In-Reply-To: <20231121061630.3350-1-zhujun2@cmss.chinamobile.com>
Thanks, patch looks better this way, but I'd still like to ask you to fix
two small issues:
On 21/11/2023 07.16, zhujun2 wrote:
> These variables "ret" are never referenced in the code, that
s/, that/, thus/
> add check logic for the "ret"
>
> Signed-off-by: zhujun2 <zhujun2@cmss.chinamobile.com>
Could you *please* fix your ~/.gitconfig file, like we asked you last time
already:
https://lore.kernel.org/qemu-devel/27bd1017-fd0a-4e90-ae54-6064b434b9aa@redhat.com/
https://lore.kernel.org/qemu-devel/87sf5w198d.fsf@pond.sub.org/
Thanks,
Thomas
> ---
> tests/qtest/test-filter-mirror.c | 1 +
> tests/qtest/test-filter-redirector.c | 2 ++
> tests/qtest/virtio-net-test.c | 1 +
> 3 files changed, 4 insertions(+)
>
> diff --git a/tests/qtest/test-filter-mirror.c b/tests/qtest/test-filter-mirror.c
> index adeada3eb8..f3865f7519 100644
> --- a/tests/qtest/test-filter-mirror.c
> +++ b/tests/qtest/test-filter-mirror.c
> @@ -61,6 +61,7 @@ static void test_mirror(void)
> g_assert_cmpint(len, ==, sizeof(send_buf));
> recv_buf = g_malloc(len);
> ret = recv(recv_sock[0], recv_buf, len, 0);
> + g_assert_cmpint(ret, ==, len);
> g_assert_cmpstr(recv_buf, ==, send_buf);
>
> g_free(recv_buf);
> diff --git a/tests/qtest/test-filter-redirector.c b/tests/qtest/test-filter-redirector.c
> index e72e3b7873..a77d5fd8ec 100644
> --- a/tests/qtest/test-filter-redirector.c
> +++ b/tests/qtest/test-filter-redirector.c
> @@ -118,6 +118,7 @@ static void test_redirector_tx(void)
> g_assert_cmpint(len, ==, sizeof(send_buf));
> recv_buf = g_malloc(len);
> ret = recv(recv_sock, recv_buf, len, 0);
> + g_assert_cmpint(ret, ==, len);
> g_assert_cmpstr(recv_buf, ==, send_buf);
>
> g_free(recv_buf);
> @@ -185,6 +186,7 @@ static void test_redirector_rx(void)
> g_assert_cmpint(len, ==, sizeof(send_buf));
> recv_buf = g_malloc(len);
> ret = recv(backend_sock[0], recv_buf, len, 0);
> + g_assert_cmpint(ret, ==, len);
> g_assert_cmpstr(recv_buf, ==, send_buf);
>
> close(send_sock);
> diff --git a/tests/qtest/virtio-net-test.c b/tests/qtest/virtio-net-test.c
> index fab5dd8b05..b470d8c6e2 100644
> --- a/tests/qtest/virtio-net-test.c
> +++ b/tests/qtest/virtio-net-test.c
> @@ -92,6 +92,7 @@ static void tx_test(QVirtioDevice *dev,
>
> ret = recv(socket, buffer, len, 0);
> g_assert_cmpstr(buffer, ==, "TEST");
> + g_assert_cmpint(ret, ==, len);
> }
>
> static void rx_stop_cont_test(QVirtioDevice *dev,
next prev parent reply other threads:[~2023-11-21 6:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 8:00 [PATCH] tests/qtest: remove unused variables zhujun2
2023-11-15 8:08 ` Thomas Huth
2023-11-16 2:14 ` Zhang, Chen
2023-11-21 6:16 ` [PATCH] tests/qtest: check the return value zhujun2
2023-11-21 6:41 ` Thomas Huth [this message]
2023-11-21 8:08 ` Zhu Jun
2023-11-21 8:19 ` Thomas Huth
2023-11-21 7:09 ` Zhang, Chen
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=08e7104d-5a6c-4a4a-a737-200f04fffd57@redhat.com \
--to=thuth@redhat.com \
--cc=chen.zhang@intel.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhujun2@cmss.chinamobile.com \
/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).