public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: наб <nabijaczleweli@nabijaczleweli.xyz>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 3/2] statvfs: f_type: NEWS & test
Date: Mon, 26 Jun 2023 15:58:59 +0200	[thread overview]
Message-ID: <874jmu5nq4.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <nlbgowoon2rcgb76nod3elhsvczmrit7t7ul2mbf36h7xdfo5w@ckpcvznp6g6l> (=?utf-8?B?ItC90LDQsSIncw==?= message of "Mon, 26 Jun 2023 15:50:09 +0200")

* наб:

>  /* This test cannot detect many errors.  But it will fail if the
> @@ -11,17 +13,18 @@ do_test (int argc, char *argv[])
>    for (int i = 1; i < argc; ++i)
>      {
>        struct statvfs st;
> -      if (statvfs (argv[i], &st) != 0)
> -        printf ("%s: failed (%m)\n", argv[i]);
> -      else
> -        printf ("%s: free: %llu, mandatory: %s\n", argv[i],
> -                (unsigned long long int) st.f_bfree,
> +      struct statfs stf;
> +      TEST_VERIFY (statvfs (argv[i], &st) == 0);
> +      TEST_VERIFY (statfs (argv[i], &stf) == 0);
> +      TEST_VERIFY (st.f_type == stf.f_type);

These TEST_VERIFYs could use TEST_COMPARE for better diagnostics on
failure.

Thanks,
Florian


  reply	other threads:[~2023-06-26 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23 20:36 [PATCH 1/2] hurd: statvfs: __f_type -> f_type наб
2023-06-23 20:37 ` [PATCH 2/2] linux: statvfs: allocate spare for f_type наб
2023-06-26 13:15   ` Florian Weimer
2023-06-26 13:50     ` [PATCH 3/2] statvfs: f_type: NEWS & test наб
2023-06-26 13:58       ` Florian Weimer [this message]
2023-06-26 15:29         ` [PATCH v2 " наб
2023-06-25  6:43 ` [PATCH 1/2] hurd: statvfs: __f_type -> f_type Samuel Thibault

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=874jmu5nq4.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nabijaczleweli@nabijaczleweli.xyz \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).