| OLD | NEW |
| 1 /*********************************************************************** | 1 /*********************************************************************** |
| 2 * COPYRIGHT: | 2 * COPYRIGHT: |
| 3 * Copyright (c) 1997-2010, International Business Machines Corporation | 3 * Copyright (c) 1997-2010, International Business Machines Corporation |
| 4 * and others. All Rights Reserved. | 4 * and others. All Rights Reserved. |
| 5 ***********************************************************************/ | 5 ***********************************************************************/ |
| 6 | 6 |
| 7 #include "unicode/utypes.h" | 7 #include "unicode/utypes.h" |
| 8 | 8 |
| 9 #if !UCONFIG_NO_FORMATTING | 9 #if !UCONFIG_NO_FORMATTING |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (a == NULL || b == NULL){ | 101 if (a == NULL || b == NULL){ |
| 102 dataerrln("Error calling DateFormat::createInstance()"); | 102 dataerrln("Error calling DateFormat::createInstance()"); |
| 103 delete a; | 103 delete a; |
| 104 delete b; | 104 delete b; |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 | 107 |
| 108 if (!(*a == *b)) | 108 if (!(*a == *b)) |
| 109 errln("FAIL: DateFormat objects created at different times are unequal."
); | 109 errln("FAIL: DateFormat objects created at different times are unequal."
); |
| 110 | 110 |
| 111 SimpleDateFormat *sdtfmt = dynamic_cast<SimpleDateFormat *>(b); | 111 SimpleDateFormat *sdtfmt = CR_DYNAMIC_CAST<SimpleDateFormat *>(b); |
| 112 if (sdtfmt != NULL) | 112 if (sdtfmt != NULL) |
| 113 { | 113 { |
| 114 double ONE_YEAR = 365*24*60*60*1000.0; | 114 double ONE_YEAR = 365*24*60*60*1000.0; |
| 115 sdtfmt->set2DigitYearStart(start + 50*ONE_YEAR, status); | 115 sdtfmt->set2DigitYearStart(start + 50*ONE_YEAR, status); |
| 116 if (U_FAILURE(status)) | 116 if (U_FAILURE(status)) |
| 117 errln("FAIL: setTwoDigitStartDate failed."); | 117 errln("FAIL: setTwoDigitStartDate failed."); |
| 118 else if (*a == *b) | 118 else if (*a == *b) |
| 119 errln("FAIL: DateFormat objects with different two digit start dates
are equal."); | 119 errln("FAIL: DateFormat objects with different two digit start dates
are equal."); |
| 120 } | 120 } |
| 121 delete a; | 121 delete a; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 MessageFormat fmt("", status); | 376 MessageFormat fmt("", status); |
| 377 // Format API | 377 // Format API |
| 378 // We use dateObj, which MessageFormat should reject. | 378 // We use dateObj, which MessageFormat should reject. |
| 379 // We're testing name hiding, not the format method. | 379 // We're testing name hiding, not the format method. |
| 380 fmt.format(dateObj, str, status); | 380 fmt.format(dateObj, str, status); |
| 381 fmt.format(dateObj, str, fpos, status); | 381 fmt.format(dateObj, str, fpos, status); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 | 384 |
| 385 #endif /* #if !UCONFIG_NO_FORMATTING */ | 385 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| OLD | NEW |