about summary refs log tree commit diff
path: root/time/tst-posixtz.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-03-10 15:23:46 +0000
committerUlrich Drepper <drepper@redhat.com>2009-03-10 15:23:46 +0000
commit686f8c9daf0ee99cf24894747987376577efa612 (patch)
treea8af6b7281fed13ae655daed6d98a44037bd170f /time/tst-posixtz.c
parent7db0cc42453f96dd52a972bdcaaa6e79fd96059c (diff)
downloadglibc-686f8c9daf0ee99cf24894747987376577efa612.tar.gz
glibc-686f8c9daf0ee99cf24894747987376577efa612.tar.xz
glibc-686f8c9daf0ee99cf24894747987376577efa612.zip
* time/tzset.c (__tzset_parse_tz): Use correct string when parsing
	DST name.
	* time/tst-posixtz.c: Add tests for quoted timezone names.
Diffstat (limited to 'time/tst-posixtz.c')
-rw-r--r--time/tst-posixtz.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/time/tst-posixtz.c b/time/tst-posixtz.c
index ccba63e5b4..019d92ada0 100644
--- a/time/tst-posixtz.c
+++ b/time/tst-posixtz.c
@@ -18,6 +18,10 @@ struct
     "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" },
+  { 909312849L, "EST5EDT,M4.1.0/2,M10.5.0/2",
+    "1998/10/25 05:54:09 dst=0 zone=EST" },
+  { 909312849L, "<EST5>5EDT,M4.1.0/2,M10.5.0/2",
+    "1998/10/25 05:54:09 dst=0 zone=EST5" },
   { 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",
@@ -84,5 +88,31 @@ main (void)
       puts (", FAIL");
     }
 
+  setenv ("TZ", "<AB1>-10<AB2>-11,M10.5.0,M3.5.0", 1);
+  tzset ();
+  printf ("TZ = \"<AB1>-10<AB2>-11,M10.5.0,M3.5.0\" daylight %d"
+	  " tzname = { \"%s\", \"%s\" }", daylight, tzname[0], tzname[1]);
+  if (daylight
+      && strcmp (tzname[0], "AB1") == 0 && strcmp (tzname[1], "AB2") == 0)
+    puts (", OK");
+  else
+    {
+      result = 1;
+      puts (", FAIL");
+    }
+
+  setenv ("TZ", "<BB1>-10", 1);
+  tzset ();
+  printf ("TZ = \"<BB1>-10\" daylight %d"
+	  " tzname = { \"%s\", \"%s\" }", daylight, tzname[0], tzname[1]);
+  if (daylight == 0
+      && strcmp (tzname[0], "BB1") == 0 && strcmp (tzname[1], "BB1") == 0)
+    puts (", OK");
+  else
+    {
+      result = 1;
+      puts (", FAIL");
+    }
+
   return result;
 }