OLD | NEW |
| (Empty) |
1 //***************************************************************************** | |
2 // | |
3 // Copyright (C) 2004-2006, International Business Machines | |
4 // Corporation and others. All Rights Reserved. | |
5 // | |
6 // file name: icuio.txt | |
7 // encoding: US-ASCII | |
8 // tab size: 4 (not used) | |
9 // indentation:4 | |
10 // | |
11 // created on: 2004Apr06 | |
12 // created by: George Rhoten | |
13 // | |
14 // ICU resource bundle source file with test data for data-driven ICU I/O tests
. | |
15 // | |
16 //***************************************************************************** | |
17 | |
18 icuio:table(nofallback) { | |
19 Info { | |
20 Description { "Test data for ICU I/O" } | |
21 LongDescription { | |
22 "Test data for data-driven conversion tests in icu/source/test/iotes
t/iotest.cpp\n" | |
23 "Run iotest printf\n" | |
24 | |
25 "argumentType:\n" | |
26 "\td: double\n" | |
27 "\tf: float\n" | |
28 "\t1: int8_t (hexadecimal)\n" | |
29 "\t2: int16_t (hexadecimal)\n" | |
30 "\t4: int32_t (hexadecimal)\n" | |
31 "\t8: int64_t (hexadecimal)\n" | |
32 "\ts: char * string\n" | |
33 "\tS: UChar * string\n" | |
34 } | |
35 } | |
36 TestData { | |
37 printf { | |
38 Headers { "format", "result", "argumentType", "argument" } | |
39 Cases { | |
40 { "%5.3S", " abc", "S", "abcde" } | |
41 { "%-5.3S", "abc ", "S", "abcde" } | |
42 { "%5.3S", " abc", "S", "abcdef" } | |
43 { "%-5.3S", "abc ", "S", "abcdef" } | |
44 { "%5.3S", " a", "S", "a" } | |
45 { "%-5.3S", "a ", "S", "a" } | |
46 { "%5.3s", " abc", "s", "abcde" } | |
47 { "%-5.3s", "abc ", "s", "abcde" } | |
48 { "%5.3s", " abc", "s", "abcdef" } | |
49 { "%-5.3s", "abc ", "s", "abcdef" } | |
50 { "%5.3s", " a", "s", "a" } | |
51 { "%-5.3s", "a ", "s", "a" } | |
52 { "%5.3C", " a", "2", "61" } | |
53 { "%-5.3C", "a ", "2", "61" } | |
54 { "%-5.0C", "a ", "2", "61" } // Make sure that the precision
is ignored. | |
55 { "%.3P", "120.000%", "d", "1.2" } | |
56 { "%.0P", "120%", "d", "1.2" } | |
57 { "%.3P", "1.200%", "d", "0.012" } | |
58 { "%.0P", "1%", "d", "0.012" } | |
59 { "%04.0P", "001%", "d", "0.012" } | |
60 { "%+4.0P", " +1%", "d", "0.012" } | |
61 { "%e", "1.200000e+000", "d", "1.2" } | |
62 { "%e", "1.234568e+006", "d", "1234567.89" } | |
63 { "%E", "1.234568E+006", "d", "1234567.89" } | |
64 { "%10e", "1.234568e+000", "d", "1.23456789" } | |
65 { "%10.4e", "1.2346e+000", "d", "1.23456789" } | |
66 { "%-10e", "1.234568e+000", "d", "1.23456789" } | |
67 { "%10e", "1.234568e+002", "d", "123.456789" } | |
68 { "%-10e", "1.234568e+002", "d", "123.456789" } | |
69 { "%-+12.1e", "+1.2e+000 ", "d", "1.234" } | |
70 { "%-+12.1e", "-1.2e+000 ", "d", "-1.234" } | |
71 { "%- 12.10e", " 1.2340000000e+000", "d", "1.234" } | |
72 { "%- 12.1e", "-1.2e+000 ", "d", "-1.234" } | |
73 { "%+12.1e", " +1.2e+000", "d", "1.234" } | |
74 { "%+12.1e", " -1.2e+000", "d", "-1.234" } | |
75 { "% 12.1e", " 1.2e+000", "d", "1.234" } | |
76 { "% 12.1e", " -1.2e+000", "d", "-1.234" } | |
77 { "%12.1e", " 1.2e+000", "d", "1.234" } | |
78 { "%12.1e", " -1.2e+000", "d", "-1.234" } | |
79 { "%.2e", "1.23e+000", "d", "1.234" } | |
80 { "%.2e", "-1.23e+000", "d", "-1.234" } | |
81 { "%3e", "1.234000e+000", "d", "1.234" } | |
82 { "%3e", "-1.234000e+000", "d", "-1.234" } | |
83 { "%g", "12345.7", "d", "12345.6789" } | |
84 { "%g", "123457", "d", "123456.789" } | |
85 { "%g", "1.23457e+006", "d", "1234567.89" } | |
86 { "%G", "12345.7", "d", "12345.6789" } | |
87 { "%G", "123457", "d", "123456.789" } | |
88 { "%G", "1.23457E+006", "d", "1234567.89" } | |
89 { "%.14G", "1.7E+064", "d", "1.7E+64" } | |
90 { "%.0f", "-12", "d", "-12.34" } | |
91 { "%.0e", "-1e+001", "d", "-12.34" } | |
92 { "%.0g", "-1e+001", "d", "-12.34" } | |
93 { "%hd", "-30002", "2", "8ace" } | |
94 { "%hu", "35534", "2", "8ace" } | |
95 { "%ho", "105316", "2", "8ace" } | |
96 { "%hx", "8ace", "2", "8ace" } | |
97 { "%lx", "8ace1234", "4", "8ace1234" } | |
98 { "%llx", "123456789abcdef0", "8", "123456789abcdef0" } | |
99 { "%lu", "2328760884", "4", "8ace1234" } | |
100 // %llu doesn't work yet. | |
101 { "%ld", "-1966206412", "4", "8ace1234" } | |
102 { "%lld", "1311768467463790320", "8", "123456789abcdef0" } | |
103 { "%+u", "2328760884", "4", "8ace1234" } // Ignore the + sign ar
gument | |
104 } | |
105 } | |
106 printfPrecision { | |
107 Headers { "format", "result", "argumentType", "argument", "precision
" } | |
108 Cases { | |
109 { "%+1.*e", "+1.2346e+000", "d", "1.2345678", :int{4} } | |
110 { "%+2.*e", "+1.234568e+000", "d", "1.2345678", :int{6} } | |
111 { "%*d", "12345678", "4", "BC614E", :int{7} } | |
112 { "%*d", "12345678", "4", "BC614E", :int{8} } | |
113 { "%*d", " 12345678", "4", "BC614E", :int{9} } | |
114 { "%*d", "12345678 ", "4", "BC614E", :int{-9} } | |
115 { "%*d", "1", "4", "1", :int{-1} } | |
116 { "%*d", "1 ", "4", "1", :int{-2} } | |
117 } | |
118 } | |
119 scanf { | |
120 Headers { "format", "argument", "argumentType", "result" } | |
121 Cases { | |
122 { "%e", "1.200000e+000", "f", "1.2" } | |
123 { "%*e%e", "1.200000e+000 4.825000e+000", "f", "4.825" } | |
124 { "%C", "1234", "2", "31" } | |
125 { "%*C%C", "1234", "2", "32" } | |
126 { "%S", "1234 5678", "S", "1234" } | |
127 { "%*S%S", "1234 5678", "S", "5678" } | |
128 { "%hd", "1234 5678", "2", "4D2" } | |
129 { "%*hd%hd", "1234 5678", "2", "162E" } | |
130 { "%d", "1234 5678", "4", "4D2" } | |
131 { "%ld", "1234 5678", "4", "4D2" } | |
132 { "%lld", "1311768467463790320", "8", "123456789abcdef0" } | |
133 { "%3d", "1234 5678", "4", "7B" } | |
134 { "%4d", "123", "4", "7B" } | |
135 { "%2d", "123", "4", "C" } | |
136 { "%40d", "123", "4", "7B" } | |
137 { "%2e", "1.25", "f", "1" } | |
138 { "%2f", "1.25", "f", "1" } | |
139 { "%2g", "1.25", "f", "1" } | |
140 { "%2le", "1.25", "d", "1" } | |
141 { "%2lf", "1.25", "d", "1" } | |
142 { "%2lg", "1.25", "d", "1" } | |
143 { "%*2e%2e", "1.25", "f", "25" } | |
144 { "%*2f%2f", "1.25", "f", "25" } | |
145 { "%*2g%2g", "1.25", "f", "25" } | |
146 { "%*d%d", "1234 5678", "4", "162E" } | |
147 { "%x", "abcd ef01", "4", "abcd" } | |
148 { "%3x", "abcd ef01", "4", "abc" } | |
149 { "%*hx%hx", "abcd ef01", "2", "ef01" } | |
150 { "%ho", "1046539", "2", "89AB" } // Extra 9 on the end | |
151 { "%3ho", "7700", "2", "1F8" } // Don't read the 0 at the end | |
152 { "%llo", "1777777777777777777777", "8", "FFFFFFFFFFFFFFFF" } | |
153 { "%lx", "abcdef01", "4", "abcdef01" } | |
154 { "%x", "0x7abcdef0", "4", "7abcdef0" } | |
155 { "%llx", "123456789abcdef0", "8", "123456789abcdef0" } | |
156 { "%S", "a\U00010000b", "S", "a\U00010000b" } | |
157 { "%[abce]", "abcd ef01", "S", "abc" } | |
158 { "%*[abce]%[de\\ ]", "abcd ef01", "S", "d e" } | |
159 { "%[a\U00010000]", "a\U00010000\U00010001b", "S", "a\U00010000"
} | |
160 { "%[a-f]", "abccdefg", "S", "abccdef" } | |
161 { "%[a-c]", "abccdefg", "S", "abcc" } | |
162 { "%[^e-f]", "abccdefg", "S", "abccd" } | |
163 { "%3[^e-f]", "abccdefg", "S", "abc" } | |
164 { "%*3[abc]%[cde]", "abccdefg", "S", "cde" } | |
165 { "%*3S%S", "a bc efg", "S", "bc" } | |
166 { "%*3S%S", "abcd efg", "S", "d" } | |
167 { "%*3s%s", "abcd efg", "s", "d" } | |
168 { "%*3d%d", "1234", "4", "4" } | |
169 { "%d", " 1234", "4", "4D2" } | |
170 { "%e", " 1234", "f", "1234" } | |
171 { "%f", " 1234", "f", "1234" } | |
172 { "%d", "+1234", "4", "4D2" } | |
173 { "%e", "+1234", "f", "1234" } | |
174 { "%f", "+1234", "f", "1234" } | |
175 } | |
176 } | |
177 } | |
178 } | |
OLD | NEW |