Fix LD_PROFILE
[platform/upstream/glibc.git] / time / tst-mktime2.c
index fe7c370..bc7cc58 100644 (file)
@@ -1,4 +1,6 @@
 /* Test program from Paul Eggert and Tony Leneis.  */
+
+#include <limits.h>
 #include <time.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -78,6 +80,7 @@ bigtime_test (int j)
   struct tm tm;
   time_t now;
   tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+  tm.tm_isdst = -1;
   now = mktime (&tm);
   if (now != (time_t) -1)
     {
@@ -101,7 +104,8 @@ static int
 do_test (void)
 {
   time_t t, delta;
-  int i, j;
+  int i;
+  unsigned int j;
 
   setenv ("TZ", "America/Sao_Paulo", 1);
   /* This test makes some buggy mktime implementations loop.
@@ -127,7 +131,7 @@ do_test (void)
       mktime_test ((time_t) (60 * 60));
       mktime_test ((time_t) (60 * 60 * 24));
 
-      for (j = 1; 0 < j; j *= 2)
+      for (j = 1; j <= INT_MAX; j *= 2)
        bigtime_test (j);
       bigtime_test (j - 1);
     }