Home | History | Annotate | Download | only in time
History log of /src/tests/lib/libc/time/t_strptime.c
RevisionDateAuthorComments
 1.17  26-Mar-2024  rillig t_strptime: fix typo in test description
 1.16  16-Mar-2024  riastradh strptime(3): Exercise some edge cases in the automatic tests.

Unfortunately, we can't quite use strptime as a black box to detect
the cases that triggered undefined behaviour, because strptime just
fails in that case anyway since the number that would go in .tm_year
is far out of the representable range.

PR lib/58041
 1.15  03-Jun-2018  maya branches: 1.15.4; 1.15.12;
use ATF_CHECK instead of ATF_REQUIRE
(continue on failure, to see the rest of the failures)

From Ngie Cooper in PR bin/51834
 1.14  27-Oct-2017  kre branches: 1.14.2;

The Zone test was obviously intended to test %Z rather than %z, otherwise
it would be (and has been) identical to the zone test, which would be a
pointless waste of time.
 1.13  24-Aug-2017  ginsbach The military/nautical time zones were added following RFC 822 and RFC
2822 specifications. Unfortunately they are specified incorrectly in
RFC-822 and not very clearly in RFC 2822. RFC 1123 clearly states they
are specified incorrectly - counting the wrong way from UTC - in RFC
822. RFC 2822 just states they were implemented in a non-standard way.
Mea culpa for not noticing when originally implemented. Fix them so
the correct calculations are made.
 1.12  31-Oct-2015  christos merge more the tests
 1.11  31-Oct-2015  christos Account for J, fix %Z
 1.10  30-Oct-2015  christos tests for %Z
 1.9  30-Oct-2015  ginsbach ISO 8601 and RFC 3339 specify that an offset can be up to 23:59 and
not 12:00 east/west. Just proves that one shouldn't use other
implementations as a canonical reference. Thanks to all who pointed
this out.
 1.8  30-Oct-2015  ginsbach Additional tests for timezone offsets.
 1.7  29-Oct-2015  christos Add tests for %z
 1.6  04-Jul-2015  christos strptime now sets tm_yday
 1.5  28-Apr-2015  ginsbach Add hour tests as a standalone test case.
 1.4  22-Apr-2015  ginsbach Make century and year conversion tests a standalone test case rather than
part of the "common" test case.
 1.3  21-Apr-2015  ginsbach Make seconds conversion tests a standalone test case rather than
part of the "common" test case.
 1.2  17-Apr-2015  ginsbach Add more detail to test descriptions.
 1.1  13-Jan-2011  pgoyette Move t_mktime and t_strptime to their own ..../time/ subdirectory.

(Concurrence from christos@)
 1.14.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.15.12.1  25-Mar-2024  martin Pull up following revision(s) (requested by riastradh in ticket #638):

lib/libc/time/strptime.c: revision 1.64
lib/libc/time/strptime.c: revision 1.65
tests/lib/libc/time/t_strptime.c: revision 1.16

strptime(3): Exercise some edge cases in the automatic tests.

Unfortunately, we can't quite use strptime as a black box to detect
the cases that triggered undefined behaviour, because strptime just
fails in that case anyway since the number that would go in .tm_year
is far out of the representable range.
PR lib/58041

strptime(3): Avoid arithmetic overflow.
PR lib/58041

strptime(3): Reduce unnecessary indentation.
Post-fix tidying.
No functional change intended.
PR lib/58041
 1.15.4.1  24-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1881):

lib/libc/time/strptime.c: revision 1.64 (patch)
lib/libc/time/strptime.c: revision 1.65 (patch)
lib/libc/time/strptime.c: revision 1.66 (patch)
tests/lib/libc/time/t_strptime.c: revision 1.16 (patch)

strptime(3): Exercise some edge cases in the automatic tests.

Unfortunately, we can't quite use strptime as a black box to detect
the cases that triggered undefined behaviour, because strptime just
fails in that case anyway since the number that would go in .tm_year
is far out of the representable range.
PR lib/58041

strptime(3): Avoid arithmetic overflow.
PR lib/58041

strptime(3): Reduce unnecessary indentation.
Post-fix tidying.
No functional change intended.
PR lib/58041

strptime(3): Declare digit d as time_t.

This doesn't make a semantic difference -- d can only take on the ten
values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all
comes out the same whether the type is unsigned or time_t, even if
time_t were int32_t instead of int64_t.

But it pacifies overzealous compilers used by downstream users of
this code. And while it's silly to use a much wider type (64-bit
signed) than is needed here to store a single digit, it doesn't
really hurt either (32-bit unsigned is much larger than needed too).

PR lib/58041

RSS XML Feed