summaryrefslogtreecommitdiff
path: root/tests/test-stat-time.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:50 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:50 +0100
commitff33e1d252f46bec1a33e28700da3282fc24047a (patch)
tree5c15bc695be820b393a8496c5807ecafbbdeb89b /tests/test-stat-time.c
parentb2ac982cc8b5290699eb5f52fb043d3d15e2624b (diff)
parent5f59a34ab747dde8ede7357f3431bf06bd6002fe (diff)
Update upstream source from tag 'upstream/1.4.2'
Update to upstream version '1.4.2' with Debian dir 493e96bcd865e4f9990e20bee26408c96231d727
Diffstat (limited to 'tests/test-stat-time.c')
-rw-r--r--tests/test-stat-time.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/test-stat-time.c b/tests/test-stat-time.c
index 19ecc838..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-2025 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)