]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/intltest/dtifmtts.cpp
ICU-59152.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / dtifmtts.cpp
CommitLineData
f3c0d7a5
A
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
46f4442e 3/********************************************************************
f3c0d7a5 4 * COPYRIGHT:
2ca993e8 5 * Copyright (c) 1997-2016, International Business Machines Corporation and
46f4442e
A
6 * others. All Rights Reserved.
7 ********************************************************************/
8
9#include "unicode/utypes.h"
10
11#if !UCONFIG_NO_FORMATTING
12
13
14//TODO: define it in compiler flag
15//#define DTIFMTTS_DEBUG 1
16
17
f3c0d7a5 18#ifdef DTIFMTTS_DEBUG
729e4ab9 19#include <iostream>
46f4442e
A
20#endif
21
2ca993e8 22#include "dtifmtts.h"
46f4442e 23
2ca993e8
A
24#include "cmemory.h"
25#include "cstr.h"
46f4442e 26#include "cstring.h"
2ca993e8 27#include "simplethread.h"
46f4442e
A
28#include "unicode/gregocal.h"
29#include "unicode/dtintrv.h"
30#include "unicode/dtitvinf.h"
31#include "unicode/dtitvfmt.h"
51004dcb 32#include "unicode/localpointer.h"
4388f060 33#include "unicode/timezone.h"
46f4442e
A
34
35
36
f3c0d7a5 37#ifdef DTIFMTTS_DEBUG
46f4442e
A
38//#define PRINTMESG(msg) { std::cout << "(" << __FILE__ << ":" << __LINE__ << ") " << msg << "\n"; }
39#define PRINTMESG(msg) { std::cout << msg; }
40#endif
41
46f4442e
A
42#include <stdio.h>
43
44
45void DateIntervalFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ ) {
46 if (exec) logln("TestSuite DateIntervalFormat");
47 switch (index) {
48 TESTCASE(0, testAPI);
49 TESTCASE(1, testFormat);
50 TESTCASE(2, testFormatUserDII);
51004dcb 51 TESTCASE(3, testSetIntervalPatternNoSideEffect);
57a6839d
A
52 TESTCASE(4, testYearFormats);
53 TESTCASE(5, testStress);
b331163b 54 TESTCASE(6, testTicket11583_2);
2ca993e8
A
55 TESTCASE(7, testTicket11985);
56 TESTCASE(8, testTicket11669);
f3c0d7a5 57 TESTCASE(9, testTicket12065);
46f4442e
A
58 default: name = ""; break;
59 }
60}
61
62/**
63 * Test various generic API methods of DateIntervalFormat for API coverage.
64 */
65void DateIntervalFormatTest::testAPI() {
66
67 /* ====== Test create interval instance with default locale and skeleton
68 */
69 UErrorCode status = U_ZERO_ERROR;
70 logln("Testing DateIntervalFormat create instance with default locale and skeleton");
f3c0d7a5 71
46f4442e
A
72 DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, status);
73 if(U_FAILURE(status)) {
74 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + default locale) - exitting");
75 return;
76 } else {
77 delete dtitvfmt;
78 }
79
80
81 /* ====== Test create interval instance with given locale and skeleton
82 */
83 status = U_ZERO_ERROR;
84 logln("Testing DateIntervalFormat create instance with given locale and skeleton");
f3c0d7a5 85
46f4442e
A
86 dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, Locale::getJapanese(), status);
87 if(U_FAILURE(status)) {
88 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + locale) - exitting");
89 return;
90 } else {
91 delete dtitvfmt;
92 }
93
94
95 /* ====== Test create interval instance with dateIntervalInfo and skeleton
96 */
97 status = U_ZERO_ERROR;
98 logln("Testing DateIntervalFormat create instance with dateIntervalInfo and skeleton");
f3c0d7a5 99
46f4442e
A
100 DateIntervalInfo* dtitvinf = new DateIntervalInfo(Locale::getSimplifiedChinese(), status);
101
102 dtitvfmt = DateIntervalFormat::createInstance("EEEdMMMyhms", *dtitvinf, status);
103 delete dtitvinf;
104
105 if(U_FAILURE(status)) {
106 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + DateIntervalInfo + default locale) - exitting");
107 return;
108 } else {
109 delete dtitvfmt;
f3c0d7a5 110 }
46f4442e
A
111
112
113 /* ====== Test create interval instance with dateIntervalInfo and skeleton
114 */
115 status = U_ZERO_ERROR;
116 logln("Testing DateIntervalFormat create instance with dateIntervalInfo and skeleton");
f3c0d7a5 117
46f4442e
A
118 dtitvinf = new DateIntervalInfo(Locale::getSimplifiedChinese(), status);
119
120 dtitvfmt = DateIntervalFormat::createInstance("EEEdMMMyhms", Locale::getSimplifiedChinese(), *dtitvinf, status);
121 delete dtitvinf;
122 if(U_FAILURE(status)) {
123 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + DateIntervalInfo + locale) - exitting");
124 return;
f3c0d7a5
A
125 }
126 // not deleted, test clone
46f4442e
A
127
128
129 // ====== Test clone()
130 status = U_ZERO_ERROR;
131 logln("Testing DateIntervalFormat clone");
132
133 DateIntervalFormat* another = (DateIntervalFormat*)dtitvfmt->clone();
134 if ( (*another) != (*dtitvfmt) ) {
2ca993e8 135 dataerrln("%s:%d ERROR: clone failed", __FILE__, __LINE__);
46f4442e
A
136 }
137
729e4ab9 138
46f4442e
A
139 // ====== Test getDateIntervalInfo, setDateIntervalInfo, adoptDateIntervalInfo
140 status = U_ZERO_ERROR;
141 logln("Testing DateIntervalFormat getDateIntervalInfo");
142 const DateIntervalInfo* inf = another->getDateIntervalInfo();
143 dtitvfmt->setDateIntervalInfo(*inf, status);
144 const DateIntervalInfo* anotherInf = dtitvfmt->getDateIntervalInfo();
145 if ( (*inf) != (*anotherInf) || U_FAILURE(status) ) {
146 dataerrln("ERROR: getDateIntervalInfo/setDateIntervalInfo failed");
147 }
148
51004dcb
A
149 {
150 // We make sure that setDateIntervalInfo does not corrupt the cache. See ticket 9919.
151 status = U_ZERO_ERROR;
152 logln("Testing DateIntervalFormat setDateIntervalInfo");
153 const Locale &enLocale = Locale::getEnglish();
154 LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yMd", enLocale, status));
155 if (U_FAILURE(status)) {
156 errln("Failure encountered: %s", u_errorName(status));
157 return;
158 }
159 UnicodeString expected;
160 LocalPointer<Calendar> fromTime(Calendar::createInstance(enLocale, status));
161 LocalPointer<Calendar> toTime(Calendar::createInstance(enLocale, status));
162 if (U_FAILURE(status)) {
163 errln("Failure encountered: %s", u_errorName(status));
164 return;
165 }
f3c0d7a5 166 FieldPosition pos(FieldPosition::DONT_CARE);
51004dcb
A
167 fromTime->set(2013, 3, 26);
168 toTime->set(2013, 3, 28);
169 dif->format(*fromTime, *toTime, expected, pos, status);
170 if (U_FAILURE(status)) {
171 errln("Failure encountered: %s", u_errorName(status));
172 return;
173 }
b331163b 174 LocalPointer<DateIntervalInfo> dii(new DateIntervalInfo(Locale::getEnglish(), status), status);
51004dcb
A
175 if (U_FAILURE(status)) {
176 errln("Failure encountered: %s", u_errorName(status));
177 return;
178 }
179 dii->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d"), status);
180 dif->setDateIntervalInfo(*dii, status);
181 if (U_FAILURE(status)) {
182 errln("Failure encountered: %s", u_errorName(status));
183 return;
184 }
185 dif.adoptInstead(DateIntervalFormat::createInstance("yMd", enLocale, status));
186 if (U_FAILURE(status)) {
187 errln("Failure encountered: %s", u_errorName(status));
188 return;
189 }
190 UnicodeString actual;
191 pos = 0;
192 dif->format(*fromTime, *toTime, actual, pos, status);
193 if (U_FAILURE(status)) {
194 errln("Failure encountered: %s", u_errorName(status));
195 return;
196 }
197 if (expected != actual) {
198 errln("DateIntervalFormat.setIntervalInfo should have no side effects.");
199 }
200 }
f3c0d7a5 201
46f4442e
A
202 /*
203 status = U_ZERO_ERROR;
204 DateIntervalInfo* nonConstInf = inf->clone();
205 dtitvfmt->adoptDateIntervalInfo(nonConstInf, status);
206 anotherInf = dtitvfmt->getDateIntervalInfo();
207 if ( (*inf) != (*anotherInf) || U_FAILURE(status) ) {
208 dataerrln("ERROR: adoptDateIntervalInfo failed");
209 }
210 */
211
212 // ====== Test getDateFormat, setDateFormat, adoptDateFormat
f3c0d7a5 213
46f4442e
A
214 status = U_ZERO_ERROR;
215 logln("Testing DateIntervalFormat getDateFormat");
46f4442e 216 /*
729e4ab9 217 const DateFormat* fmt = another->getDateFormat();
46f4442e
A
218 dtitvfmt->setDateFormat(*fmt, status);
219 const DateFormat* anotherFmt = dtitvfmt->getDateFormat();
220 if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) {
221 dataerrln("ERROR: getDateFormat/setDateFormat failed");
222 }
223
224 status = U_ZERO_ERROR;
225 DateFormat* nonConstFmt = (DateFormat*)fmt->clone();
226 dtitvfmt->adoptDateFormat(nonConstFmt, status);
227 anotherFmt = dtitvfmt->getDateFormat();
228 if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) {
229 dataerrln("ERROR: adoptDateFormat failed");
230 }
729e4ab9 231 delete fmt;
46f4442e
A
232 */
233
234
235 // ======= Test getStaticClassID()
236
237 logln("Testing getStaticClassID()");
238
239
240 if(dtitvfmt->getDynamicClassID() != DateIntervalFormat::getStaticClassID()) {
241 errln("ERROR: getDynamicClassID() didn't return the expected value");
242 }
f3c0d7a5 243
46f4442e
A
244 delete another;
245
246 // ====== test constructor/copy constructor and assignment
247 /* they are protected, no test
248 logln("Testing DateIntervalFormat constructor and assigment operator");
249 status = U_ZERO_ERROR;
250
251 DateFormat* constFmt = (constFmt*)dtitvfmt->getDateFormat()->clone();
252 inf = dtitvfmt->getDateIntervalInfo()->clone();
253
254
255 DateIntervalFormat* dtifmt = new DateIntervalFormat(fmt, inf, status);
256 if(U_FAILURE(status)) {
257 dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting");
258 return;
f3c0d7a5 259 }
46f4442e
A
260
261 DateIntervalFormat* dtifmt2 = new(dtifmt);
262 if ( (*dtifmt) != (*dtifmt2) ) {
263 dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting");
264 return;
265 }
266
267 DateIntervalFormat dtifmt3 = (*dtifmt);
268 if ( (*dtifmt) != dtifmt3 ) {
269 dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting");
270 return;
271 }
272
273 delete dtifmt2;
274 delete dtifmt3;
275 delete dtifmt;
276 */
277
278
279 //===== test format and parse ==================
280 Formattable formattable;
281 formattable.setInt64(10);
282 UnicodeString res;
f3c0d7a5 283 FieldPosition pos(FieldPosition::DONT_CARE);
46f4442e
A
284 status = U_ZERO_ERROR;
285 dtitvfmt->format(formattable, res, pos, status);
286 if ( status != U_ILLEGAL_ARGUMENT_ERROR ) {
287 dataerrln("ERROR: format non-date-interval object should set U_ILLEGAL_ARGUMENT_ERROR - exitting");
288 return;
289 }
290
291 DateInterval* dtitv = new DateInterval(3600*24*365, 3600*24*366);
292 formattable.adoptObject(dtitv);
293 res.remove();
294 pos = 0;
295 status = U_ZERO_ERROR;
296 dtitvfmt->format(formattable, res, pos, status);
297 if ( U_FAILURE(status) ) {
298 dataerrln("ERROR: format date interval failed - exitting");
299 return;
300 }
301
302 const DateFormat* dfmt = dtitvfmt->getDateFormat();
303 Calendar* fromCal = dfmt->getCalendar()->clone();
304 Calendar* toCal = dfmt->getCalendar()->clone();
305 res.remove();
306 pos = 0;
307 status = U_ZERO_ERROR;
308 dtitvfmt->format(*fromCal, *toCal, res, pos, status);
309 if ( U_FAILURE(status) ) {
310 dataerrln("ERROR: format date interval failed - exitting");
311 return;
312 }
313 delete fromCal;
314 delete toCal;
315
316
317 Formattable fmttable;
318 status = U_ZERO_ERROR;
319 // TODO: why do I need cast?
320 ((Format*)dtitvfmt)->parseObject(res, fmttable, status);
321 if ( status != U_INVALID_FORMAT_ERROR ) {
322 dataerrln("ERROR: parse should set U_INVALID_FORMAT_ERROR - exitting");
323 return;
324 }
325
326 delete dtitvfmt;
327
4388f060
A
328 //====== test setting time zone
329 logln("Testing DateIntervalFormat set & format with different time zones, get time zone");
330 status = U_ZERO_ERROR;
331 dtitvfmt = DateIntervalFormat::createInstance("MMMdHHmm", Locale::getEnglish(), status);
332 if ( U_SUCCESS(status) ) {
333 UDate date1 = 1299090600000.0; // 2011-Mar-02 1030 in US/Pacific, 2011-Mar-03 0330 in Asia/Tokyo
334 UDate date2 = 1299115800000.0; // 2011-Mar-02 1730 in US/Pacific, 2011-Mar-03 1030 in Asia/Tokyo
f3c0d7a5 335
4388f060
A
336 DateInterval * dtitv12 = new DateInterval(date1, date2);
337 TimeZone * tzCalif = TimeZone::createTimeZone("US/Pacific");
338 TimeZone * tzTokyo = TimeZone::createTimeZone("Asia/Tokyo");
f3c0d7a5
A
339 UnicodeString fmtCalif = UnicodeString(ctou("Mar 2, 10:30\\u2009\\u2013\\u200917:30"));
340 UnicodeString fmtTokyo = UnicodeString(ctou("Mar 3, 03:30\\u2009\\u2013\\u200910:30"));
4388f060
A
341
342 dtitvfmt->adoptTimeZone(tzCalif);
343 res.remove();
344 pos = 0;
345 status = U_ZERO_ERROR;
346 dtitvfmt->format(dtitv12, res, pos, status);
347 if ( U_SUCCESS(status) ) {
348 if ( res.compare(fmtCalif) != 0 ) {
349 errln("ERROR: DateIntervalFormat::format for tzCalif, expect " + fmtCalif + ", get " + res);
350 }
351 } else {
352 errln("ERROR: DateIntervalFormat::format for tzCalif, status %s", u_errorName(status));
353 }
354
355 dtitvfmt->setTimeZone(*tzTokyo);
356 res.remove();
357 pos = 0;
358 status = U_ZERO_ERROR;
359 dtitvfmt->format(dtitv12, res, pos, status);
360 if ( U_SUCCESS(status) ) {
361 if ( res.compare(fmtTokyo) != 0 ) {
f3c0d7a5 362 errln("ERROR: DateIntervalFormat::format for tzTokyo, expect " + fmtTokyo + ", get " + res);
4388f060
A
363 }
364 } else {
365 errln("ERROR: DateIntervalFormat::format for tzTokyo, status %s", u_errorName(status));
366 }
f3c0d7a5 367
4388f060
A
368 if ( dtitvfmt->getTimeZone() != *tzTokyo ) {
369 errln("ERROR: DateIntervalFormat::getTimeZone returns mismatch.");
370 }
371
372 delete tzTokyo; // tzCalif was owned by dtitvfmt which should have deleted it
373 delete dtitv12;
374 delete dtitvfmt;
375 } else {
376 errln("ERROR: DateIntervalFormat::createInstance(\"MdHH\", Locale::getEnglish(), ...), status %s", u_errorName(status));
377 }
46f4442e 378 //====== test format in testFormat()
f3c0d7a5 379
729e4ab9
A
380 //====== test DateInterval class (better coverage)
381 DateInterval dtitv1(3600*24*365, 3600*24*366);
382 DateInterval dtitv2(dtitv1);
383
384 if (!(dtitv1 == dtitv2)) {
385 errln("ERROR: Copy constructor failed for DateInterval.");
386 }
387
388 DateInterval dtitv3(3600*365, 3600*366);
389 dtitv3 = dtitv1;
390 if (!(dtitv3 == dtitv1)) {
391 errln("ERROR: Equal operator failed for DateInterval.");
392 }
393
394 DateInterval *dtitv4 = dtitv1.clone();
395 if (*dtitv4 != dtitv1) {
396 errln("ERROR: Equal operator failed for DateInterval.");
397 }
398 delete dtitv4;
46f4442e
A
399}
400
401
402/**
403 * Test format
404 */
405void DateIntervalFormatTest::testFormat() {
406 // first item is date pattern
407 // followed by a group of locale/from_data/to_data/skeleton/interval_data
408 const char* DATA[] = {
f3c0d7a5 409 "yyyy MM dd HH:mm:ss",
729e4ab9 410 // test root
51004dcb 411 "root", "2007 11 10 10:10:10", "2007 12 10 10:10:10", "yM", "2007-11 \\u2013 2007-12",
f3c0d7a5 412
729e4ab9 413 // test 'H' and 'h', using availableFormat in fallback
f3c0d7a5
A
414 "en", "2007 11 10 10:10:10", "2007 11 10 15:10:10", "Hms", "10:10:10\\u2009\\u2013\\u200915:10:10",
415 "en", "2007 11 10 10:10:10", "2007 11 10 15:10:10", "hms", "10:10:10 AM\\u2009\\u2013\\u20093:10:10 PM",
729e4ab9 416
f3c0d7a5
A
417 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMM", "October 2007\\u2009\\u2013\\u2009October 2008",
418 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMM", "Oct 2007\\u2009\\u2013\\u2009Oct 2008",
46f4442e 419 // test skeleton with both date and time
f3c0d7a5 420 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMyhm", "Nov 10, 2007, 10:10 AM\\u2009\\u2013\\u2009Nov 20, 2007, 10:10 AM",
46f4442e 421
f3c0d7a5 422 "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "dMMMyhm", "Nov 10, 2007, 10:10\\u2009\\u2013\\u200911:10 AM",
46f4442e 423
f3c0d7a5
A
424 "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "hms", "10:10:10 AM\\u2009\\u2013\\u200911:10:10 AM",
425 "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "Hms", "10:10:10\\u2009\\u2013\\u200911:10:10",
426 "en", "2007 11 10 20:10:10", "2007 11 10 21:10:10", "Hms", "20:10:10\\u2009\\u2013\\u200921:10:10",
46f4442e 427
f3c0d7a5 428 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10, 2007\\u2009\\u2013\\u2009Friday, October 10, 2008",
46f4442e 429
f3c0d7a5 430 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMy", "October 10, 2007\\u2009\\u2013\\u2009October 10, 2008",
46f4442e 431
f3c0d7a5 432 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMM", "October 10, 2007\\u2009\\u2013\\u2009October 10, 2008",
46f4442e 433
f3c0d7a5 434 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMMy", "October 2007\\u2009\\u2013\\u2009October 2008",
46f4442e 435
f3c0d7a5 436 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10, 2007\\u2009\\u2013\\u2009Friday, October 10, 2008",
46f4442e 437
f3c0d7a5 438 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMMy", "Wed, Oct 10, 2007\\u2009\\u2013\\u2009Fri, Oct 10, 2008",
46f4442e 439
f3c0d7a5 440 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMy", "Oct 10, 2007\\u2009\\u2013\\u2009Oct 10, 2008",
46f4442e 441
f3c0d7a5 442 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "Oct 10, 2007\\u2009\\u2013\\u2009Oct 10, 2008",
46f4442e 443
f3c0d7a5 444 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Oct 2007\\u2009\\u2013\\u2009Oct 2008",
46f4442e 445
f3c0d7a5 446 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMM", "Wed, Oct 10, 2007\\u2009\\u2013\\u2009Fri, Oct 10, 2008",
46f4442e 447
f3c0d7a5 448 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Wed, 10/10/2007\\u2009\\u2013\\u2009Fri, 10/10/2008",
46f4442e 449
f3c0d7a5 450 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10/10/2007\\u2009\\u2013\\u200910/10/2008",
46f4442e 451
f3c0d7a5 452 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dM", "10/10/2007\\u2009\\u2013\\u200910/10/2008",
46f4442e 453
f3c0d7a5 454 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10/2007\\u2009\\u2013\\u200910/2008",
46f4442e 455
f3c0d7a5 456 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Wed, 10/10/2007\\u2009\\u2013\\u2009Fri, 10/10/2008",
46f4442e 457
f3c0d7a5 458 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "d", "10/10/2007\\u2009\\u2013\\u200910/10/2008",
46f4442e 459
f3c0d7a5 460 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Ed", "10 Wed\\u2009\\u2013\\u200910 Fri",
46f4442e 461
f3c0d7a5 462 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007\\u2009\\u2013\\u20092008",
46f4442e 463
f3c0d7a5 464 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10/2007\\u2009\\u2013\\u200910/2008",
46f4442e
A
465
466
467
f3c0d7a5
A
468 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10/10/2007, 10:10 AM\\u2009\\u2013\\u200910/10/2008, 10:10 AM",
469 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Hm", "10/10/2007, 10:10\\u2009\\u2013\\u200910/10/2008, 10:10",
470 "en", "2007 10 10 20:10:10", "2008 10 10 20:10:10", "Hm", "10/10/2007, 20:10\\u2009\\u2013\\u200910/10/2008, 20:10",
46f4442e 471
f3c0d7a5 472 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT\\u2009\\u2013\\u200910/10/2008, 10:10 AM PT",
46f4442e 473
f3c0d7a5 474 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT\\u2009\\u2013\\u200910/10/2008, 10:10 AM PDT",
46f4442e 475
f3c0d7a5 476 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "h", "10/10/2007, 10 AM\\u2009\\u2013\\u200910/10/2008, 10 AM",
46f4442e 477
f3c0d7a5 478 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hv", "10/10/2007, 10 AM PT\\u2009\\u2013\\u200910/10/2008, 10 AM PT",
46f4442e 479
f3c0d7a5 480 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hz", "10/10/2007, 10 AM PDT\\u2009\\u2013\\u200910/10/2008, 10 AM PDT",
46f4442e 481
f3c0d7a5 482 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007\\u2009\\u2013\\u2009Fri, 10/10/2008",
46f4442e 483
f3c0d7a5 484 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EddMMy", "Wed, 10/10/2007\\u2009\\u2013\\u2009Fri, 10/10/2008",
46f4442e 485
f3c0d7a5 486 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmm", "10/10/2007, 10:10 AM\\u2009\\u2013\\u200910/10/2008, 10:10 AM",
46f4442e 487
f3c0d7a5 488 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT\\u2009\\u2013\\u200910/10/2008, 10:10 AM PDT",
46f4442e 489
f3c0d7a5 490 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM\\u2009\\u2013\\u200910/10/2008, 10:10:10 AM",
46f4442e 491
f3c0d7a5 492 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMMy", "O 10, 2007\\u2009\\u2013\\u2009O 10, 2008",
46f4442e 493
f3c0d7a5 494 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEEdM", "W, 10/10/2007\\u2009\\u2013\\u2009F, 10/10/2008",
46f4442e 495
f3c0d7a5 496 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10\\u2009\\u2013\\u2009Saturday, November 10, 2007",
46f4442e 497
f3c0d7a5 498 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "October 10\\u2009\\u2013\\u2009November 10, 2007",
46f4442e 499
f3c0d7a5 500 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMM", "October 10\\u2009\\u2013\\u2009November 10",
46f4442e 501
f3c0d7a5 502 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "October\\u2009\\u2013\\u2009November 2007",
46f4442e 503
f3c0d7a5 504 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10\\u2009\\u2013\\u2009Saturday, November 10",
46f4442e 505
f3c0d7a5 506 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMMy", "Wed, Oct 10\\u2009\\u2013\\u2009Sat, Nov 10, 2007",
46f4442e 507
f3c0d7a5 508 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMy", "Oct 10\\u2009\\u2013\\u2009Nov 10, 2007",
46f4442e 509
f3c0d7a5 510 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "Oct 10\\u2009\\u2013\\u2009Nov 10",
46f4442e 511
f3c0d7a5 512 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Oct\\u2009\\u2013\\u2009Nov 2007",
46f4442e 513
f3c0d7a5 514 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMM", "Wed, Oct 10\\u2009\\u2013\\u2009Sat, Nov 10",
46f4442e 515
f3c0d7a5 516 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMy", "Wed, 10/10/2007\\u2009\\u2013\\u2009Sat, 11/10/2007",
46f4442e 517
f3c0d7a5 518 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMy", "10/10/2007\\u2009\\u2013\\u200911/10/2007",
46f4442e
A
519
520
f3c0d7a5 521 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10/2007\\u2009\\u2013\\u200911/2007",
46f4442e 522
f3c0d7a5 523 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdM", "Wed, 10/10\\u2009\\u2013\\u2009Sat, 11/10",
46f4442e 524
f3c0d7a5 525 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10/10\\u2009\\u2013\\u200911/10",
46f4442e 526
f3c0d7a5 527 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Ed", "10 Wed\\u2009\\u2013\\u200910 Sat",
46f4442e
A
528
529 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007",
530
f3c0d7a5 531 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "M", "10\\u2009\\u2013\\u200911",
46f4442e 532
f3c0d7a5 533 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Oct\\u2009\\u2013\\u2009Nov",
46f4442e 534
f3c0d7a5 535 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMM", "October\\u2009\\u2013\\u2009November",
46f4442e 536
f3c0d7a5
A
537 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hm", "10/10/2007, 10:10 AM\\u2009\\u2013\\u200911/10/2007, 10:10 AM",
538 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Hm", "10/10/2007, 10:10\\u2009\\u2013\\u200911/10/2007, 10:10",
539 "en", "2007 10 10 20:10:10", "2007 11 10 20:10:10", "Hm", "10/10/2007, 20:10\\u2009\\u2013\\u200911/10/2007, 20:10",
46f4442e 540
f3c0d7a5 541 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT\\u2009\\u2013\\u200911/10/2007, 10:10 AM PT",
46f4442e 542
f3c0d7a5 543 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT\\u2009\\u2013\\u200911/10/2007, 10:10 AM PST",
46f4442e 544
f3c0d7a5 545 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "h", "10/10/2007, 10 AM\\u2009\\u2013\\u200911/10/2007, 10 AM",
46f4442e 546
f3c0d7a5 547 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hv", "10/10/2007, 10 AM PT\\u2009\\u2013\\u200911/10/2007, 10 AM PT",
46f4442e 548
f3c0d7a5 549 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hz", "10/10/2007, 10 AM PDT\\u2009\\u2013\\u200911/10/2007, 10 AM PST",
46f4442e 550
f3c0d7a5 551 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007\\u2009\\u2013\\u2009Sat, 11/10/2007",
46f4442e 552
f3c0d7a5 553 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EddMMy", "Wed, 10/10/2007\\u2009\\u2013\\u2009Sat, 11/10/2007",
46f4442e
A
554
555
f3c0d7a5 556 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT\\u2009\\u2013\\u200911/10/2007, 10:10 AM PST",
46f4442e 557
f3c0d7a5 558 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM\\u2009\\u2013\\u200911/10/2007, 10:10:10 AM",
46f4442e 559
f3c0d7a5 560 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMMy", "O 10\\u2009\\u2013\\u2009N 10, 2007",
46f4442e 561
f3c0d7a5 562 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEEdM", "W, 10/10\\u2009\\u2013\\u2009S, 11/10",
46f4442e 563
f3c0d7a5 564 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "Saturday, November 10\\u2009\\u2013\\u2009Tuesday, November 20, 2007",
46f4442e 565
f3c0d7a5 566 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMy", "November 10\\u2009\\u2013\\u200920, 2007",
46f4442e 567
f3c0d7a5 568 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "November 10\\u2009\\u2013\\u200920",
46f4442e
A
569
570
f3c0d7a5 571 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "Saturday, November 10\\u2009\\u2013\\u2009Tuesday, November 20",
46f4442e 572
f3c0d7a5 573 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMMy", "Sat, Nov 10\\u2009\\u2013\\u2009Tue, Nov 20, 2007",
46f4442e 574
f3c0d7a5 575 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "Nov 10\\u2009\\u2013\\u200920, 2007",
46f4442e 576
f3c0d7a5 577 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMM", "Nov 10\\u2009\\u2013\\u200920",
46f4442e
A
578
579 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov 2007",
580
f3c0d7a5 581 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMM", "Sat, Nov 10\\u2009\\u2013\\u2009Tue, Nov 20",
46f4442e 582
f3c0d7a5 583 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sat, 11/10/2007\\u2009\\u2013\\u2009Tue, 11/20/2007",
46f4442e 584
f3c0d7a5 585 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "11/10/2007\\u2009\\u2013\\u200911/20/2007",
46f4442e 586
f3c0d7a5 587 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10\\u2009\\u2013\\u200911/20",
46f4442e
A
588
589 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11/2007",
590
f3c0d7a5 591 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "Sat, 11/10\\u2009\\u2013\\u2009Tue, 11/20",
46f4442e 592
f3c0d7a5 593 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10\\u2009\\u2013\\u200920",
46f4442e 594
f3c0d7a5 595 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Ed", "10 Sat\\u2009\\u2013\\u200920 Tue",
46f4442e
A
596
597 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007",
598
599 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11",
600
601 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "Nov",
602
603 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMM", "November",
604
f3c0d7a5
A
605 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hm", "11/10/2007, 10:10 AM\\u2009\\u2013\\u200911/20/2007, 10:10 AM",
606 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Hm", "11/10/2007, 10:10\\u2009\\u2013\\u200911/20/2007, 10:10",
607 "en", "2007 11 10 20:10:10", "2007 11 20 20:10:10", "Hm", "11/10/2007, 20:10\\u2009\\u2013\\u200911/20/2007, 20:10",
46f4442e 608
f3c0d7a5 609 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "11/10/2007, 10:10 AM PT\\u2009\\u2013\\u200911/20/2007, 10:10 AM PT",
46f4442e 610
f3c0d7a5 611 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "11/10/2007, 10:10 AM PST\\u2009\\u2013\\u200911/20/2007, 10:10 AM PST",
46f4442e 612
f3c0d7a5 613 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "11/10/2007, 10 AM\\u2009\\u2013\\u200911/20/2007, 10 AM",
46f4442e 614
f3c0d7a5 615 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hv", "11/10/2007, 10 AM PT\\u2009\\u2013\\u200911/20/2007, 10 AM PT",
46f4442e 616
f3c0d7a5 617 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hz", "11/10/2007, 10 AM PST\\u2009\\u2013\\u200911/20/2007, 10 AM PST",
46f4442e 618
f3c0d7a5 619 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEddMMyyyy", "Sat, 11/10/2007\\u2009\\u2013\\u2009Tue, 11/20/2007",
46f4442e 620
f3c0d7a5 621 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EddMMy", "Sat, 11/10/2007\\u2009\\u2013\\u2009Tue, 11/20/2007",
46f4442e 622
f3c0d7a5 623 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hhmm", "11/10/2007, 10:10 AM\\u2009\\u2013\\u200911/20/2007, 10:10 AM",
46f4442e 624
f3c0d7a5 625 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hhmmzz", "11/10/2007, 10:10 AM PST\\u2009\\u2013\\u200911/20/2007, 10:10 AM PST",
46f4442e 626
f3c0d7a5
A
627 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hms", "11/10/2007, 10:10:10 AM\\u2009\\u2013\\u200911/20/2007, 10:10:10 AM",
628 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Hms", "11/10/2007, 10:10:10\\u2009\\u2013\\u200911/20/2007, 10:10:10",
629 "en", "2007 11 10 20:10:10", "2007 11 20 20:10:10", "Hms", "11/10/2007, 20:10:10\\u2009\\u2013\\u200911/20/2007, 20:10:10",
46f4442e 630
f3c0d7a5 631 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMMy", "N 10\\u2009\\u2013\\u200920, 2007",
46f4442e 632
f3c0d7a5 633 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEEdM", "S, 11/10\\u2009\\u2013\\u2009T, 11/20",
46f4442e
A
634
635 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMMy", "Wednesday, January 10, 2007",
636
637 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMy", "January 10, 2007",
638
639 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMM", "January 10",
640
641 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMMy", "January 2007",
642
643 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMM", "Wednesday, January 10",
644
645 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMMMy", "Wed, Jan 10, 2007",
646
647 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMy", "Jan 10, 2007",
648
649 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "Jan 10",
650
651 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan 2007",
652
653 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMMM", "Wed, Jan 10",
654
655
656 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMy", "1/10/2007",
657
658 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dM", "1/10",
659
660 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "My", "1/2007",
661
662 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdM", "Wed, 1/10",
663
664 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "d", "10",
665
666 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Ed", "10 Wed",
667
668 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "y", "2007",
669
670 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "M", "1",
671
672 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMM", "Jan",
673
674 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMM", "January",
675
f3c0d7a5
A
676 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "10:00 AM\\u2009\\u2013\\u20092:10 PM",
677 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Hm", "10:00\\u2009\\u2013\\u200914:10",
46f4442e 678
f3c0d7a5 679 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmv", "10:00 AM\\u2009\\u2013\\u20092:10 PM PT",
46f4442e 680
f3c0d7a5 681 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "10:00 AM\\u2009\\u2013\\u20092:10 PM PST",
46f4442e 682
f3c0d7a5
A
683 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 AM\\u2009\\u2013\\u20092 PM",
684 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "H", "10\\u2009\\u2013\\u200914",
46f4442e
A
685
686
f3c0d7a5 687 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hz", "10 AM\\u2009\\u2013\\u20092 PM PST",
46f4442e
A
688
689 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEddMMyyyy", "Wed, 01/10/2007",
690
691 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EddMMy", "Wed, 01/10/2007",
692
f3c0d7a5
A
693 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmm", "10:00 AM\\u2009\\u2013\\u20092:10 PM",
694 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "HHmm", "10:00\\u2009\\u2013\\u200914:10",
46f4442e 695
f3c0d7a5 696 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmmzz", "10:00 AM\\u2009\\u2013\\u20092:10 PM PST",
46f4442e 697
f3c0d7a5
A
698 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hms", "10:00:10 AM\\u2009\\u2013\\u20092:10:10 PM",
699 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Hms", "10:00:10\\u2009\\u2013\\u200914:10:10",
46f4442e
A
700
701 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMMy", "J 10, 2007",
702
703 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEEdM", "W, 1/10",
704 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMMy", "January 10, 2007",
705
706 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMM", "January 10",
707
708 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "MMMMy", "January 2007",
709
710 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMMM", "Wednesday, January 10",
711
712 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMMy", "Wed, Jan 10, 2007",
713
714 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMy", "Jan 10, 2007",
715
716 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMM", "Jan 10",
717
718
719 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMM", "Wed, Jan 10",
720
721 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMy", "Wed, 1/10/2007",
722
723 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMy", "1/10/2007",
724
725
726 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "My", "1/2007",
727
728 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdM", "Wed, 1/10",
729
730 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "d", "10",
731
732
733 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "y", "2007",
734
735 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "M", "1",
736
737
738
f3c0d7a5
A
739 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "10:00\\u2009\\u2013\\u200910:20 AM",
740 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Hm", "10:00\\u2009\\u2013\\u200910:20",
46f4442e
A
741
742
f3c0d7a5 743 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00\\u2009\\u2013\\u200910:20 AM PST",
46f4442e
A
744
745
729e4ab9 746 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hv", "10 AM PT",
46f4442e
A
747
748
749
750 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EddMMy", "Wed, 01/10/2007",
751
f3c0d7a5
A
752 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmm", "10:00\\u2009\\u2013\\u200910:20 AM",
753 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "HHmm", "10:00\\u2009\\u2013\\u200910:20",
46f4442e 754
f3c0d7a5 755 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmmzz", "10:00\\u2009\\u2013\\u200910:20 AM PST",
46f4442e
A
756
757
758 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMMMy", "J 10, 2007",
759
760
761 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMMy", "Wednesday, January 10, 2007",
762
763 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMMy", "January 10, 2007",
764
765
766 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMMMy", "January 2007",
767
768 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMM", "Wednesday, January 10",
769
770
771 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMy", "Jan 10, 2007",
772
773 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMM", "Jan 10",
774
775
776 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMMM", "Wed, Jan 10",
777
778 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMy", "Wed, 1/10/2007",
779
780 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMy", "1/10/2007",
781
782
783 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "My", "1/2007",
784
785 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdM", "Wed, 1/10",
786
787 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "d", "10",
788
789
790 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "y", "2007",
791
792 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "M", "1",
793
794
795 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMMM", "January",
796
797 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "10:10 AM",
729e4ab9 798 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Hm", "10:10",
46f4442e
A
799
800
801 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 AM PST",
802
729e4ab9 803 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "10 AM",
46f4442e 804
729e4ab9 805 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 AM PT",
46f4442e
A
806
807
808 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEddMMyyyy", "Wed, 01/10/2007",
809
810
811 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hhmm", "10:10 AM",
729e4ab9 812 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "HHmm", "10:10",
46f4442e
A
813
814 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hhmmzz", "10:10 AM PST",
815
816
817 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMMMy", "J 10, 2007",
818
819 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEEdM", "W, 1/10",
820
821 "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f32008\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e94",
822
823
824 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u81f311\\u670810\\u65e5",
825
826
827 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "2007\\u5e7410\\u6708\\u81f311\\u6708",
828
829
f3c0d7a5 830 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "2007/10/10 \\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10\\u2009\\u2013\\u20092007/11/10 \\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10",
46f4442e
A
831
832 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "2007\\u5e7411\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c",
833
834
835 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "11\\u670810\\u65e5\\u81f320\\u65e5",
836
837 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMMy", "2007\\u5E7411\\u6708", // (fixed expected result per ticket:6626:)
f3c0d7a5
A
838
839 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "11\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c",
840
841
842 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "2007/11/10\\u5468\\u516d\\u81f32007/11/20\\u5468\\u4e8c",
843
844
845 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10\\u2009\\u2013\\u200911/20",
846
847 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007\\u5E7411\\u6708",
848
849 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "11/10\\u5468\\u516d\\u81f311/20\\u5468\\u4e8c",
850
851
46f4442e 852 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007\\u5E74", // (fixed expected result per ticket:6626:)
f3c0d7a5
A
853
854 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11\\u6708",
855
51004dcb 856 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "11\\u6708", // (fixed expected result per ticket:6626: and others)
46f4442e
A
857
858
f3c0d7a5 859 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "2007/11/10 GMT-8 \\u4e0a\\u534810:10\\u2009\\u2013\\u20092007/11/20 GMT-8 \\u4e0a\\u534810:10",
46f4442e 860
f3c0d7a5 861 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "2007/11/10 \\u4e0a\\u534810\\u65f6\\u2009\\u2013\\u20092007/11/20 \\u4e0a\\u534810\\u65f6",
46f4442e 862
57a6839d 863 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMMy", "2007\\u5e741\\u670810\\u65e5 \\u661f\\u671f\\u4e09", // (fixed expected result per ticket:6626:)
46f4442e
A
864
865 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10",
866
867
51004dcb 868 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "GMT-8\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10",
46f4442e 869
51004dcb 870 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "\\u4e0a\\u534810\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6",
46f4442e 871
51004dcb 872 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810\\u65F6\\u81F3\\u4E0B\\u53482\\u65F6",
f3c0d7a5
A
873
874 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "\\u4e0a\\u534810:00\\u81f310:20",
875
51004dcb 876 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:00\\u81F310:20",
46f4442e 877
57a6839d 878 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "GMT-8\\u4e0a\\u534810\\u65f6",
46f4442e
A
879
880 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "\\u4e0a\\u534810:10",
881
729e4ab9 882 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "\\u4e0a\\u534810\\u65f6",
46f4442e 883
f3c0d7a5 884 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. 2007\\u2009\\u2013\\u2009Freitag, 10. Okt. 2008",
46f4442e
A
885
886
f3c0d7a5 887 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "10. Okt. 2007\\u2009\\u2013\\u200910. Okt. 2008",
46f4442e 888
f3c0d7a5 889 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Okt. 2007\\u2009\\u2013\\u2009Okt. 2008",
46f4442e
A
890
891
f3c0d7a5 892 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Mi. 10.10.2007\\u2009\\u2013\\u2009Fr. 10.10.2008",
46f4442e 893
f3c0d7a5 894 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10.10.2007\\u2009\\u2013\\u200910.10.2008",
46f4442e
A
895
896
f3c0d7a5 897 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10.2007\\u2009\\u2013\\u200910.2008",
46f4442e 898
f3c0d7a5 899 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Mi. 10.10.2007\\u2009\\u2013\\u2009Fr. 10.10.2008",
46f4442e
A
900
901
b331163b 902 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007\\u20132008",
46f4442e 903
f3c0d7a5 904 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10.2007\\u2009\\u2013\\u200910.2008",
46f4442e
A
905
906
f3c0d7a5
A
907 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007, 10:10 AM\\u2009\\u2013\\u200910.10.2008, 10:10 AM",
908 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Hm", "10.10.2007, 10:10\\u2009\\u2013\\u200910.10.2008, 10:10",
46f4442e 909
f3c0d7a5 910 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt.\\u2009\\u2013\\u2009Samstag, 10. Nov. 2007",
46f4442e
A
911
912
f3c0d7a5 913 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "10. Okt.\\u2009\\u2013\\u200910. Nov.",
46f4442e 914
b331163b 915 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Okt.\\u2013Nov. 2007",
46f4442e 916
f3c0d7a5 917 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMM", "Mittwoch, 10. Okt.\\u2009\\u2013\\u2009Samstag, 10. Nov.",
46f4442e
A
918
919
f3c0d7a5 920 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10.10.\\u2009\\u2013\\u200910.11.",
46f4442e 921
f3c0d7a5 922 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10.2007\\u2009\\u2013\\u200911.2007",
46f4442e
A
923
924
f3c0d7a5 925 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10.10.\\u2009\\u2013\\u200910.11.",
46f4442e
A
926
927 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007",
928
929
b331163b 930 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Okt.\\u2013Nov.",
46f4442e
A
931
932
f3c0d7a5
A
933 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007, 10:10:10 AM\\u2009\\u2013\\u200910.11.2007, 10:10:10 AM",
934 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Hms", "10.10.2007, 10:10:10\\u2009\\u2013\\u200910.11.2007, 10:10:10",
46f4442e 935
f3c0d7a5 936 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMy", "Samstag, 10.\\u2009\\u2013\\u2009Dienstag, 20. Nov. 2007",
46f4442e 937
b331163b 938 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "10.\\u201320. Nov. 2007",
46f4442e
A
939
940
51004dcb 941 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov. 2007",
46f4442e 942
f3c0d7a5 943 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMM", "Samstag, 10.\\u2009\\u2013\\u2009Dienstag, 20. Nov.",
46f4442e 944
f3c0d7a5 945 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sa. 10.11.2007\\u2009\\u2013\\u2009Di. 20.11.2007",
46f4442e
A
946
947
f3c0d7a5 948 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "10.11.\\u2009\\u2013\\u200920.11.",
46f4442e 949
729e4ab9 950 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11.2007",
46f4442e
A
951
952
b331163b 953 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10.\\u201320.",
46f4442e
A
954
955 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007",
956
957
f3c0d7a5 958 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007, 10:10 AM Los Angeles Zeit\\u2009\\u2013\\u200920.11.2007, 10:10 AM Los Angeles Zeit",
46f4442e 959
51004dcb 960 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007",
46f4442e
A
961
962
51004dcb 963 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "10. Jan.",
46f4442e 964
51004dcb 965 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan. 2007",
46f4442e 966
51004dcb 967 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMM", "Mittwoch, 10. Jan.",
46f4442e
A
968
969
f3c0d7a5 970 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 AM\\u2009\\u2013\\u20092 PM",
b331163b 971 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "H", "10\\u201314 Uhr",
46f4442e 972
51004dcb 973 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMM", "Mittwoch, 10. Jan.",
46f4442e
A
974
975
d25163bf 976 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00\\u201310:20 AM Los Angeles Zeit",
46f4442e 977
d25163bf 978 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00\\u201310:20 AM GMT-8",
46f4442e 979
d25163bf 980 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 AM",
729e4ab9 981 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "H", "10 Uhr",
46f4442e
A
982
983
d25163bf 984 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 AM GMT-8",
46f4442e 985
51004dcb 986 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007",
46f4442e
A
987
988
d25163bf 989 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 AM Los Angeles Zeit",
46f4442e 990
d25163bf 991 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 AM GMT-8",
46f4442e
A
992
993
d25163bf 994 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 AM Los Angeles Zeit",
729e4ab9 995
d25163bf 996 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 AM GMT-8",
729e4ab9
A
997
998 // Thai (default calendar buddhist)
999
f3c0d7a5
A
1000 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2550 \\u2013 \\u0E27\\u0E31\\u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2551",
1001
1002
1003 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. 2550 \\u2013 10 \\u0E15.\\u0E04. 2551",
1004
1005 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u0E04. 2550 \\u2013 \\u0E15.\\u0E04. 2551",
1006
1007
1008 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551",
1009
1010 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMy", "10/10/2550 \\u2013 10/10/2551",
1011
1012
1013 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "My", "10/2550 \\u2013 10/2551",
1014
1015 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551",
1016
1017
1018 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "y", "2550\\u20132551",
1019
1020 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "M", "10/2550 \\u2013 10/2551",
1021
1022
1023 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. \\u2013 \\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E1E.\\u0E22. 2550",
1024
1025
1026 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. \\u2013 10 \\u0E1E.\\u0E22.",
1027
1028 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22. 2550",
1029
1030 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 \\u2013 10/11",
1031
1032 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "My", "10/2550 \\u2013 11/2550",
1033
1034
1035 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "d", "10/10 \\u2013 10/11",
1036
1037 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "\\u0E1E.\\u0E28. 2550",
1038
1039
1040 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22.",
729e4ab9 1041
46f4442e 1042 };
2ca993e8 1043 expect(DATA, UPRV_LENGTHOF(DATA));
46f4442e
A
1044}
1045
1046
1047void DateIntervalFormatTest::expect(const char** data, int32_t data_length) {
1048 int32_t i = 0;
1049 UErrorCode ec = U_ZERO_ERROR;
1050 UnicodeString str, str2;
1051 const char* pattern = data[0];
1052 i++;
1053
46f4442e
A
1054 while (i<data_length) {
1055 const char* locName = data[i++];
1056 Locale loc(locName);
1057 SimpleDateFormat ref(pattern, loc, ec);
f3c0d7a5
A
1058 logln( "case %d, locale: %s\n", (i-1)/5, locName);
1059
729e4ab9
A
1060 if (U_FAILURE(ec)) {
1061 dataerrln("contruct SimpleDateFormat in expect failed: %s", u_errorName(ec));
1062 return;
1063 }
46f4442e
A
1064 // 'f'
1065 const char* datestr = data[i++];
1066 const char* datestr_2 = data[i++];
f3c0d7a5 1067 logln("original date: %s - %s\n", datestr, datestr_2);
46f4442e
A
1068 UDate date = ref.parse(ctou(datestr), ec);
1069 if (!assertSuccess("parse 1st data in expect", ec)) return;
1070 UDate date_2 = ref.parse(ctou(datestr_2), ec);
1071 if (!assertSuccess("parse 2nd data in expect", ec)) return;
1072 DateInterval dtitv(date, date_2);
1073
f3c0d7a5 1074 const UnicodeString& oneSkeleton(ctou(data[i++]));
46f4442e
A
1075
1076 DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(oneSkeleton, loc, ec);
1077 if (!assertSuccess("createInstance(skeleton) in expect", ec)) return;
f3c0d7a5 1078 FieldPosition pos(FieldPosition::DONT_CARE);
46f4442e
A
1079 dtitvfmt->format(&dtitv, str.remove(), pos, ec);
1080 if (!assertSuccess("format in expect", ec)) return;
f3c0d7a5 1081 assertEquals((UnicodeString)"\"" + locName + "\\" + oneSkeleton + "\\" + ctou(datestr) + "\\" + ctou(datestr_2) + "\"", ctou(data[i++]), str);
46f4442e 1082
f3c0d7a5
A
1083 logln("interval date:" + str + "\"" + locName + "\", "
1084 + "\"" + datestr + "\", "
1085 + "\"" + datestr_2 + "\", " + oneSkeleton);
46f4442e
A
1086 delete dtitvfmt;
1087 }
1088}
1089
1090
f3c0d7a5 1091/*
46f4442e
A
1092 * Test format using user defined DateIntervalInfo
1093 */
1094void DateIntervalFormatTest::testFormatUserDII() {
1095 // first item is date pattern
1096 const char* DATA[] = {
f3c0d7a5
A
1097 "yyyy MM dd HH:mm:ss",
1098 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Oct 10, 2007 --- Oct 10, 2008",
1099
1100 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 Oct 10 - Nov 2007",
1101
1102 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Nov 10, 2007 --- Nov 20, 2007",
1103
1104 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Jan 10, 2007",
1105
1106 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Jan 10, 2007",
1107
1108 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Jan 10, 2007",
1109
1110 "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "2007\\u5e7410\\u670810\\u65e5 --- 2008\\u5e7410\\u670810\\u65e5",
1111
1112 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 10\\u6708 10 - 11\\u6708 2007",
1113
1114 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007\\u5e7411\\u670810\\u65e5 --- 2007\\u5e7411\\u670820\\u65e5",
1115
46f4442e 1116 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:)
f3c0d7a5 1117
46f4442e 1118 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:)
f3c0d7a5 1119
46f4442e
A
1120 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:)
1121
51004dcb 1122 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10. Okt. 2007 --- 10. Okt. 2008",
46f4442e
A
1123
1124
51004dcb 1125 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10. Nov. 2007 --- 20. Nov. 2007",
46f4442e 1126
51004dcb 1127 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10. Jan. 2007",
46f4442e 1128
51004dcb 1129 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10. Jan. 2007",
46f4442e
A
1130
1131
4388f060 1132 "es", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10 oct 2007 --- 10 oct 2008",
46f4442e
A
1133
1134 "es", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 oct 10 - nov 2007",
1135
4388f060 1136 "es", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10 nov 2007 --- 20 nov 2007",
46f4442e 1137
4388f060 1138 "es", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10 ene 2007",
46f4442e 1139
4388f060
A
1140 "es", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10 ene 2007",
1141
1142 "es", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10 ene 2007",
46f4442e 1143 };
2ca993e8 1144 expectUserDII(DATA, UPRV_LENGTHOF(DATA));
46f4442e
A
1145}
1146
1147
51004dcb
A
1148void DateIntervalFormatTest::testSetIntervalPatternNoSideEffect() {
1149 UErrorCode ec = U_ZERO_ERROR;
b331163b 1150 LocalPointer<DateIntervalInfo> dtitvinf(new DateIntervalInfo(ec), ec);
51004dcb
A
1151 if (U_FAILURE(ec)) {
1152 errln("Failure encountered: %s", u_errorName(ec));
1153 return;
1154 }
1155 UnicodeString expected;
1156 dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, expected, ec);
1157 dtitvinf->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d"), ec);
1158 if (U_FAILURE(ec)) {
1159 errln("Failure encountered: %s", u_errorName(ec));
1160 return;
1161 }
b331163b 1162 dtitvinf.adoptInsteadAndCheckErrorCode(new DateIntervalInfo(ec), ec);
51004dcb
A
1163 if (U_FAILURE(ec)) {
1164 errln("Failure encountered: %s", u_errorName(ec));
1165 return;
1166 }
1167 UnicodeString actual;
1168 dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, actual, ec);
1169 if (U_FAILURE(ec)) {
1170 errln("Failure encountered: %s", u_errorName(ec));
1171 return;
1172 }
1173 if (expected != actual) {
1174 errln("DateIntervalInfo.setIntervalPattern should have no side effects.");
1175 }
1176}
1177
57a6839d
A
1178void DateIntervalFormatTest::testYearFormats() {
1179 const Locale &enLocale = Locale::getEnglish();
1180 UErrorCode status = U_ZERO_ERROR;
1181 LocalPointer<Calendar> fromTime(Calendar::createInstance(enLocale, status));
1182 LocalPointer<Calendar> toTime(Calendar::createInstance(enLocale, status));
1183 if (U_FAILURE(status)) {
1184 errln("Failure encountered: %s", u_errorName(status));
1185 return;
1186 }
1187 // April 26, 113. Three digit year so that we can test 2 digit years;
1188 // 4 digit years with padded 0's and full years.
1189 fromTime->set(113, 3, 26);
1190 // April 28, 113.
1191 toTime->set(113, 3, 28);
1192 {
1193 LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yyyyMd", enLocale, status));
1194 if (U_FAILURE(status)) {
1195 dataerrln("Failure encountered: %s", u_errorName(status));
1196 return;
1197 }
1198 UnicodeString actual;
f3c0d7a5 1199 UnicodeString expected(ctou("4/26/0113\\u2009\\u2013\\u20094/28/0113"));
57a6839d
A
1200 FieldPosition pos = 0;
1201 dif->format(*fromTime, *toTime, actual, pos, status);
1202 if (U_FAILURE(status)) {
1203 errln("Failure encountered: %s", u_errorName(status));
1204 return;
1205 }
1206 if (actual != expected) {
1207 errln("Expected " + expected + ", got: " + actual);
1208 }
1209 }
1210 {
1211 LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yyMd", enLocale, status));
1212 if (U_FAILURE(status)) {
1213 errln("Failure encountered: %s", u_errorName(status));
1214 return;
1215 }
1216 UnicodeString actual;
f3c0d7a5
A
1217 UnicodeString expected(ctou("4/26/13\\u2009\\u2013\\u20094/28/13"));
1218 FieldPosition pos(FieldPosition::DONT_CARE);
57a6839d
A
1219 dif->format(*fromTime, *toTime, actual, pos, status);
1220 if (U_FAILURE(status)) {
1221 errln("Failure encountered: %s", u_errorName(status));
1222 return;
1223 }
1224 if (actual != expected) {
1225 errln("Expected " + expected + ", got: " + actual);
1226 }
1227 }
1228 {
1229 LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yMd", enLocale, status));
1230 if (U_FAILURE(status)) {
1231 errln("Failure encountered: %s", u_errorName(status));
1232 return;
1233 }
1234 UnicodeString actual;
f3c0d7a5
A
1235 UnicodeString expected(ctou("4/26/113\\u2009\\u2013\\u20094/28/113"));
1236 FieldPosition pos(FieldPosition::DONT_CARE);
57a6839d
A
1237 dif->format(*fromTime, *toTime, actual, pos, status);
1238 if (U_FAILURE(status)) {
1239 errln("Failure encountered: %s", u_errorName(status));
1240 return;
1241 }
1242 if (actual != expected) {
1243 errln("Expected " + expected + ", got: " + actual);
1244 }
1245 }
1246}
51004dcb 1247
f3c0d7a5 1248void DateIntervalFormatTest::expectUserDII(const char** data,
46f4442e
A
1249 int32_t data_length) {
1250 int32_t i = 0;
1251 UnicodeString str;
1252 UErrorCode ec = U_ZERO_ERROR;
1253 const char* pattern = data[0];
1254 i++;
1255
1256 while ( i < data_length ) {
1257 const char* locName = data[i++];
1258 Locale loc(locName);
1259 SimpleDateFormat ref(pattern, loc, ec);
729e4ab9
A
1260 if (U_FAILURE(ec)) {
1261 dataerrln("contruct SimpleDateFormat in expectUserDII failed: %s", u_errorName(ec));
1262 return;
1263 }
46f4442e
A
1264 const char* datestr = data[i++];
1265 const char* datestr_2 = data[i++];
1266 UDate date = ref.parse(ctou(datestr), ec);
1267 if (!assertSuccess("parse in expectUserDII", ec)) return;
1268 UDate date_2 = ref.parse(ctou(datestr_2), ec);
1269 if (!assertSuccess("parse in expectUserDII", ec)) return;
1270 DateInterval dtitv(date, date_2);
1271
1272 ec = U_ZERO_ERROR;
1273 // test user created DateIntervalInfo
1274 DateIntervalInfo* dtitvinf = new DateIntervalInfo(ec);
1275 dtitvinf->setFallbackIntervalPattern("{0} --- {1}", ec);
1276 dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_MONTH, "yyyy MMM d - MMM y",ec);
1277 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return;
1278 dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_HOUR_OF_DAY, "yyyy MMM d HH:mm - HH:mm", ec);
1279 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return;
1280 DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_ABBR_MONTH_DAY, loc, *dtitvinf, ec);
1281 delete dtitvinf;
1282 if (!assertSuccess("createInstance(skeleton,dtitvinf) in expectUserDII", ec)) return;
f3c0d7a5 1283 FieldPosition pos(FieldPosition::DONT_CARE);
46f4442e
A
1284 dtitvfmt->format(&dtitv, str.remove(), pos, ec);
1285 if (!assertSuccess("format in expectUserDII", ec)) return;
1286 assertEquals((UnicodeString)"\"" + locName + "\\" + datestr + "\\" + datestr_2 + "\"", ctou(data[i++]), str);
1287#ifdef DTIFMTTS_DEBUG
f3c0d7a5 1288 char result[1000];
46f4442e
A
1289 char mesg[1000];
1290 PRINTMESG("interval format using user defined DateIntervalInfo\n");
1291 str.extract(0, str.length(), result, "UTF-8");
1292 sprintf(mesg, "interval date: %s\n", result);
1293 PRINTMESG(mesg);
1294#endif
1295 delete dtitvfmt;
1296 }
1297}
1298
1299
1300void DateIntervalFormatTest::testStress() {
1301 if(quick){
1302 logln("Quick mode: Skipping test");
1303 return;
1304 }
1305 const char* DATA[] = {
1306 "yyyy MM dd HH:mm:ss",
f3c0d7a5
A
1307 "2007 10 10 10:10:10", "2008 10 10 10:10:10",
1308 "2007 10 10 10:10:10", "2007 11 10 10:10:10",
1309 "2007 11 10 10:10:10", "2007 11 20 10:10:10",
1310 "2007 01 10 10:00:10", "2007 01 10 14:10:10",
1311 "2007 01 10 10:00:10", "2007 01 10 10:20:10",
1312 "2007 01 10 10:10:10", "2007 01 10 10:10:20",
46f4442e
A
1313 };
1314
1315 const char* testLocale[][3] = {
1316 //{"th", "", ""},
1317 {"en", "", ""},
1318 {"zh", "", ""},
1319 {"de", "", ""},
1320 {"ar", "", ""},
1321 {"en", "GB", ""},
1322 {"fr", "", ""},
1323 {"it", "", ""},
1324 {"nl", "", ""},
1325 {"zh", "TW", ""},
1326 {"ja", "", ""},
1327 {"pt", "BR", ""},
1328 {"ru", "", ""},
1329 {"pl", "", ""},
1330 {"tr", "", ""},
1331 {"es", "", ""},
1332 {"ko", "", ""},
1333 {"sv", "", ""},
1334 {"fi", "", ""},
1335 {"da", "", ""},
1336 {"pt", "PT", ""},
1337 {"ro", "", ""},
1338 {"hu", "", ""},
1339 {"he", "", ""},
1340 {"in", "", ""},
1341 {"cs", "", ""},
1342 {"el", "", ""},
1343 {"no", "", ""},
1344 {"vi", "", ""},
1345 {"bg", "", ""},
1346 {"hr", "", ""},
1347 {"lt", "", ""},
1348 {"sk", "", ""},
1349 {"sl", "", ""},
1350 {"sr", "", ""},
1351 {"ca", "", ""},
1352 {"lv", "", ""},
1353 {"uk", "", ""},
1354 {"hi", "", ""},
1355 };
1356
1357 uint32_t localeIndex;
2ca993e8 1358 for ( localeIndex = 0; localeIndex < UPRV_LENGTHOF(testLocale); ++localeIndex ) {
46f4442e
A
1359 char locName[32];
1360 uprv_strcpy(locName, testLocale[localeIndex][0]);
1361 uprv_strcat(locName, testLocale[localeIndex][1]);
2ca993e8 1362 stress(DATA, UPRV_LENGTHOF(DATA), Locale(testLocale[localeIndex][0], testLocale[localeIndex][1], testLocale[localeIndex][2]), locName);
46f4442e
A
1363 }
1364}
1365
1366
1367void DateIntervalFormatTest::stress(const char** data, int32_t data_length,
1368 const Locale& loc, const char* locName) {
1369 UnicodeString skeleton[] = {
1370 "EEEEdMMMMy",
1371 "dMMMMy",
1372 "dMMMM",
1373 "MMMMy",
1374 "EEEEdMMMM",
1375 "EdMMMy",
1376 "dMMMy",
1377 "dMMM",
1378 "MMMy",
1379 "EdMMM",
1380 "EdMy",
1381 "dMy",
1382 "dM",
1383 "My",
1384 "EdM",
1385 "d",
1386 "Ed",
1387 "y",
1388 "M",
1389 "MMM",
1390 "MMMM",
1391 "hm",
1392 "hmv",
1393 "hmz",
1394 "h",
1395 "hv",
1396 "hz",
1397 "EEddMMyyyy", // following could be normalized
f3c0d7a5 1398 "EddMMy",
46f4442e
A
1399 "hhmm",
1400 "hhmmzz",
1401 "hms", // following could not be normalized
1402 "dMMMMMy",
1403 "EEEEEdM",
1404 };
1405
1406 int32_t i = 0;
1407 UErrorCode ec = U_ZERO_ERROR;
1408 UnicodeString str, str2;
1409 SimpleDateFormat ref(data[i++], loc, ec);
1410 if (!assertSuccess("construct SimpleDateFormat", ec)) return;
1411
1412#ifdef DTIFMTTS_DEBUG
f3c0d7a5 1413 char result[1000];
46f4442e 1414 char mesg[1000];
f3c0d7a5 1415 sprintf(mesg, "locale: %s\n", locName);
46f4442e
A
1416 PRINTMESG(mesg);
1417#endif
1418
1419 while (i<data_length) {
1420
1421 // 'f'
1422 const char* datestr = data[i++];
1423 const char* datestr_2 = data[i++];
1424#ifdef DTIFMTTS_DEBUG
1425 sprintf(mesg, "original date: %s - %s\n", datestr, datestr_2);
1426 PRINTMESG(mesg)
1427#endif
1428 UDate date = ref.parse(ctou(datestr), ec);
1429 if (!assertSuccess("parse", ec)) return;
1430 UDate date_2 = ref.parse(ctou(datestr_2), ec);
1431 if (!assertSuccess("parse", ec)) return;
1432 DateInterval dtitv(date, date_2);
1433
f3c0d7a5
A
1434 for ( uint32_t skeletonIndex = 0;
1435 skeletonIndex < UPRV_LENGTHOF(skeleton);
46f4442e
A
1436 ++skeletonIndex ) {
1437 const UnicodeString& oneSkeleton = skeleton[skeletonIndex];
1438 DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(oneSkeleton, loc, ec);
1439 if (!assertSuccess("createInstance(skeleton)", ec)) return;
1440 /*
1441 // reset the calendar to be Gregorian calendar for "th"
1442 if ( uprv_strcmp(locName, "th") == 0 ) {
1443 GregorianCalendar* gregCal = new GregorianCalendar(loc, ec);
1444 if (!assertSuccess("GregorianCalendar()", ec)) return;
1445 const DateFormat* dformat = dtitvfmt->getDateFormat();
1446 DateFormat* newOne = (DateFormat*)dformat->clone();
1447 newOne->adoptCalendar(gregCal);
1448 //dtitvfmt->adoptDateFormat(newOne, ec);
1449 dtitvfmt->setDateFormat(*newOne, ec);
1450 delete newOne;
1451 if (!assertSuccess("adoptDateFormat()", ec)) return;
1452 }
1453 */
f3c0d7a5 1454 FieldPosition pos(FieldPosition::DONT_CARE);
46f4442e
A
1455 dtitvfmt->format(&dtitv, str.remove(), pos, ec);
1456 if (!assertSuccess("format", ec)) return;
1457#ifdef DTIFMTTS_DEBUG
1458 oneSkeleton.extract(0, oneSkeleton.length(), result, "UTF-8");
1459 sprintf(mesg, "interval by skeleton: %s\n", result);
1460 PRINTMESG(mesg)
1461 str.extract(0, str.length(), result, "UTF-8");
1462 sprintf(mesg, "interval date: %s\n", result);
1463 PRINTMESG(mesg)
1464#endif
1465 delete dtitvfmt;
1466 }
1467
1468 // test user created DateIntervalInfo
1469 ec = U_ZERO_ERROR;
1470 DateIntervalInfo* dtitvinf = new DateIntervalInfo(ec);
1471 dtitvinf->setFallbackIntervalPattern("{0} --- {1}", ec);
1472 dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_MONTH, "yyyy MMM d - MMM y",ec);
1473 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return;
1474 dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_HOUR_OF_DAY, "yyyy MMM d HH:mm - HH:mm", ec);
1475 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return;
1476 DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_ABBR_MONTH_DAY, loc, *dtitvinf, ec);
1477 delete dtitvinf;
1478 if (!assertSuccess("createInstance(skeleton,dtitvinf)", ec)) return;
f3c0d7a5 1479 FieldPosition pos(FieldPosition::DONT_CARE);
46f4442e
A
1480 dtitvfmt->format(&dtitv, str.remove(), pos, ec);
1481 if ( uprv_strcmp(locName, "th") ) {
1482 if (!assertSuccess("format", ec)) return;
1483#ifdef DTIFMTTS_DEBUG
1484 PRINTMESG("interval format using user defined DateIntervalInfo\n");
1485 str.extract(0, str.length(), result, "UTF-8");
1486 sprintf(mesg, "interval date: %s\n", result);
1487 PRINTMESG(mesg)
1488#endif
1489 } else {
f3c0d7a5 1490 // for "th", the default calendar is Budhist,
46f4442e
A
1491 // not Gregorian.
1492 assertTrue("Default calendar for \"th\" is Budhist", ec == U_ILLEGAL_ARGUMENT_ERROR);
1493 ec = U_ZERO_ERROR;
1494 }
1495 delete dtitvfmt;
1496 }
1497}
1498
b331163b
A
1499void DateIntervalFormatTest::testTicket11583_2() {
1500 UErrorCode status = U_ZERO_ERROR;
1501 LocalPointer<DateIntervalFormat> fmt(
1502 DateIntervalFormat::createInstance("yMMM", "es-US", status));
1503 if (!assertSuccess("Error create format object", status)) {
1504 return;
1505 }
1506 DateInterval interval((UDate) 1232364615000.0, (UDate) 1328787015000.0);
1507 UnicodeString appendTo;
1508 FieldPosition fpos(FieldPosition::DONT_CARE);
f3c0d7a5 1509 UnicodeString expected("ene. 2009\\u2009\\u2013\\u2009feb. 2012");
b331163b
A
1510 assertEquals(
1511 "",
1512 expected.unescape(),
1513 fmt->format(&interval, appendTo, fpos, status));
1514 if (!assertSuccess("Error formatting", status)) {
1515 return;
1516 }
1517}
1518
2ca993e8
A
1519
1520void DateIntervalFormatTest::testTicket11985() {
1521 UErrorCode status = U_ZERO_ERROR;
1522 LocalPointer<DateIntervalFormat> fmt(
1523 DateIntervalFormat::createInstance(UDAT_HOUR_MINUTE, Locale::getEnglish(), status));
1524 if (!assertSuccess("createInstance", status)) {
1525 return;
1526 }
1527 UnicodeString pattern;
1528 static_cast<const SimpleDateFormat*>(fmt->getDateFormat())->toPattern(pattern);
1529 assertEquals("Format pattern", "h:mm a", pattern);
1530}
1531
f3c0d7a5 1532// Ticket 11669 - thread safety of DateIntervalFormat::format(). This test failed before
2ca993e8
A
1533// the implementation was fixed.
1534
1535static const DateIntervalFormat *gIntervalFormatter = NULL; // The Formatter to be used concurrently by test threads.
1536static const DateInterval *gInterval = NULL; // The date interval to be formatted concurrently.
1537static const UnicodeString *gExpectedResult = NULL;
1538
1539void DateIntervalFormatTest::threadFunc11669(int32_t threadNum) {
1540 (void)threadNum;
1541 for (int loop=0; loop<1000; ++loop) {
1542 UErrorCode status = U_ZERO_ERROR;
f3c0d7a5 1543 FieldPosition pos(FieldPosition::DONT_CARE);
2ca993e8
A
1544 UnicodeString result;
1545 gIntervalFormatter->format(gInterval, result, pos, status);
1546 if (U_FAILURE(status)) {
1547 errln("%s:%d %s", __FILE__, __LINE__, u_errorName(status));
1548 return;
1549 }
1550 if (result != *gExpectedResult) {
1551 errln("%s:%d Expected \"%s\", got \"%s\"", __FILE__, __LINE__, CStr(*gExpectedResult)(), CStr(result)());
1552 return;
1553 }
1554 }
1555}
f3c0d7a5 1556
2ca993e8
A
1557void DateIntervalFormatTest::testTicket11669() {
1558 UErrorCode status = U_ZERO_ERROR;
1559 LocalPointer<DateIntervalFormat> formatter(DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, Locale::getEnglish(), status), status);
1560 LocalPointer<TimeZone> tz(TimeZone::createTimeZone("America/Los_Angleles"), status);
1561 LocalPointer<Calendar> intervalStart(Calendar::createInstance(*tz, Locale::getEnglish(), status), status);
1562 LocalPointer<Calendar> intervalEnd(Calendar::createInstance(*tz, Locale::getEnglish(), status), status);
1563 if (U_FAILURE(status)) {
1564 errcheckln(status, "%s:%d %s", __FILE__, __LINE__, u_errorName(status));
1565 return;
1566 }
1567
1568 intervalStart->set(2009, 6, 1, 14, 0);
1569 intervalEnd->set(2009, 6, 2, 14, 0);
1570 DateInterval interval(intervalStart->getTime(status), intervalEnd->getTime(status));
f3c0d7a5 1571 FieldPosition pos(FieldPosition::DONT_CARE);
2ca993e8
A
1572 UnicodeString expectedResult;
1573 formatter->format(&interval, expectedResult, pos, status);
1574 if (U_FAILURE(status)) {
1575 errln("%s:%d %s", __FILE__, __LINE__, u_errorName(status));
1576 return;
1577 }
1578
1579 gInterval = &interval;
1580 gIntervalFormatter = formatter.getAlias();
1581 gExpectedResult = &expectedResult;
1582
1583 ThreadPool<DateIntervalFormatTest> threads(this, 4, &DateIntervalFormatTest::threadFunc11669);
1584 threads.start();
1585 threads.join();
1586
1587 gInterval = NULL; // Don't leave dangling pointers lying around. Not strictly necessary.
1588 gIntervalFormatter = NULL;
1589 gExpectedResult = NULL;
1590}
1591
1592
f3c0d7a5
A
1593// testTicket12065
1594// Using a DateIntervalFormat to format shouldn't change its state in any way
1595// that changes how the behavior of operator ==.
1596void DateIntervalFormatTest::testTicket12065() {
1597 UErrorCode status = U_ZERO_ERROR;
1598 LocalPointer<DateIntervalFormat> formatter(DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, Locale::getEnglish(), status), status);
1599 if (formatter.isNull()) {
1600 dataerrln("FAIL: DateIntervalFormat::createInstance failed for Locale::getEnglish()");
1601 return;
1602 }
1603 LocalPointer<DateIntervalFormat> clone(dynamic_cast<DateIntervalFormat *>(formatter->clone()));
1604 if (*formatter != *clone) {
1605 errln("%s:%d DateIntervalFormat and clone are not equal.", __FILE__, __LINE__);
1606 return;
1607 }
1608 DateInterval interval((UDate) 1232364615000.0, (UDate) 1328787015000.0);
1609 UnicodeString appendTo;
1610 FieldPosition fpos(FieldPosition::DONT_CARE);
1611 formatter->format(&interval, appendTo, fpos, status);
1612 if (*formatter != *clone) {
1613 errln("%s:%d DateIntervalFormat and clone are not equal after formatting.", __FILE__, __LINE__);
1614 return;
1615 }
1616 if (U_FAILURE(status)) {
1617 errln("%s:%d %s", __FILE__, __LINE__, u_errorName(status));
1618 }
1619}
1620
1621
46f4442e 1622#endif /* #if !UCONFIG_NO_FORMATTING */