about summary refs log tree commit diff
path: root/time/tst-mktime.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-04-15 06:37:43 +0000
committerUlrich Drepper <drepper@redhat.com>2002-04-15 06:37:43 +0000
commit78575a842bce4d8e8c725506da1f826d16b660eb (patch)
tree5167b04e3c2f195c79de8bb27d23194a88d78cc3 /time/tst-mktime.c
parentfab656f5a776f09596b9e74f9a43f8300dd724c7 (diff)
downloadglibc-78575a842bce4d8e8c725506da1f826d16b660eb.tar.gz
glibc-78575a842bce4d8e8c725506da1f826d16b660eb.tar.xz
glibc-78575a842bce4d8e8c725506da1f826d16b660eb.zip
Update.
2002-04-14  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-lookup.c (_dl_lookup_symbol): Move add_dependency call to
	the end of the function.  Pass original flags to recursive call if
	add_dependency failed.
	(_dl_lookup_versioned_symbol): Likewise.

2002-04-13  Jakub Jelinek  <jakub@redhat.com>

	* time/mktime.c (__mktime_internal): If year is 69, don't bail out
	early, but check whether it overflowed afterwards.
	* time/tst-mktime.c (main): Add new tests.

	* debug/xtrace.sh: Fix program name in help message.
	Patch by Roger Luethi <rl@hellgate.ch>.
Diffstat (limited to 'time/tst-mktime.c')
-rw-r--r--time/tst-mktime.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/time/tst-mktime.c b/time/tst-mktime.c
index 70c123c3f9..7ce1d45dd5 100644
--- a/time/tst-mktime.c
+++ b/time/tst-mktime.c
@@ -5,7 +5,8 @@
 int
 main (void)
 {
-  struct tm time_str;
+  struct tm time_str, *tm;
+  time_t t;
   char daybuf[20];
   int result;
 
@@ -29,5 +30,38 @@ main (void)
       result = strcmp (daybuf, "Wednesday") != 0;
     }
 
+  setenv ("TZ", "EST", 1);
+#define EVENING69 1 * 60 * 60 + 2 * 60 + 29
+  t = EVENING69;
+  tm = localtime (&t);
+  if (tm == NULL)
+    {
+      (void) puts ("localtime returned NULL");
+      result = 1;
+    }
+  else
+    {
+      time_str = *tm;
+      t = mktime (&time_str);
+      if (t != EVENING69)
+        {
+          printf ("mktime returned %ld, expected %ld\n",
+		  (long) t, EVENING69);
+	  result = 1;
+        }
+      else
+        (void) puts ("Dec 31 1969 EST test passed");
+
+      setenv ("TZ", "CET", 1);
+      t = mktime (&time_str);
+      if (t != (time_t) -1)
+        {
+	  printf ("mktime returned %ld, expected -1\n", (long) t);
+	  result = 1;
+        }
+      else
+        (void) puts ("Dec 31 1969 CET test passed");
+    }
+
   return result;
 }