void CalendarRegressionTest::test4147269()
{
    UErrorCode status = U_ZERO_ERROR;
    GregorianCalendar *calendar = new GregorianCalendar(status);
    if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) {
      dataerrln("Error creating calendar %s", u_errorName(status));
      delete calendar;
      return;
    }
    calendar->setLenient(FALSE);
    UDate date = makeDate(1996, UCAL_JANUARY, 3); // Arbitrary date
    for (int32_t field = 0; field < UCAL_FIELD_COUNT; field++) {
        calendar->setTime(date,status);
        // Note: In the bug report, getActualMaximum() was called instead
        // of getMaximum() -- this was an error.  The validation code doesn't
        // use getActualMaximum(), since that's too costly.
        int32_t max = calendar->getMaximum((UCalendarDateFields)field);
        int32_t value = max+1;
        calendar->set((UCalendarDateFields)field, value);
        //try {
            calendar->getTime(status); // Force time computation
            // We expect an exception to be thrown. If we fall through
            // to the next line, then we have a bug.
            if(U_SUCCESS(status))
            errln(UnicodeString("Test failed with field ") + FIELD_NAME[field] +
                  ", date before: " + date +
                  ", date after: " + calendar->getTime(status) +
                  ", value: " + value + " (max = " + max +")");
        //} catch (IllegalArgumentException e) {}
    }

    delete calendar;
}
void CalendarRegressionTest::test4147269()
{
    UErrorCode status = U_ZERO_ERROR;
    GregorianCalendar *calendar = new GregorianCalendar(status);
    if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) {
      dataerrln("Error creating calendar %s", u_errorName(status));
      delete calendar;
      return;
    }
    calendar->setLenient(FALSE);
    UDate date = makeDate(1996, UCAL_JANUARY, 3);  
    for (int32_t field = 0; field < UCAL_FIELD_COUNT; field++) {
        calendar->setTime(date,status);
         
         
         
        int32_t max = calendar->getMaximum((UCalendarDateFields)field);
        int32_t value = max+1;
        calendar->set((UCalendarDateFields)field, value);
         
            calendar->getTime(status);  
             
             
            if(U_SUCCESS(status))
            errln(UnicodeString("Test failed with field ") + FIELD_NAME[field] +
                  ", date before: " + date +
                  ", date after: " + calendar->getTime(status) +
                  ", value: " + value + " (max = " + max +")");
         
    }

    delete calendar;
}