about summary refs log tree commit diff
path: root/time/tst-posixtz.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-03-12 07:50:21 +0000
committerUlrich Drepper <drepper@redhat.com>2002-03-12 07:50:21 +0000
commita3931cbec9b380252d89fab3980a9dbb0b2f4152 (patch)
tree5146ad63772c54862069f7e258cf4fe4785ab617 /time/tst-posixtz.c
parentbc15410ecef25eaee06963ff6d9e1acf10aae1a9 (diff)
downloadglibc-a3931cbec9b380252d89fab3980a9dbb0b2f4152.tar.gz
glibc-a3931cbec9b380252d89fab3980a9dbb0b2f4152.tar.xz
glibc-a3931cbec9b380252d89fab3980a9dbb0b2f4152.zip
Update.
2002-03-07  Jakub Jelinek  <jakub@redhat.com>

	* time/tst-posixtz.c (tests): Add new tests.
	(main): Test whether tzset() sets daylight properly.

2002-03-06  Jakub Jelinek  <jakub@redhat.com>

	* time/tzset.c (tz_compute): Move __daylight, __tzname and
	__tzname_cur_max setting...
	(tzset_internal): ...here.

2002-03-06  Jakub Jelinek  <jakub@redhat.com>

	* time/tzset.c (compute_change): Don't return any value.
	(tz_compute): Likewise.  Don't handle southern hemisphere here.
	(__tz_convert): But here.
Diffstat (limited to 'time/tst-posixtz.c')
-rw-r--r--time/tst-posixtz.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/time/tst-posixtz.c b/time/tst-posixtz.c
index 00a16499f3..8c36513b0c 100644
--- a/time/tst-posixtz.c
+++ b/time/tst-posixtz.c
@@ -14,6 +14,14 @@ struct
     "1998/10/25 21:54:09 dst=1 zone=AEDST" },
   { 924864849L, "AEST-10AEDST-11,M10.5.0,M3.5.0",
     "1999/04/23 20:54:09 dst=0 zone=AEST" },
+  { 919973892L, "AEST-10AEDST-11,M10.5.0,M3.5.0",
+    "1999/02/26 07:18:12 dst=1 zone=AEDST" },
+  { 909312849L, "EST+5EDT,M4.1.0/2,M10.5.0/2",
+    "1998/10/25 05:54:09 dst=0 zone=EST" },
+  { 924864849L, "EST+5EDT,M4.1.0/2,M10.5.0/2",
+    "1999/04/23 06:54:09 dst=1 zone=EDT" },
+  { 919973892L, "EST+5EDT,M4.1.0/2,M10.5.0/2",
+    "1999/02/25 15:18:12 dst=0 zone=EST" },
 };
 
 int
@@ -51,5 +59,30 @@ main (void)
 	}
     }
 
+  setenv ("TZ", "Universal", 1);
+  localtime (&tests[0].when);
+  printf ("TZ = \"Universal\" daylight %d tzname = { \"%s\", \"%s\" }",
+	  daylight, tzname[0], tzname[1]);
+  if (! daylight)
+    puts (", OK");
+  else
+    {
+      result = 1;
+      puts (", FAIL");
+    }
+
+  setenv ("TZ", "AEST-10AEDST-11,M10.5.0,M3.5.0", 1);
+  tzset ();
+  printf ("TZ = \"AEST-10AEDST-11,M10.5.0,M3.5.0\" daylight %d"
+	  " tzname = { \"%s\", \"%s\" }", daylight, tzname[0], tzname[1]);
+  if (daylight
+      && strcmp (tzname[0], "AEST") == 0 && strcmp (tzname[1], "AEDST") == 0)
+    puts (", OK");
+  else
+    {
+      result = 1;
+      puts (", FAIL");
+    }
+
   return result;
 }