X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-parse-datetime.c;h=a410d3d49d55d670c16963f2bb203d33350c2c25;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=902025fab054a28205452f29ffd7705d41e318d6;hpb=04c1ac696211fdbc9b2dcd0790c352ddb0e9402c;p=gnulib.git diff --git a/tests/test-parse-datetime.c b/tests/test-parse-datetime.c index 902025fab..a410d3d49 100644 --- a/tests/test-parse-datetime.c +++ b/tests/test-parse-datetime.c @@ -1,5 +1,5 @@ /* Test of parse_datetime() function. - Copyright (C) 2008-2012 Free Software Foundation, Inc. + Copyright (C) 2008-2014 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 @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* Written by Simon Josefsson , 2008. */ @@ -124,6 +123,12 @@ main (int argc _GL_UNUSED, char **argv) set_program_name (argv[0]); + /* Set the time zone to US Eastern time with the 2012 rules. This + should disable any leap second support. Otherwise, there will be + a problem with glibc on sites that default to leap seconds; see + . */ + setenv ("TZ", "EST5EDT,M3.2.0,M11.1.0", 1); + gmtoff = gmt_offset (ref_time); @@ -410,5 +415,9 @@ main (int argc _GL_UNUSED, char **argv) ASSERT (result.tv_sec == 24 * 3600 && result.tv_nsec == now.tv_nsec); + /* Exercise a sign-extension bug. Before July 2012, an input + starting with a high-bit-set byte would be treated like "0". */ + ASSERT ( ! parse_datetime (&result, "\xb0", &now)); + return 0; }