+// © 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;
{
delete theFormat;
theFormat = 0;
- errln("FAIL: Could not create SimpleDateFormat");
+ dataerrln("FAIL: Could not create SimpleDateFormat - %s", u_errorName(status));
}
}
{
delete theCalendar;
theCalendar = 0;
- errln("FAIL: Calendar::createInstance failed");
+ dataerrln("FAIL: Calendar::createInstance failed: %s", u_errorName(status));
}
}
return theCalendar;
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;