All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-net 3/3] selftests: mptcp: sockopt: fix variable check in error reporting
Date: Tue, 2 Sep 2025 10:45:13 +0200	[thread overview]
Message-ID: <795a3eca-67f1-4c65-bfee-75e9eb1ca4dc@kernel.org> (raw)
In-Reply-To: <f4b4c993422545c2301ab38175e2788bd489ba8e.1756776801.git.tanggeliang@kylinos.cn>

Hi Geliang,

On 02/09/2025 03:38, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> The error message for mptcpi_bytes_acked comparison incorrectly
> references 'ret2' instead of 'ret'. Since the comparison is between
> mptcpi_bytes_acked and 'ret', the error output should consistently
> use 'ret' for both the expected value and difference calculation.
> 
> This patch corrects the variable usage in the error output to ensure
> accurate debugging information when the assertion fails.
> 
> Fixes: 5dcff89e1455 ("selftests: mptcp: explicitly tests aggregate counters")
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> index 8d590629a8e9..a61508270a5c 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> @@ -680,8 +680,8 @@ static void process_one_client(int fd, int pipefd)
>  			       s.last_sample.mptcpi_bytes_received - ret);
>  		if (s.last_sample.mptcpi_bytes_acked != ret)
>  			xerror("mptcpi_bytes_acked %" PRIu64 ", expect %" PRIu64,
> -			       s.last_sample.mptcpi_bytes_acked, ret2,
> -			       s.last_sample.mptcpi_bytes_acked - ret2);
> +			       s.last_sample.mptcpi_bytes_acked, ret,
> +			       s.last_sample.mptcpi_bytes_acked - ret);

Good catch! But I also just noticed there is one extra argument: you
have 2 "%", but 3 arguments after the string.

I guess the error should be:

  "mptcpi_bytes_acked %" PRIu64 ", expect %" PRIu64 ", diff %" PRIu64,
  (...)

(Same for the others above.) If yes, can you add this as part of the
same commit?

  selftests: mptcp: sockopt: fix error messages

(with a note about the fact the wrong variable was used)

>  	}
>  
>  	close(fd);

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2025-09-02  8:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  1:38 [PATCH mptcp-net 0/3] misc fixes for sockopt selftests Geliang Tang
2025-09-02  1:38 ` [PATCH mptcp-net 1/3] selftests: mptcp: close server file descriptor Geliang Tang
2025-09-02  8:44   ` Matthieu Baerts
2025-09-02  1:38 ` [PATCH mptcp-net 2/3] selftests: mptcp: avoid double closing pipe descriptor Geliang Tang
2025-09-02  8:45   ` Matthieu Baerts
2025-09-02  1:38 ` [PATCH mptcp-net 3/3] selftests: mptcp: sockopt: fix variable check in error reporting Geliang Tang
2025-09-02  8:45   ` Matthieu Baerts [this message]
2025-09-02  3:39 ` [PATCH mptcp-net 0/3] misc fixes for sockopt selftests MPTCP CI

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=795a3eca-67f1-4c65-bfee-75e9eb1ca4dc@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.