1 /* Test of file timestamp modification functions.
2 Copyright (C) 2009, 2010 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 /* This file defines some prerequisites useful to utime-related tests. */
19 #ifndef GL_TEST_UTIMENS_COMMON
20 # define GL_TEST_UTIMENS_COMMON
28 # include "stat-time.h"
29 # include "timespec.h"
30 # include "utimecmp.h"
32 /* Gnulib test header. */
36 BILLION = 1000 * 1000 * 1000,
38 Y2K = 946684800, /* Jan 1, 2000, in seconds since epoch. */
40 /* Bogus positive and negative tv_nsec values closest to valid
41 range, but without colliding with UTIME_NOW or UTIME_OMIT. */
42 UTIME_BOGUS_POS = BILLION + ((UTIME_NOW == BILLION || UTIME_OMIT == BILLION)
43 ? (1 + (UTIME_NOW == BILLION + 1)
44 + (UTIME_OMIT == BILLION + 1))
46 UTIME_BOGUS_NEG = -1 - ((UTIME_NOW == -1 || UTIME_OMIT == -1)
47 ? (1 + (UTIME_NOW == -2) + (UTIME_OMIT == -2))
51 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
52 /* Skip ctime tests on native Windows, since it is either a copy of
53 mtime or birth time (depending on the file system), rather than a
54 properly tracked change time. */
55 # define check_ctime 0
57 # define check_ctime 1
60 #endif /* GL_TEST_UTIMENS_COMMON */