X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-posixtm.c;h=4ee6c6b212898d9813ac1c871f506e35d27e4f75;hb=721f56dcf49f8f004f609cc966f876922faad1a8;hp=0e6167f752e283e62f643dd294bf9fdc65884bb1;hpb=eee5595d424b0df7e9a135dbf11b999673a821f0;p=gnulib.git diff --git a/tests/test-posixtm.c b/tests/test-posixtm.c index 0e6167f75..4ee6c6b21 100644 --- a/tests/test-posixtm.c +++ b/tests/test-posixtm.c @@ -1,5 +1,5 @@ -/* Test that openat_safer leave standard fds alone. - Copyright (C) 2009 Free Software Foundation, Inc. +/* Test that posixtime works as required. + Copyright (C) 2009-2011 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 @@ -27,20 +27,7 @@ #include #include "intprops.h" - -#define STREQ(a, b) (strcmp (a, b) == 0) - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" struct posixtm_test { @@ -59,7 +46,13 @@ static struct posixtm_test const T[] = { "12131415.16", 13, 1, 0}, /* ??? Dec 13 14:15:16 ???? */ { "12131415", 13, 1, 0}, /* ??? Dec 13 14:15:00 ???? */ + /* These two tests fail on 64-bit Solaris up through at least + Solaris 10, which is off by one day for time stamps before + 0001-01-01 00:00:00 UTC. */ { "000001010000.00", 13, 1, -62167219200}, /* Sat Jan 1 00:00:00 0 */ + { "000012312359.59", 13, 1, -62135596801}, /* Fri Dec 31 23:59:59 0 */ + + { "000101010000.00", 13, 1, -62135596800}, /* Sat Jan 1 00:00:00 1 */ { "190112132045.51", 13, 1, -2147483649}, /* Fri Dec 13 20:45:51 1901 */ { "190112132045.52", 13, 1, -2147483648}, /* Fri Dec 13 20:45:52 1901 */ { "190112132045.53", 13, 1, -2147483647}, /* Fri Dec 13 20:45:53 1901 */ @@ -101,7 +94,7 @@ static struct posixtm_test const T[] = }; int -main (int argc, char **argv) +main (void) { unsigned int i; int fail = 0;