]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/tsdate.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / intltest / tsdate.cpp
index 596ce97024bfbaf533da05d961c1f6e9914d8765..79e61e8205438cbec9b69a4e7c2348f78bce11f4 100644 (file)
@@ -164,14 +164,22 @@ void IntlTestDateFormat::tryDate(UDate theDate)
     date[0] = theDate;
     fFormat->format(theDate, string[0]);
 
+    UErrorCode status = U_ZERO_ERROR;
+    const char* locID = "??";
+    Locale loc = fFormat->getCalendar()->getLocale(ULOC_VALID_LOCALE, status);
+    if (U_SUCCESS(status)) {
+        locID = loc.getName();
+    }
+
     for (i=1; i<DEPTH; ++i)
     {
-        UErrorCode status = U_ZERO_ERROR;
+        status = U_ZERO_ERROR;
         date[i] = fFormat->parse(string[i-1], status);
         if (U_FAILURE(status))
         {
             describeTest();
-            errln("**** FAIL: Parse of " + prettify(string[i-1], FALSE) + " failed.");
+            errln("**** FAIL, locale " + UnicodeString(locID,-1,US_INV) +
+                    ": Parse of " + prettify(string[i-1], FALSE) + " failed.");
             dump = TRUE;
             break;
         }
@@ -181,7 +189,8 @@ void IntlTestDateFormat::tryDate(UDate theDate)
         else if (dateMatch > 0 && date[i] != date[i-1])
         {
             describeTest();
-            errln("**** FAIL: Date mismatch after match for " + string[i]);
+            errln("**** FAIL, locale " + UnicodeString(locID,-1,US_INV) +
+                    ": Date mismatch after match for " + string[i]);
             dump = TRUE;
             break;
         }
@@ -190,7 +199,8 @@ void IntlTestDateFormat::tryDate(UDate theDate)
         else if (stringMatch > 0 && string[i] != string[i-1])
         {
             describeTest();
-            errln("**** FAIL: String mismatch after match for " + string[i]);
+            errln("**** FAIL, locale " + UnicodeString(locID,-1,US_INV) +
+                    ": String mismatch after match for " + string[i]);
             dump = TRUE;
             break;
         }