]>
Commit | Line | Data |
---|---|---|
374ca955 A |
1 | //***************************************************************************** |
2 | // | |
3 | // Copyright (C) 2004, 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 { | |
19 | Info { | |
20 | Description { "Test data for ICU I/O" } | |
21 | LongDescription { | |
22 | "Test data for data-driven conversion tests in icu/source/test/iotest/iotest.cpp\n" | |
23 | "Run iotest printf\n" | |
24 | ||
25 | "argumentType:\n" | |
26 | "\td: double\n" | |
27 | "\t1: int8_t (hexadecimal)\n" | |
28 | "\t2: int16_t (hexadecimal)\n" | |
29 | "\t4: int32_t (hexadecimal)\n" | |
30 | "\t8: int64_t (hexadecimal)\n" | |
31 | "\ts: char * string\n" | |
32 | "\tS: UChar * string\n" | |
33 | } | |
34 | } | |
35 | TestData { | |
36 | printf { | |
37 | Headers { "format", "result", "argumentType", "argument" } | |
38 | Cases { | |
39 | { "%e", "1.200000e+000", "d", "1.2" } | |
40 | { "%e", "1.234568e+006", "d", "1234567.89" } | |
41 | { "%E", "1.234568E+006", "d", "1234567.89" } | |
42 | { "%10e", "1.234568e+000", "d", "1.23456789" } | |
43 | { "%10.4e", "1.2346e+000", "d", "1.23456789" } | |
44 | { "%-10e", "1.234568e+000", "d", "1.23456789" } | |
45 | { "%10e", "1.234568e+002", "d", "123.456789" } | |
46 | { "%-10e", "1.234568e+002", "d", "123.456789" } | |
47 | { "%-+12.1e", "+1.2e+000 ", "d", "1.234" } | |
48 | { "%-+12.1e", "-1.2e+000 ", "d", "-1.234" } | |
49 | { "%- 12.10e", " 1.2340000000e+000", "d", "1.234" } | |
50 | { "%- 12.1e", "-1.2e+000 ", "d", "-1.234" } | |
51 | { "%+12.1e", " +1.2e+000", "d", "1.234" } | |
52 | { "%+12.1e", " -1.2e+000", "d", "-1.234" } | |
53 | { "% 12.1e", " 1.2e+000", "d", "1.234" } | |
54 | { "% 12.1e", " -1.2e+000", "d", "-1.234" } | |
55 | { "%12.1e", " 1.2e+000", "d", "1.234" } | |
56 | { "%12.1e", " -1.2e+000", "d", "-1.234" } | |
57 | { "%.2e", "1.23e+000", "d", "1.234" } | |
58 | { "%.2e", "-1.23e+000", "d", "-1.234" } | |
59 | { "%3e", "1.234000e+000", "d", "1.234" } | |
60 | { "%3e", "-1.234000e+000", "d", "-1.234" } | |
61 | { "%g", "12345.7", "d", "12345.6789" } | |
62 | { "%g", "123457", "d", "123456.789" } | |
63 | { "%g", "1.23457e+006", "d", "1234567.89" } | |
64 | { "%G", "12345.7", "d", "12345.6789" } | |
65 | { "%G", "123457", "d", "123456.789" } | |
66 | { "%G", "1.23457E+006", "d", "1234567.89" } | |
67 | { "%.0f", "-12", "d", "-12.34" } | |
68 | { "%.0e", "-1e+001", "d", "-12.34" } | |
69 | { "%.0g", "-1e+001", "d", "-12.34" } | |
70 | { "%hd", "-30002", "2", "8ace" } | |
71 | { "%ho", "105316", "2", "8ace" } | |
72 | { "%hx", "8ace", "2", "8ace" } | |
73 | { "%lx", "8ace1234", "4", "8ace1234" } | |
74 | { "%llx", "123456789abcdef0", "8", "123456789abcdef0" } | |
75 | { "%lu", "2328760884", "4", "8ace1234" } | |
76 | // %llu doesn't work yet. | |
77 | { "%ld", "-1966206412", "4", "8ace1234" } | |
78 | { "%lld", "1311768467463790320", "8", "123456789abcdef0" } | |
79 | { "%+u", "2328760884", "4", "8ace1234" } // Ignore the + sign argument | |
80 | } | |
81 | } | |
82 | printfPrecision { | |
83 | Headers { "format", "result", "argumentType", "argument", "precision" } | |
84 | Cases { | |
85 | { "%+1.*e", "+1.2346e+000", "d", "1.2345678", :int{4} } | |
86 | { "%+2.*e", "+1.234568e+000", "d", "1.2345678", :int{6} } | |
87 | { "%*d", "12345678", "4", "BC614E", :int{7} } | |
88 | { "%*d", "12345678", "4", "BC614E", :int{8} } | |
89 | { "%*d", " 12345678", "4", "BC614E", :int{9} } | |
90 | } | |
91 | } | |
92 | scanf { | |
93 | Headers { "format", "argument", "argumentType", "result" } | |
94 | Cases { | |
95 | { "%e", "1.200000e+000", "d", "1.2" } | |
96 | { "%*e%e", "1.200000e+000 4.825000e+000", "d", "4.825" } | |
97 | { "%C", "1234", "2", "31" } | |
98 | { "%*C%C", "1234", "2", "32" } | |
99 | { "%S", "1234 5678", "S", "1234" } | |
100 | { "%*S%S", "1234 5678", "S", "5678" } | |
101 | { "%hd", "1234 5678", "2", "4D2" } | |
102 | { "%*hd%hd", "1234 5678", "2", "162E" } | |
103 | { "%d", "1234 5678", "4", "4D2" } | |
104 | { "%ld", "1234 5678", "4", "4D2" } | |
105 | { "%lld", "1311768467463790320", "8", "123456789abcdef0" } | |
106 | { "%3d", "1234 5678", "4", "7B" } | |
107 | { "%4d", "123", "4", "7B" } | |
108 | { "%40d", "123", "4", "7B" } | |
109 | { "%*d%d", "1234 5678", "4", "162E" } | |
110 | { "%x", "abcd ef01", "4", "abcd" } | |
111 | { "%3x", "abcd ef01", "4", "abc" } | |
112 | { "%*hx%hx", "abcd ef01", "2", "ef01" } | |
113 | { "%ho", "1046539", "2", "89AB" } // Extra 9 on the end | |
114 | { "%3ho", "7700", "2", "1F8" } // Don't read the 0 at the end | |
115 | { "%llo", "1777777777777777777777", "8", "FFFFFFFFFFFFFFFF" } | |
116 | { "%lx", "abcdef01", "4", "abcdef01" } | |
117 | { "%x", "0x7abcdef0", "4", "7abcdef0" } | |
118 | { "%llx", "123456789abcdef0", "8", "123456789abcdef0" } | |
119 | { "%S", "a\U00010000b", "S", "a\U00010000b" } | |
120 | { "%[abce]", "abcd ef01", "S", "abc" } | |
121 | { "%*[abce]%[de\\ ]", "abcd ef01", "S", "d e" } | |
122 | { "%[a\U00010000]", "a\U00010000\U00010001b", "S", "a\U00010000" } | |
123 | { "%[a-f]", "abccdefg", "S", "abccdef" } | |
124 | { "%[a-c]", "abccdefg", "S", "abcc" } | |
125 | { "%[^e-f]", "abccdefg", "S", "abccd" } | |
126 | { "%3[^e-f]", "abccdefg", "S", "abc" } | |
127 | { "%*3[abc]%[cde]", "abccdefg", "S", "cde" } | |
128 | { "%*3S%S", "a bc efg", "S", "bc" } | |
129 | { "%*3S%S", "abcd efg", "S", "d" } | |
130 | { "%*3s%s", "abcd efg", "s", "d" } | |
131 | { "%*3d%d", "1234", "4", "4" } | |
132 | } | |
133 | } | |
134 | } | |
135 | } |