]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/caltztst.cpp
ICU-64260.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / caltztst.cpp
index 3d50ce954c21fb968691cd0885489c2f18152564..2c952bce674bbbe79596d089afb4c991b4029f6e 100644 (file)
@@ -1,6 +1,8 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2003, International Business Machines Corporation and
+ * Copyright (c) 1997-2010, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /*
 DateFormat*         CalendarTimeZoneTest::fgDateFormat = 0;
 Calendar*           CalendarTimeZoneTest::fgCalendar   = 0;
 
-UBool CalendarTimeZoneTest::failure(UErrorCode status, const char* msg)
+UBool CalendarTimeZoneTest::failure(UErrorCode status, const char* msg, UBool possibleDataError)
 {
     if (U_FAILURE(status))
     {
-        errln(UnicodeString("FAIL: ") + msg + " failed, error " + u_errorName(status));
+        if (possibleDataError) {
+            dataerrln(UnicodeString("FAIL: ") + msg + " failed, error " + u_errorName(status));
+        } else {
+            errcheckln(status, UnicodeString("FAIL: ") + msg + " failed, error " + u_errorName(status));
+        }
         return TRUE;
     }
     return FALSE;
@@ -57,7 +63,7 @@ DateFormat*   CalendarTimeZoneTest::getDateFormat()
         {
             delete theFormat;
             theFormat = 0;
-            errln("FAIL: Could not create SimpleDateFormat");
+            dataerrln("FAIL: Could not create SimpleDateFormat - %s", u_errorName(status));
         }
     }
 
@@ -104,7 +110,7 @@ Calendar*  CalendarTimeZoneTest::getCalendar()
         {
             delete theCalendar;
             theCalendar = 0;
-            errln("FAIL: Calendar::createInstance failed");
+            dataerrln("FAIL: Calendar::createInstance failed: %s", u_errorName(status));
         }
     }
     return theCalendar;
@@ -185,7 +191,7 @@ CalendarTimeZoneTest::date(int32_t y, int32_t m, int32_t d, int32_t hr, int32_t
     releaseCalendar(cal);
     if (U_FAILURE(status))
     {
-        errln("FAIL: Calendar::getTime failed");
+        errln("FAIL: Calendar::getTime failed: %s", u_errorName(status));
         return 0.0;
     }
     return dt;