]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - timezone/tst-timezone.c
powerpc: floor/floorf refactor
[thirdparty/glibc.git] / timezone / tst-timezone.c
index 4c879163cf828e2f0d8a9fac97024809b623d0ad..c4d688025646e2a37c7e5925c699944697a03066 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 1998.
 
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <time.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdint.h>
 #include <unistd.h>
 
 int failed = 0;
@@ -44,7 +44,6 @@ static const struct test_times tests[] =
   { "America/Chicago", 1, 21600, {"CST", "CDT" }},
   { "America/Indiana/Indianapolis", 1, 18000, {"EST", "EDT" }},
   { "America/Los_Angeles", 1, 28800, {"PST", "PDT" }},
-  { "Asia/Tokyo", 1, -32400, {"JST", "JDT" }},
   { "Pacific/Auckland", 1, -43200, { "NZST", "NZDT" }},
   { NULL, 0, 0 }
 };
@@ -89,8 +88,8 @@ check_tzvars (const char *name, int dayl, int timez, const char *const tznam[])
 }
 
 
-int
-main (int argc, char ** argv)
+static int
+do_test (void)
 {
   time_t t;
   const struct test_times *pt;
@@ -128,8 +127,8 @@ main (int argc, char ** argv)
     strcpy (envstring, "TZ=Europe/London");
     putenv (envstring);
     t = mktime (&tmBuf);
-    snprintf (buf, sizeof (buf), "TZ=%s %ld %d %d %d %d %d %d %d %d %d",
-             getenv ("TZ"), t,
+    snprintf (buf, sizeof (buf), "TZ=%s %jd %d %d %d %d %d %d %d %d %d",
+             getenv ("TZ"), (intmax_t) t,
              tmBuf.tm_sec, tmBuf.tm_min, tmBuf.tm_hour,
              tmBuf.tm_mday, tmBuf.tm_mon, tmBuf.tm_year,
              tmBuf.tm_wday, tmBuf.tm_yday, tmBuf.tm_isdst);
@@ -151,8 +150,8 @@ main (int argc, char ** argv)
     strcpy (envstring, "TZ=GMT");
     /* No putenv call needed!  */
     t = mktime (&tmBuf);
-    snprintf (buf, sizeof (buf), "TZ=%s %ld %d %d %d %d %d %d %d %d %d",
-             getenv ("TZ"), t,
+    snprintf (buf, sizeof (buf), "TZ=%s %jd %d %d %d %d %d %d %d %d %d",
+             getenv ("TZ"), (intmax_t) t,
              tmBuf.tm_sec, tmBuf.tm_min, tmBuf.tm_hour,
              tmBuf.tm_mday, tmBuf.tm_mon, tmBuf.tm_year,
              tmBuf.tm_wday, tmBuf.tm_yday, tmBuf.tm_isdst);
@@ -168,3 +167,6 @@ main (int argc, char ** argv)
 
   return failed ? EXIT_FAILURE : EXIT_SUCCESS;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"