OSDN Git Service

Fix more harmony tests.
authorElliott Hughes <enh@google.com>
Sat, 30 Jan 2010 02:28:23 +0000 (18:28 -0800)
committerElliott Hughes <enh@google.com>
Sat, 30 Jan 2010 02:28:23 +0000 (18:28 -0800)
"HMG" means "heure du méridien de Greenwich" to the French. ICU thinks --
and the web seems to agree -- that the French actually say UTC instead.
(And you'd hope so, after it was called UTC instead of the more sensible UCT
just to keep them happy!) The RI thinks the French say "PST" rather than
"UTC-08:00", but that's hard to believe, and means that this test was never
testing RI compatibility anyway.

Relatedly, ICU thinks that "heure normale du Pacifique" is more French than
"Heure normale du Pacifique", and who am I to argue?

Fixing these turns up a real bug in TimeZone; this patch contains a fix to
the exception thrown by the test case, but not a fix for the bug (which is
overflow in inDaylightTime for the year 292278994, so there's plenty of
time to fix that one).

libcore/luni/src/test/java/tests/api/java/util/FormatterTest.java
libcore/luni/src/test/java/tests/api/java/util/TimeZoneTest.java

index 1b16c93..7709b88 100644 (file)
@@ -2209,13 +2209,13 @@ public class FormatterTest extends TestCase {
                 {new Date(1147327147578L),  'b', "mai"}, //$NON-NLS-2$
                 {paris,                     'b', "mai"}, //$NON-NLS-2$
                 {china,                     'b', "mai"}, //$NON-NLS-2$
-                {0L,                        'c', "jeu. janv. 01 08:00:00 HMG+08:00 1970"}, //$NON-NLS-2$
-                // {Long.MAX_VALUE,            'c', "dim. ao\u00fbt 17 15:12:55 HMG+08:00 292278994"}, //$NON-NLS-2$
-                {Long.MAX_VALUE,            'c', "dim. ao\u00fbt 17 15:18:47 HMG+08:00 292278994"}, //$NON-NLS-2$
-                {-1000L,                    'c', "jeu. janv. 01 07:59:59 HMG+08:00 1970"}, //$NON-NLS-2$
-                {new Date(1147327147578L),  'c', "jeu. mai 11 13:59:07 HMG+08:00 2006"}, //$NON-NLS-2$
+                {0L,                        'c', "jeu. janv. 01 08:00:00 UTC+08:00 1970"}, //$NON-NLS-2$
+                // {Long.MAX_VALUE,            'c', "dim. ao\u00fbt 17 15:12:55 UTC+08:00 292278994"}, //$NON-NLS-2$
+                {Long.MAX_VALUE,            'c', "dim. ao\u00fbt 17 15:18:47 UTC+08:00 292278994"}, //$NON-NLS-2$
+                {-1000L,                    'c', "jeu. janv. 01 07:59:59 UTC+08:00 1970"}, //$NON-NLS-2$
+                {new Date(1147327147578L),  'c', "jeu. mai 11 13:59:07 UTC+08:00 2006"}, //$NON-NLS-2$
                 {paris,                     'c', "lun. mai 08 12:00:00 HAEC 2006"}, //$NON-NLS-2$
-                {china,                     'c', "lun. mai 08 12:00:00 HMG-08:00 2006"}, //$NON-NLS-2$
+                {china,                     'c', "lun. mai 08 12:00:00 UTC-08:00 2006"}, //$NON-NLS-2$
                 {0L,                        'd', "01"}, //$NON-NLS-2$
                 {Long.MAX_VALUE,            'd', "17"}, //$NON-NLS-2$
                 {-1000L,                    'd', "01"}, //$NON-NLS-2$
@@ -2401,7 +2401,7 @@ public class FormatterTest extends TestCase {
             f = new Formatter(Locale.GERMAN);
             f.format(formatSpecifier, lowerCaseGermanTriple[i][input]);
             assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$
-                            + " Argument: " + lowerCaseGermanTriple[i][pattern], //$NON-NLS-2$
+                            + " Argument: " + lowerCaseGermanTriple[i][input], //$NON-NLS-2$
                             lowerCaseGermanTriple[i][output], f.toString());
 
             f = new Formatter(Locale.GERMAN);
@@ -2638,12 +2638,12 @@ public class FormatterTest extends TestCase {
                 {new Date(1147327147578L),  'Y', "2006"}, //$NON-NLS-2$
                 {paris,                     'Y', "2006"}, //$NON-NLS-2$
                 {china,                     'Y', "2006"}, //$NON-NLS-2$
-                {0L,                        'Z', "HMG+08:00"}, //$NON-NLS-2$
-                {Long.MAX_VALUE,            'Z', "HMG+08:00"}, //$NON-NLS-2$
-                {-1000L,                    'Z', "HMG+08:00"}, //$NON-NLS-2$
-                {new Date(1147327147578L),  'Z', "HMG+08:00"}, //$NON-NLS-2$
+                {0L,                        'Z', "UTC+08:00"}, //$NON-NLS-2$
+                {Long.MAX_VALUE,            'Z', "UTC+08:00"}, //$NON-NLS-2$
+                {-1000L,                    'Z', "UTC+08:00"}, //$NON-NLS-2$
+                {new Date(1147327147578L),  'Z', "UTC+08:00"}, //$NON-NLS-2$
                 {paris,                     'Z', "HAEC"}, //$NON-NLS-2$
-                {china,                     'Z', "HMG-08:00"}, //$NON-NLS-2$
+                {china,                     'Z', "UTC-08:00"}, //$NON-NLS-2$
                 
         };
 
index 9b1d395..d6c6900 100644 (file)
@@ -315,7 +315,8 @@ public class TimeZoneTest extends junit.framework.TestCase {
         }
         TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
         assertEquals("Pacific Standard Time", tz.getDisplayName(new Locale("US")));
-        assertEquals("Heure normale du Pacifique", tz.getDisplayName(Locale.FRANCE));
+        // BEGIN android-note: RI has "Heure", CLDR/ICU has "heure".
+        assertEquals("heure normale du Pacifique", tz.getDisplayName(Locale.FRANCE));
     }
     
     @TestTargetNew(
@@ -349,9 +350,10 @@ public class TimeZoneTest extends junit.framework.TestCase {
         assertEquals("Pacific Daylight Time", tz.getDisplayName(true,  1, Locale.US));
         assertEquals("Pacific Standard Time", tz.getDisplayName(false, 1, Locale.UK));
         //RI fails on following line. RI always returns short time zone name as "PST" 
-        assertEquals("HMG-08:00",             tz.getDisplayName(false, 0, Locale.FRANCE));
-        assertEquals("Heure avanc\u00e9e du Pacifique", tz.getDisplayName(true,  1, Locale.FRANCE));
-        assertEquals("Heure normale du Pacifique", tz.getDisplayName(false, 1, Locale.FRANCE));
+        assertEquals("UTC-08:00",             tz.getDisplayName(false, 0, Locale.FRANCE));
+        // BEGIN android-note: RI has "Heure", CLDR/ICU has "heure".
+        assertEquals("heure avanc\u00e9e du Pacifique", tz.getDisplayName(true,  1, Locale.FRANCE));
+        assertEquals("heure normale du Pacifique", tz.getDisplayName(false, 1, Locale.FRANCE));
     }
     
     @TestTargetNew(