diff options
Diffstat (limited to 'tests/test-stat-time.c')
| -rw-r--r-- | tests/test-stat-time.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/test-stat-time.c b/tests/test-stat-time.c index c30b2256..7c6e5955 100644 --- a/tests/test-stat-time.c +++ b/tests/test-stat-time.c @@ -1,5 +1,5 @@ /* Test of <stat-time.h>. - Copyright (C) 2007-2024 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,8 +107,6 @@ do_stat (const char *filename, struct stat *p) static void prepare_test (struct stat *statinfo, struct timespec *modtimes) { - int i; - create_file (filename_stamp1); nap (); create_file (filename_testfile); @@ -125,7 +123,7 @@ prepare_test (struct stat *statinfo, struct timespec *modtimes) do_stat (filename_stamp3, &statinfo[3]); /* Now use our access functions. */ - for (i = 0; i < NFILES; ++i) + for (int i = 0; i < NFILES; ++i) { modtimes[i] = get_stat_mtime (&statinfo[i]); } @@ -134,8 +132,6 @@ prepare_test (struct stat *statinfo, struct timespec *modtimes) static void test_mtime (const struct stat *statinfo, struct timespec *modtimes) { - int i; - /* Use the struct stat fields directly. */ /* mtime(stamp1) < mtime(stamp2) */ ASSERT (statinfo[0].st_mtime < statinfo[2].st_mtime @@ -159,7 +155,7 @@ test_mtime (const struct stat *statinfo, struct timespec *modtimes) && modtimes[2].tv_nsec < modtimes[3].tv_nsec)); /* verify equivalence */ - for (i = 0; i < NFILES; ++i) + for (int i = 0; i < NFILES; ++i) { struct timespec ts; ts = get_stat_mtime (&statinfo[i]); @@ -195,10 +191,8 @@ test_birthtime (const struct stat *statinfo, const struct timespec *modtimes, struct timespec *birthtimes) { - int i; - /* Collect the birth times. */ - for (i = 0; i < NFILES; ++i) + for (int i = 0; i < NFILES; ++i) { birthtimes[i] = get_stat_birthtime (&statinfo[i]); if (birthtimes[i].tv_nsec < 0) |
