summaryrefslogtreecommitdiff
path: root/tests/test-posixtm.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* posixtm tests: Fix warnings seen on MidnightBSD/x86.Bruno Haible2021-02-081-1/+1
| | | | | * tests/test-posixtm.c (main): Convert two 'time_t' values to 'long' for printing.
* posixtm tests: Disable part of the test on plaforms where it fails.Bruno Haible2021-01-011-4/+4
| | | | * tests/test-posixtm.c (T): Disable two tests on macOS as well.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* posixtm tests: Disable part of the test on plaforms where it fails.Bruno Haible2021-01-011-1/+3
| | | | * tests/test-posixtm.c (T): Disable two tests on Solaris.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* posixtm: remove PDS_LEADING_YEARPaul Eggert2017-11-241-44/+46
| | | | | | | | | | | | | | | | | This changes the API slightly, in a hopefully-innocuous way. Without this change the code had undefined behavior when a caller specified neither PDS_LEADING_YEAR nor PDS_TRAILING_YEAR. Problem reported by Pádraig Brady in: https://lists.gnu.org/r/bug-gnulib/2017-11/msg00048.html * NEWS: Mention this. * lib/posixtm.c (posix_time_parse): Treat the absence of PDS_TRAILING_YEAR as if PDS_LEADING_YEAR were present. * lib/posixtm.h (PDS_LEADING_YEAR): Remove (actually, leave it present, but define it as zero, for compatibility with existing source code). All other PDS_* values moved up. * tests/test-posixtm.c (LY): New macro. (T): Use it. Do not expect a particular numeric encoding for PDS_CENTURY etc.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* maint: time stamp -> timestampPaul Eggert2017-01-091-1/+1
| | | | Use the spelling "timestamp", as that is what POSIX uses.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* posixtm-tests: port to buggy compilerPaul Eggert2012-06-211-10/+18
| | | | | | | | | | | | Problem reported by Simon Josefsson in <http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00246.html>. * modules/posixtm-tests (Depends-on): Add stdint. * tests/test-posixtm.c (struct posixtm_test.t_expected): Now of type int_least64_t, not int64_t, both because that's what INT64_C returns and because int_least64_t works even on 72-bit hosts. (T): Use INT64_C on constants outside the traditional int range, to work around compiler bug noted by Simon.
* test-posixtm: don't assume signed integer wraparoundPaul Eggert2012-01-041-2/+5
| | | | | | | * tests/test-posixtm.c (main): Don't assume wraparound semantics after signed integer overflow. Inspired by (though it may not fix) Bruno Haible's bug report in <http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00066.html>.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* test-posixtm.c: add two testsPaul Eggert2010-12-221-0/+6
| | | | | | * tests/test-posixtm.c: Add two tests, to highlight the bug in Solaris 10 (and earlier) localtime. Gnulib doesn't work around this bug; this is merely to document it.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Refactor common macros used in tests.Bruno Haible2009-12-241-12/+1
|
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-8/+8
|
* tests: avoid several compiler warningsEric Blake2009-10-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-getcwd.c (main): Avoid buffer underflow. * tests/test-getdate.c (main): String literals are not safe with putenv, so use setenv. Declare unused argument. * modules/getdate-tests (Depends-on): Add setenv. * tests/test-argv-iter.c (main): Declare unused argument. Avoid problems with string literals in char *. * tests/test-hash.c (main): Avoid shadowing declaration. (insert_new): Treat string literals as char const *. * tests/test-getopt.h (test_getopt): Likewise. (getopt_loop): Alter types to minimize casting elsewhere. * tests/test-getopt_long.h (test_getopt_long, getopt_long_loop) (test_getopt_long_posix): Likewise. (do_getopt_long): Add wrapper to minimize casting. * tests/test-atexit.c (clear_temp_file): Use void. * tests/test-areadlink-with-size.c (main): Declare unused arguments. * tests/test-areadlink.c (main): Likewise. * tests/test-areadlinkat-with-size.c (main): Likewise. * tests/test-areadlinkat.c (main): Likewise. * tests/test-canonicalize-lgpl.c (main): Likewise. * tests/test-canonicalize.c (main): Likewise. * tests/test-dirent-safer.c (main): Likewise. * tests/test-dirname.c (main): Likewise. * tests/test-dup2.c (main): Likewise. * tests/test-fchdir.c (main): Likewise. * tests/test-fcntl-h.c (main): Likewise. * tests/test-fcntl-safer.c (main): Likewise. * tests/test-fdopendir.c (main): Likewise. * tests/test-fdutimensat.c (main): Likewise. * tests/test-fflush.c (main): Likewise. * tests/test-filenamecat.c (main): Likewise. * tests/test-filevercmp.c (main): Likewise. * tests/test-fopen-safer.c (main): Likewise. * tests/test-fopen.c (main): Likewise. * tests/test-fpending.c (main): Likewise. * tests/test-fpurge.c (main): Likewise. * tests/test-freading.c (main): Likewise. * tests/test-fstatat.c (main): Likewise. * tests/test-fsync.c (main): Likewise. * tests/test-futimens.c (main): Likewise. * tests/test-getndelim2.c (main): Likewise. * tests/test-gettimeofday.c (main): Likewise. * tests/test-getopt.c (main): Likewise. * tests/test-i-ring.c (main): Likewise. * tests/test-inttypes.c (main): Likewise. * tests/test-link.c (main): Likewise. * tests/test-lstat.c (main): Likewise. * tests/test-math.c (main): Likewise. * tests/test-md5.c (main): Likewise. * tests/test-memchr2.c (main): Likewise. * tests/test-memrchr.c (main): Likewise. * tests/test-mkdir.c (main): Likewise. * tests/test-mkdirat.c (main): Likewise. * tests/test-mkfifoat.c (main): Likewise. * tests/test-open.c (main): Likewise. * tests/test-openat-safer.c (main): Likewise. * tests/test-openat.c (main): Likewise. * tests/test-quotearg.c (main): Likewise. * tests/test-rawmemchr.c (main): Likewise. * tests/test-readlink.c (main): Likewise. * tests/test-remove.c (main): Likewise. * tests/test-rename.c (main): Likewise. * tests/test-renameat.c (main): Likewise. * tests/test-rmdir.c (main): Likewise. * tests/test-sha1.c (main): Likewise. * tests/test-signal.c (main): Likewise. * tests/test-sigaction.c (main): Likewise. * tests/test-stat.c (main): Likewise. * tests/test-stat-time.c (main): Likewise. * tests/test-stddef.c (main): Likewise. * tests/test-stdint.c (main): Likewise. * tests/test-stdio.c (main): Likewise. * tests/test-stdlib.c (main): Likewise. * tests/test-strchrnul.c (main): Likewise. * tests/test-strerror.c (main): Likewise. * tests/test-string.c (main): Likewise. * tests/test-strtod.c (main): Likewise. * tests/test-strverscmp.c (main): Likewise. * tests/test-symlink.c (main): Likewise. * tests/test-symlinkat.c (main): Likewise. * tests/test-sys_stat.c (main): Likewise. * tests/test-sys_time.c (main): Likewise. * tests/test-time.c (main): Likewise. * tests/test-unistd.c (main): Likewise. * tests/test-unlink.c (main): Likewise. * tests/test-unlinkat.c (main): Likewise. * tests/test-utimens.c (main): Likewise. * tests/test-utimensat.c (main): Likewise. * tests/test-version-etc.c (main): Likewise. * tests/test-wchar.c (main): Likewise. * tests/test-wctype.c (main): Likewise. * tests/test-xprintf-posix.c (main): Likewise. * tests/test-posixtm.c (main): Likewise. (STREQ): Delete unused macro. * tests/test-linkat.c (main): Declare unused arguments. Avoid shadowed variables. * tests/test-memchr.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* test-posixtm.c: correct a commentJim Meyering2009-09-191-1/+1
| | | | | * tests/test-posixtm.c: Correct first-line comment. Spotted by Eric Blake.
* posixtm-tests: revampJim Meyering2009-09-191-82/+93
| | | | | | | | | | | | | | | Record only the expected time_t value, not the ctime string. Skip any test that would require a time_t value larger than currently representable (e.g., if run with 32-bit time_t, this skips any test that expects an out-of-range value). * tests/test-posixtm.c (struct posixtm_test) [valid, t_expected]: New members. [expected]: Remove member. (T): Include new column: valid. Move date strings into comments. (main): Adapt. Print a diagnostic for each skipped test. Don't skip the entire test (exit 77) if time_t is unsigned. Instead, skip only the individual tests with a negative result.
* posixtm-tests: make T const-correct; add a test caseJim Meyering2009-09-191-3/+2
| | | | | | * tests/test-posixtm.c (T): Declare const. Add a test for -(2^31+1). Remove useless can-succeed-only-in-2002 test.
* posixtm-tests: correct the sole failing testJim Meyering2009-09-191-1/+1
| | | | | | * tests/test-posixtm.c: Correct 0000-01-01 00:00:00 test so that expected output matches what mktime now produces. Cross-checked via erlang's calendar:datetime_to_gregorian_seconds({{1970,1,1},{0,0,0}})
* posixtm: move #ifdef'd tests into a new moduleJim Meyering2009-09-191-0/+175
* lib/posixtm.c (posixtime): Remove #ifdef'd tests. Move to... * tests/test-posixtm.c: ... this new file. * modules/posixtm-tests: New module.