OLD | NEW |
1 | 1 |
2 /******************************************************************** | 2 /******************************************************************** |
3 * COPYRIGHT: | 3 * COPYRIGHT: |
4 * Copyright (c) 1997-2012, International Business Machines Corporation and | 4 * Copyright (c) 1997-2014, International Business Machines Corporation and |
5 * others. All Rights Reserved. | 5 * others. All Rights Reserved. |
6 ********************************************************************/ | 6 ********************************************************************/ |
7 | 7 |
8 #include "unicode/utypes.h" | 8 #include "unicode/utypes.h" |
9 | 9 |
10 #if !UCONFIG_NO_FORMATTING | 10 #if !UCONFIG_NO_FORMATTING |
11 | 11 |
12 #include "sdtfmtts.h" | 12 #include "sdtfmtts.h" |
13 | 13 |
14 #include "unicode/smpdtfmt.h" | 14 #include "unicode/smpdtfmt.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 SimpleDateFormat object(UNICODE_STRING_SIMPLE("YYYY'W'wwe"), status); | 262 SimpleDateFormat object(UNICODE_STRING_SIMPLE("YYYY'W'wwe"), status); |
263 if(U_FAILURE(status)) { | 263 if(U_FAILURE(status)) { |
264 errln("ERROR: Couldn't create a SimpleDateFormat"); | 264 errln("ERROR: Couldn't create a SimpleDateFormat"); |
265 } | 265 } |
266 object.setLenient(false); | 266 object.setLenient(false); |
267 ParsePosition pp(0); | 267 ParsePosition pp(0); |
268 UDate udDate = object.parse("2007W014", pp); | 268 UDate udDate = object.parse("2007W014", pp); |
269 if ((double)udDate == 0.0) { | 269 if ((double)udDate == 0.0) { |
270 errln("ERROR: Parsing failed using 'Y' and 'e'"); | 270 errln("ERROR: Parsing failed using 'Y' and 'e'"); |
271 } | 271 } |
| 272 |
| 273 // ====== Test ticket 11295 getNumberFormatForField returns wild pointer |
| 274 if (object.getNumberFormatForField('B') != NULL) { |
| 275 errln("B is not a valid field, " |
| 276 "getNumberFormatForField should return NULL"); |
| 277 } |
272 } | 278 } |
273 | 279 |
274 #endif /* #if !UCONFIG_NO_FORMATTING */ | 280 #endif /* #if !UCONFIG_NO_FORMATTING */ |
OLD | NEW |