Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: source/test/intltest/dtifmtts.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/test/intltest/dtifmtts.h ('k') | source/test/intltest/dtptngts.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /******************************************************************** 2 /********************************************************************
3 * COPYRIGHT: 3 * COPYRIGHT:
4 * Copyright (c) 1997-2014, International Business Machines Corporation and 4 * Copyright (c) 1997-2015, 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 12
13 //TODO: define it in compiler flag 13 //TODO: define it in compiler flag
14 //#define DTIFMTTS_DEBUG 1 14 //#define DTIFMTTS_DEBUG 1
(...skipping 27 matching lines...) Expand all
42 42
43 void DateIntervalFormatTest::runIndexedTest( int32_t index, UBool exec, const ch ar* &name, char* /*par*/ ) { 43 void DateIntervalFormatTest::runIndexedTest( int32_t index, UBool exec, const ch ar* &name, char* /*par*/ ) {
44 if (exec) logln("TestSuite DateIntervalFormat"); 44 if (exec) logln("TestSuite DateIntervalFormat");
45 switch (index) { 45 switch (index) {
46 TESTCASE(0, testAPI); 46 TESTCASE(0, testAPI);
47 TESTCASE(1, testFormat); 47 TESTCASE(1, testFormat);
48 TESTCASE(2, testFormatUserDII); 48 TESTCASE(2, testFormatUserDII);
49 TESTCASE(3, testSetIntervalPatternNoSideEffect); 49 TESTCASE(3, testSetIntervalPatternNoSideEffect);
50 TESTCASE(4, testYearFormats); 50 TESTCASE(4, testYearFormats);
51 TESTCASE(5, testStress); 51 TESTCASE(5, testStress);
52 TESTCASE(6, testTicket11583_2);
52 default: name = ""; break; 53 default: name = ""; break;
53 } 54 }
54 } 55 }
55 56
56 /** 57 /**
57 * Test various generic API methods of DateIntervalFormat for API coverage. 58 * Test various generic API methods of DateIntervalFormat for API coverage.
58 */ 59 */
59 void DateIntervalFormatTest::testAPI() { 60 void DateIntervalFormatTest::testAPI() {
60 61
61 /* ====== Test create interval instance with default locale and skeleton 62 /* ====== Test create interval instance with default locale and skeleton
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 return; 159 return;
159 } 160 }
160 FieldPosition pos = 0; 161 FieldPosition pos = 0;
161 fromTime->set(2013, 3, 26); 162 fromTime->set(2013, 3, 26);
162 toTime->set(2013, 3, 28); 163 toTime->set(2013, 3, 28);
163 dif->format(*fromTime, *toTime, expected, pos, status); 164 dif->format(*fromTime, *toTime, expected, pos, status);
164 if (U_FAILURE(status)) { 165 if (U_FAILURE(status)) {
165 errln("Failure encountered: %s", u_errorName(status)); 166 errln("Failure encountered: %s", u_errorName(status));
166 return; 167 return;
167 } 168 }
168 LocalPointer<DateIntervalInfo> dii(new DateIntervalInfo(Locale::getEngli sh(), status)); 169 LocalPointer<DateIntervalInfo> dii(new DateIntervalInfo(Locale::getEngli sh(), status), status);
169 if (U_FAILURE(status)) { 170 if (U_FAILURE(status)) {
170 errln("Failure encountered: %s", u_errorName(status)); 171 errln("Failure encountered: %s", u_errorName(status));
171 return; 172 return;
172 } 173 }
173 dii->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d"), status); 174 dii->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d"), status);
174 dif->setDateIntervalInfo(*dii, status); 175 dif->setDateIntervalInfo(*dii, status);
175 if (U_FAILURE(status)) { 176 if (U_FAILURE(status)) {
176 errln("Failure encountered: %s", u_errorName(status)); 177 errln("Failure encountered: %s", u_errorName(status));
177 return; 178 return;
178 } 179 }
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 815
815 "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "2007\ \u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f32008\\u5e7410\\u670810\\u65e 5\\u661f\\u671f\\u4e94", 816 "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "2007\ \u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f32008\\u5e7410\\u670810\\u65e 5\\u661f\\u671f\\u4e94",
816 817
817 818
818 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "2007\\u5e 7410\\u670810\\u65e5\\u81f311\\u670810\\u65e5", 819 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "2007\\u5e 7410\\u670810\\u65e5\\u81f311\\u670810\\u65e5",
819 820
820 821
821 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "2007\\u5e7 410\\u6708\\u81f311\\u6708", 822 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "2007\\u5e7 410\\u6708\\u81f311\\u6708",
822 823
823 824
824 "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 \\u2013 2007/11/10 \\u6D1B \\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:10", 825 "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 \\u2013 2007/11/10 \\u6D1 B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10",
825 826
826 "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\\u4e 8c", 827 "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\\u4e 8c",
827 828
828 829
829 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "11\\u67081 0\\u65e5\\u81f320\\u65e5", 830 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "11\\u67081 0\\u65e5\\u81f320\\u65e5",
830 831
831 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMMy", "2007\\u5E7 411\\u6708", // (fixed expected result per ticket:6626:) 832 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMMy", "2007\\u5E7 411\\u6708", // (fixed expected result per ticket:6626:)
832 833
833 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "11\\u6 70810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c", 834 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "11\\u6 70810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c",
834 835
835 836
836 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "2007/11/10\ \u5468\\u516d\\u81f32007/11/20\\u5468\\u4e8c", 837 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "2007/11/10\ \u5468\\u516d\\u81f32007/11/20\\u5468\\u4e8c",
837 838
838 839
839 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20", 840 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20",
840 841
841 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007\\u5E7411 \\u6708", 842 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007\\u5E7411 \\u6708",
842 843
843 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "11/10\\u5468 \\u516d\\u81f311/20\\u5468\\u4e8c", 844 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "11/10\\u5468 \\u516d\\u81f311/20\\u5468\\u4e8c",
844 845
845 846
846 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007\\u5E74", // (fixed expected result per ticket:6626:) 847 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007\\u5E74", // (fixed expected result per ticket:6626:)
847 848
848 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11\\u6708", 849 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11\\u6708",
849 850
850 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "11\\u6708", // (fixed expected result per ticket:6626: and others) 851 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "11\\u6708", // (fixed expected result per ticket:6626: and others)
851 852
852 853
853 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "2007/11/10 G MT-8\\u4e0a\\u534810:10 \\u2013 2007/11/20 GMT-8\\u4e0a\\u534810:10", 854 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "2007/11/10 G MT-8 \\u4e0a\\u534810:10 \\u2013 2007/11/20 GMT-8 \\u4e0a\\u534810:10",
854 855
855 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "2007/11/10 \\u 4e0a\\u534810\\u65f6 \\u2013 2007/11/20 \\u4e0a\\u534810\\u65f6", 856 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "2007/11/10 \\u 4e0a\\u534810\\u65f6 \\u2013 2007/11/20 \\u4e0a\\u534810\\u65f6",
856 857
857 "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 tic ket:6626:) 858 "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 tic ket:6626:)
858 859
859 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "\\u4e0a\\u534 810:00\\u81f3\\u4e0b\\u53482:10", 860 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "\\u4e0a\\u534 810:00\\u81f3\\u4e0b\\u53482:10",
860 861
861 862
862 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "GMT-8\\u4e0a \\u534810:00\\u81f3\\u4e0b\\u53482:10", 863 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "GMT-8\\u4e0a \\u534810:00\\u81f3\\u4e0b\\u53482:10",
863 864
864 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "\\u4e0a\\u5348 10\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6", 865 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "\\u4e0a\\u5348 10\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6",
865 866
866 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "\\u6D1B\\u674 9\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810\\u65F6\\u81F3\\u4E0B\\u53482\\u65F6", 867 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "\\u6D1B\\u674 9\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810\\u65F6\\u81F3\\u4E0B\\u53482\\u65F6",
867 868
868 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "\\u4e0a\\u534 810:00\\u81f310:20", 869 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "\\u4e0a\\u534 810:00\\u81f310:20",
869 870
870 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "\\u6D1B\\u67 49\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:00\\u81F310:20", 871 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "\\u6D1B\\u67 49\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:00\\u81F310:20",
871 872
872 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "GMT-8\\u4e0a\ \u534810\\u65f6", 873 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "GMT-8\\u4e0a\ \u534810\\u65f6",
873 874
874 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "\\u4e0a\\u534 810:10", 875 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "\\u4e0a\\u534 810:10",
875 876
876 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "\\u4e0a\\u5348 10\\u65f6", 877 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "\\u4e0a\\u5348 10\\u65f6",
877 878
878 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMy", "Mittwo ch, 10. Okt. 2007 - Freitag, 10. Okt. 2008", 879 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMy", "Mittwo ch, 10. Okt. 2007 \\u2013 Freitag, 10. Okt. 2008",
879 880
880 881
881 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "10. Okt. 20 07 - 10. Okt. 2008", 882 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "10. Okt. 20 07 \\u2013 10. Okt. 2008",
882 883
883 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Okt. 2007 - Okt. 2008", 884 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Okt. 2007 \ \u2013 Okt. 2008",
884 885
885 886
886 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Mi., 10.10. 2007 - Fr., 10.10.2008", 887 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Mi., 10.10. 2007 \\u2013 Fr., 10.10.2008",
887 888
888 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10.10.2007 - 10.10.2008", 889 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10.10.2007 \ \u2013 10.10.2008",
889 890
890 891
891 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10.2007 - 10. 2008", 892 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10.2007 \\u20 13 10.2008",
892 893
893 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Mi., 10.10.2 007 - Fr., 10.10.2008", 894 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Mi., 10.10.2 007 \\u2013 Fr., 10.10.2008",
894 895
895 896
896 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007-2008", 897 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007\\u2013200 8",
897 898
898 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10.2007 - 10.2 008", 899 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10.2007 \\u201 3 10.2008",
899 900
900 901
901 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007, 1 0:10 vorm. - 10.10.2008, 10:10 vorm.", 902 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007, 1 0:10 vorm. \\u2013 10.10.2008, 10:10 vorm.",
902 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Hm", "10.10.2007, 1 0:10 - 10.10.2008, 10:10", 903 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Hm", "10.10.2007, 1 0:10 \\u2013 10.10.2008, 10:10",
903 904
904 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMy", "Mittwo ch, 10. Okt. - Samstag, 10. Nov. 2007", 905 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMy", "Mittwo ch, 10. Okt. \\u2013 Samstag, 10. Nov. 2007",
905 906
906 907
907 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "10. Okt. - 10. Nov.", 908 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "10. Okt. \\ u2013 10. Nov.",
908 909
909 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Okt.-Nov. 2 007", 910 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Okt.\\u2013 Nov. 2007",
910 911
911 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMM", "Mittwoc h, 10. Okt. - Samstag, 10. Nov.", 912 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMM", "Mittwoc h, 10. Okt. \\u2013 Samstag, 10. Nov.",
912 913
913 914
914 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10.10. - 10.1 1.", 915 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10.10. \\u201 3 10.11.",
915 916
916 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10.2007 - 11. 2007", 917 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10.2007 \\u20 13 11.2007",
917 918
918 919
919 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10.10. - 10.11 .", 920 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10.10. \\u2013 10.11.",
920 921
921 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007", 922 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007",
922 923
923 924
924 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Okt.-Nov.", 925 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Okt.\\u2013N ov.",
925 926
926 927
927 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007, 10:10:10 vorm. - 10.11.2007, 10:10:10 vorm.", 928 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007, 10:10:10 vorm. \\u2013 10.11.2007, 10:10:10 vorm.",
928 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Hms", "10.10.2007, 10:10:10 - 10.11.2007, 10:10:10", 929 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Hms", "10.10.2007, 10:10:10 \\u2013 10.11.2007, 10:10:10",
929 930
930 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMy", "Samsta g, 10. - Dienstag, 20. Nov. 2007", 931 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMy", "Samsta g, 10. \\u2013 Dienstag, 20. Nov. 2007",
931 932
932 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "10.-20. No v. 2007", 933 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "10.\\u2013 20. Nov. 2007",
933 934
934 935
935 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov. 2007", 936 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov. 2007",
936 937
937 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMM", "Samstag , 10. - Dienstag, 20. Nov.", 938 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMM", "Samstag , 10. \\u2013 Dienstag, 20. Nov.",
938 939
939 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sa., 10.11. 2007 - Di., 20.11.2007", 940 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sa., 10.11. 2007 \\u2013 Di., 20.11.2007",
940 941
941 942
942 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "10.11. - 20.1 1.", 943 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "10.11. \\u201 3 20.11.",
943 944
944 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11.2007", 945 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11.2007",
945 946
946 947
947 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10.-20.", 948 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10.\\u201320." ,
948 949
949 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007", 950 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007",
950 951
951 952
952 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007, 10:10 vorm. Los Angeles Zeit - 20.11.2007, 10:10 vorm. Los Angeles Zeit", 953 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007, 10:10 vorm. Los Angeles Zeit \\u2013 20.11.2007, 10:10 vorm. Los Angeles Zeit",
953 954
954 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMy", "Mittwo ch, 10. Jan. 2007", 955 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMy", "Mittwo ch, 10. Jan. 2007",
955 956
956 957
957 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "10. Jan.", 958 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "10. Jan.",
958 959
959 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan. 2007", 960 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan. 2007",
960 961
961 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMM", "Mittwoc h, 10. Jan.", 962 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMM", "Mittwoc h, 10. Jan.",
962 963
963 964
964 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 vorm. - 2 n achm.", 965 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 vorm. \\u20 13 2 nachm.",
965 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "H", "10-14 Uhr", 966 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "H", "10\\u201314 Uh r",
966 967
967 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMM", "Mittwoc h, 10. Jan.", 968 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMM", "Mittwoc h, 10. Jan.",
968 969
969 970
970 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00-10:20 vorm. Los Angeles Zeit", 971 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00\\u2013 10:20 vorm. Los Angeles Zeit",
971 972
972 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00-10:20 vorm. GMT-8", 973 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00\\u2013 10:20 vorm. GMT-8",
973 974
974 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 vorm.", 975 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 vorm.",
975 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "H", "10 Uhr", 976 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "H", "10 Uhr",
976 977
977 978
978 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 vorm. GMT- 8", 979 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 vorm. GMT- 8",
979 980
980 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMy", "Mittwo ch, 10. Jan. 2007", 981 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMy", "Mittwo ch, 10. Jan. 2007",
981 982
982 983
983 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 vorm. Los Angeles Zeit", 984 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 vorm. Los Angeles Zeit",
984 985
985 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 vorm. GMT-8", 986 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 vorm. GMT-8",
986 987
987 988
988 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 vorm. Los Angeles Zeit", 989 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 vorm. Los Angeles Zeit",
989 990
990 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 vorm. GMT- 8", 991 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 vorm. GMT- 8",
991 992
992 // Thai (default calendar buddhist) 993 // Thai (default calendar buddhist)
993 994
994 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E2 7\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18 10 \\u0E15.\\u0E04. 2550 - \\u0E27\\u0E31\\ u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C 10 \\u0E15.\\u0E04. 2551", 995 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E2 7\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 25 50 \\u2013 \\u0E27\\u0E31\\u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C\\u0E17\\u0E3 5\\u0E48 10 \\u0E15.\\u0E04. 2551",
995 996
996 997
997 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMMM", "10 \\u0E15. \\u0E04. 2550 - 10 \\u0E15.\\u0E04. 2551", 998 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMMM", "10 \\u0E15. \\u0E04. 2550 \\u2013 10 \\u0E15.\\u0E04. 2551",
998 999
999 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u 0E04. 2550 - \\u0E15.\\u0E04. 2551", 1000 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u 0E04. 2550 \\u2013 \\u0E15.\\u0E04. 2551",
1000 1001
1001 1002
1002 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10 /10/2550 - \\u0E28. 10/10/2551", 1003 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10 /10/2550 \\u2013 \\u0E28. 10/10/2551",
1003 1004
1004 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMy", "10/10/2550 - 10/10/2551", 1005 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMy", "10/10/2550 \ \u2013 10/10/2551",
1005 1006
1006 1007
1007 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "My", "10/2550 - 10/ 2551", 1008 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "My", "10/2550 \\u20 13 10/2551",
1008 1009
1009 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/ 10/2550 - \\u0E28. 10/10/2551", 1010 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/ 10/2550 \\u2013 \\u0E28. 10/10/2551",
1010 1011
1011 1012
1012 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "y", "2550-2551", 1013 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "y", "2550\\u2013255 1",
1013 1014
1014 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "M", "10/2550 - 10/2 551", 1015 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "M", "10/2550 \\u201 3 10/2551",
1015 1016
1016 1017
1017 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E2 7\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18 10 \\u0E15.\\u0E04. - \\u0E27\\u0E31\\u0E19 \\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C 10 \\u0E1E.\\u0E22. 2550", 1018 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E2 7\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. \\ u2013 \\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0 E48 10 \\u0E1E.\\u0E22. 2550",
1018 1019
1019 1020
1020 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dMMM", "10 \\u0E15. \\u0E04. - 10 \\u0E1E.\\u0E22.", 1021 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dMMM", "10 \\u0E15. \\u0E04. \\u2013 10 \\u0E1E.\\u0E22.",
1021 1022
1022 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u 0E04.-\\u0E1E.\\u0E22. 2550", 1023 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u 0E04.\\u2013\\u0E1E.\\u0E22. 2550",
1023 1024
1024 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 - 10/11" , 1025 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 \\u2013 10/11",
1025 1026
1026 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "My", "10/2550 - 11/ 2550", 1027 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "My", "10/2550 \\u20 13 11/2550",
1027 1028
1028 1029
1029 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "d", "10/10 - 10/11" , 1030 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "d", "10/10 \\u2013 10/11",
1030 1031
1031 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "\\u0E1E.\\u0E2 8. 2550", 1032 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "\\u0E1E.\\u0E2 8. 2550",
1032 1033
1033 1034
1034 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0 E04.-\\u0E1E.\\u0E22.", 1035 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0 E04.\\u2013\\u0E1E.\\u0E22.",
1035 1036
1036 }; 1037 };
1037 expect(DATA, ARRAY_SIZE(DATA)); 1038 expect(DATA, ARRAY_SIZE(DATA));
1038 } 1039 }
1039 1040
1040 1041
1041 void DateIntervalFormatTest::expect(const char** data, int32_t data_length) { 1042 void DateIntervalFormatTest::expect(const char** data, int32_t data_length) {
1042 int32_t i = 0; 1043 int32_t i = 0;
1043 UErrorCode ec = U_ZERO_ERROR; 1044 UErrorCode ec = U_ZERO_ERROR;
1044 UnicodeString str, str2; 1045 UnicodeString str, str2;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10. Okt. 2007 --- 1 0. Okt. 2008", 1136 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10. Okt. 2007 --- 1 0. Okt. 2008",
1136 1137
1137 1138
1138 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10. Nov. 2007 --- 2 0. Nov. 2007", 1139 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10. Nov. 2007 --- 2 0. Nov. 2007",
1139 1140
1140 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10. Jan. 2007", 1141 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10. Jan. 2007",
1141 1142
1142 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10. Jan. 2007", 1143 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10. Jan. 2007",
1143 1144
1144 1145
1145 "es", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10 de oct. de 2007 --- 10 de oct. de 2008", 1146 "es", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10 oct. 2007 --- 10 oct. 2008",
1146 1147
1147 "es", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 oct. 10 - nov. 2007", 1148 "es", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 oct. 10 - nov. 2007",
1148 1149
1149 "es", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10 de nov. de 2007 --- 20 de nov. de 2007", 1150 "es", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10 nov. 2007 --- 20 nov. 2007",
1150 1151
1151 "es", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10 de ene. de 2007" , 1152 "es", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10 ene. 2007",
1152 1153
1153 "es", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10 de ene. de 2007" , 1154 "es", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10 ene. 2007",
1154 1155
1155 "es", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10 de ene. de 2007" , 1156 "es", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10 ene. 2007",
1156 }; 1157 };
1157 expectUserDII(DATA, ARRAY_SIZE(DATA)); 1158 expectUserDII(DATA, ARRAY_SIZE(DATA));
1158 } 1159 }
1159 1160
1160 1161
1161 void DateIntervalFormatTest::testSetIntervalPatternNoSideEffect() { 1162 void DateIntervalFormatTest::testSetIntervalPatternNoSideEffect() {
1162 UErrorCode ec = U_ZERO_ERROR; 1163 UErrorCode ec = U_ZERO_ERROR;
1163 LocalPointer<DateIntervalInfo> dtitvinf(new DateIntervalInfo(ec)); 1164 LocalPointer<DateIntervalInfo> dtitvinf(new DateIntervalInfo(ec), ec);
1164 if (U_FAILURE(ec)) { 1165 if (U_FAILURE(ec)) {
1165 errln("Failure encountered: %s", u_errorName(ec)); 1166 errln("Failure encountered: %s", u_errorName(ec));
1166 return; 1167 return;
1167 } 1168 }
1168 UnicodeString expected; 1169 UnicodeString expected;
1169 dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, expected, ec); 1170 dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, expected, ec);
1170 dtitvinf->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d") , ec); 1171 dtitvinf->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d") , ec);
1171 if (U_FAILURE(ec)) { 1172 if (U_FAILURE(ec)) {
1172 errln("Failure encountered: %s", u_errorName(ec)); 1173 errln("Failure encountered: %s", u_errorName(ec));
1173 return; 1174 return;
1174 } 1175 }
1175 dtitvinf.adoptInstead(new DateIntervalInfo(ec)); 1176 dtitvinf.adoptInsteadAndCheckErrorCode(new DateIntervalInfo(ec), ec);
1176 if (U_FAILURE(ec)) { 1177 if (U_FAILURE(ec)) {
1177 errln("Failure encountered: %s", u_errorName(ec)); 1178 errln("Failure encountered: %s", u_errorName(ec));
1178 return; 1179 return;
1179 } 1180 }
1180 UnicodeString actual; 1181 UnicodeString actual;
1181 dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, actual, ec); 1182 dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, actual, ec);
1182 if (U_FAILURE(ec)) { 1183 if (U_FAILURE(ec)) {
1183 errln("Failure encountered: %s", u_errorName(ec)); 1184 errln("Failure encountered: %s", u_errorName(ec));
1184 return; 1185 return;
1185 } 1186 }
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 } else { 1503 } else {
1503 // for "th", the default calendar is Budhist, 1504 // for "th", the default calendar is Budhist,
1504 // not Gregorian. 1505 // not Gregorian.
1505 assertTrue("Default calendar for \"th\" is Budhist", ec == U_ILLEGAL _ARGUMENT_ERROR); 1506 assertTrue("Default calendar for \"th\" is Budhist", ec == U_ILLEGAL _ARGUMENT_ERROR);
1506 ec = U_ZERO_ERROR; 1507 ec = U_ZERO_ERROR;
1507 } 1508 }
1508 delete dtitvfmt; 1509 delete dtitvfmt;
1509 } 1510 }
1510 } 1511 }
1511 1512
1513 void DateIntervalFormatTest::testTicket11583_2() {
1514 UErrorCode status = U_ZERO_ERROR;
1515 LocalPointer<DateIntervalFormat> fmt(
1516 DateIntervalFormat::createInstance("yMMM", "es-US", status));
1517 if (!assertSuccess("Error create format object", status)) {
1518 return;
1519 }
1520 DateInterval interval((UDate) 1232364615000.0, (UDate) 1328787015000.0);
1521 UnicodeString appendTo;
1522 FieldPosition fpos(FieldPosition::DONT_CARE);
1523 UnicodeString expected("ene. de 2009 \\u2013 feb. de 2012");
1524 assertEquals(
1525 "",
1526 expected.unescape(),
1527 fmt->format(&interval, appendTo, fpos, status));
1528 if (!assertSuccess("Error formatting", status)) {
1529 return;
1530 }
1531 }
1532
1512 #endif /* #if !UCONFIG_NO_FORMATTING */ 1533 #endif /* #if !UCONFIG_NO_FORMATTING */
OLDNEW
« no previous file with comments | « source/test/intltest/dtifmtts.h ('k') | source/test/intltest/dtptngts.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698