void CalendarRegressionTest::TestT8057(void) {
    // Set the calendar to the last day in a leap year
    UErrorCode status = U_ZERO_ERROR;
    GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status);
    if(U_FAILURE(status)) {
        errln("Error creating Calendar: %s", u_errorName(status));
        delete cal;
        return;
    }
    cal->setLenient(FALSE);
    cal->clear();
    cal->set(2008, UCAL_DECEMBER, 31);

    // Force calculating then fields once.
    UDate t = cal->getTime(status);
    if(U_FAILURE(status)) {
        errln("Error while calculating the date");
        delete cal;
        return;
    }

    UDate expected = 1262246400000.0; // 2009-12-31 00:00 PST

    cal->add(UCAL_YEAR, 1, status);
    t = cal->getTime(status);
    if (U_SUCCESS(status)) {
        if (t != expected) {
            dataerrln((UnicodeString)"FAIL: wrong date after add: expected=" + expected + " returned=" + t);
        }
    } else {
        errln("FAIL: error while adding one year");
    }

    delete cal;
}
void CalendarRegressionTest::TestT8057(void) {
     
    UErrorCode status = U_ZERO_ERROR;
    GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status);
    if(U_FAILURE(status)) {
        errln("Error creating Calendar: %s", u_errorName(status));
        delete cal;
        return;
    }
    cal->setLenient(FALSE);
    cal->clear();
    cal->set(2008, UCAL_DECEMBER, 31);

     
    UDate t = cal->getTime(status);
    if(U_FAILURE(status)) {
        errln("Error while calculating the date");
        delete cal;
        return;
    }

    UDate expected = 1262246400000.0;  

    cal->add(UCAL_YEAR, 1, status);
    t = cal->getTime(status);
    if (U_SUCCESS(status)) {
        if (t != expected) {
            dataerrln((UnicodeString)"FAIL: wrong date after add: expected=" + expected + " returned=" + t);
        }
    } else {
        errln("FAIL: error while adding one year");
    }

    delete cal;
}