[PATCH 3/2] statvfs: f_type: NEWS & test
Florian Weimer
fweimer@redhat.com
Mon Jun 26 13:58:59 GMT 2023
* наб:
> /* 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
More information about the Libc-alpha
mailing list