8
8
//
9
9
// NetBSD does not support LC_TIME at the moment
10
10
// XFAIL: netbsd
11
- // XFAIL: LIBCXX-AIX-FIXME
12
11
13
12
// REQUIRES: locale.en_US.UTF-8
14
13
// REQUIRES: locale.fr_FR.UTF-8
@@ -54,6 +53,8 @@ int main(int, char**)
54
53
const char in[] = " 12/31/2061 11:55:59 PM" ;
55
54
#elif defined(TEST_HAS_GLIBC)
56
55
const char in[] = " Sat 31 Dec 2061 11:55:59 PM" ;
56
+ #elif defined(_AIX)
57
+ const char in[] = " Dec 31, 2061 at 11:55:59 PM" ;
57
58
#else
58
59
const char in[] = " Sat Dec 31 23:55:59 2061" ;
59
60
#endif
@@ -67,14 +68,14 @@ int main(int, char**)
67
68
assert (t.tm_mday == 31 );
68
69
assert (t.tm_mon == 11 );
69
70
assert (t.tm_year == 161 );
70
- #ifndef _WIN32
71
+ #if !defined( _WIN32) && !defined(_AIX)
71
72
assert (t.tm_wday == 6 );
72
73
#endif
73
74
assert (err == std::ios_base::eofbit);
74
75
}
75
76
{
76
77
const my_facet f (LOCALE_en_US_UTF_8, 1 );
77
- #if defined(_WIN32) || defined(TEST_HAS_GLIBC)
78
+ #if defined(_WIN32) || defined(TEST_HAS_GLIBC) || defined(_AIX)
78
79
const char in[] = " 11:55:59 PM" ;
79
80
#else
80
81
const char in[] = " 23:55:59" ;
@@ -94,6 +95,8 @@ int main(int, char**)
94
95
const char in[] = " 31/12/2061 23:55:59" ;
95
96
#elif defined(TEST_HAS_GLIBC)
96
97
const char in[] = " sam. 31 d" " \xC3\xA9 " " c. 2061 23:55:59" ;
98
+ #elif defined(_AIX)
99
+ const char in[] = " 31 d" " \xC3\xA9 " " c. 2061 " " \xC3\xA0 " " 23:55:59" ;
97
100
#else
98
101
const char in[] = " Sam 31 d" " \xC3\xA9 " " c 23:55:59 2061" ;
99
102
#endif
@@ -107,7 +110,7 @@ int main(int, char**)
107
110
assert (t.tm_mday == 31 );
108
111
assert (t.tm_mon == 11 );
109
112
assert (t.tm_year == 161 );
110
- #ifndef _WIN32
113
+ #if !defined( _WIN32) && !defined(_AIX)
111
114
assert (t.tm_wday == 6 );
112
115
#endif
113
116
assert (err == std::ios_base::eofbit);
@@ -130,6 +133,8 @@ int main(int, char**)
130
133
const char in[] = " \xD0\xA1\xD0\xB1 31 \xD0\xB4\xD0\xB5\xD0\xBA 2061 23:55:59" ;
131
134
#elif defined(_WIN32)
132
135
const char in[] = " 31.12.2061 23:55:59" ;
136
+ #elif defined(_AIX)
137
+ const char in[] = " 31 \xD0\xB4\xD0\xB5\xD0\xBA . 2061 \xD0\xB3 ., 23:55:59" ;
133
138
#else
134
139
const char in[] = " \xD1\x81\xD1\x83\xD0\xB1\xD0\xB1 "
135
140
" \xD0\xBE\xD1\x82\xD0\xB0 "
@@ -150,7 +155,7 @@ int main(int, char**)
150
155
assert (t.tm_mday == 31 );
151
156
assert (t.tm_mon == 11 );
152
157
assert (t.tm_year == 161 );
153
- #ifndef _WIN32
158
+ #if !defined( _WIN32) && !defined(_AIX)
154
159
assert (t.tm_wday == 6 );
155
160
#endif
156
161
assert (err == std::ios_base::eofbit);
@@ -177,28 +182,42 @@ int main(int, char**)
177
182
" \xE7\xA7\x92 " ;
178
183
#elif defined(_WIN32)
179
184
const char in[] = " 2061/12/31 23:55:59" ;
185
+ #elif defined(_AIX)
186
+ // The time field is omitted in the definition below because in the
187
+ // date-time format of locale zh_CN.UTF-8 on AIX, there is %Z before
188
+ // the time field, i.e, "... %Z %p%I:%M:%S", and its value varies
189
+ // depending on the date of the year and the location of the machine
190
+ // where the test case is run.
191
+ const char in[] = " 2061" " \xE5\xB9\xB4 " " 12" " \xE6\x9C\x88 " " 31"
192
+ " \xE6\x97\xA5 " ;
180
193
#else
181
194
const char in[] = " \xE5\x85\xAD 12/31 23:55:59 2061" ;
182
195
#endif
183
196
err = std::ios_base::goodbit;
184
197
t = std::tm ();
185
198
I i = f.get (I (in), I (in+sizeof (in)/sizeof (in[0 ])-1 ), ios, err, &t, ' c' );
186
199
assert (base (i) == in+sizeof (in)/sizeof (in[0 ])-1 );
200
+ #ifndef _AIX
187
201
assert (t.tm_sec == 59 );
188
202
assert (t.tm_min == 55 );
189
203
assert (t.tm_hour == 23 );
204
+ #endif
190
205
assert (t.tm_mday == 31 );
191
206
assert (t.tm_mon == 11 );
192
207
assert (t.tm_year == 161 );
193
- #ifndef _WIN32
208
+ #if !defined( _WIN32) && !defined(_AIX)
194
209
assert (t.tm_wday == 6 );
195
210
#endif
211
+ #if !defined(_AIX)
196
212
assert (err == std::ios_base::eofbit);
213
+ #endif
197
214
}
198
215
{
199
216
const my_facet f (LOCALE_zh_CN_UTF_8, 1 );
200
217
#if defined(_WIN32)
201
218
const char in[] = " 23:55:59" ;
219
+ #elif defined(_AIX)
220
+ const char in[] = " \xE4\xB8\x8B\xE5\x8D\x88 " " 11:55:59" ;
202
221
#else
203
222
const char in[] = " 23" " \xE6\x97\xB6 " " 55" " \xE5\x88\x86 " " 59" " \xE7\xA7\x92 " ;
204
223
#endif
@@ -208,7 +227,11 @@ int main(int, char**)
208
227
assert (base (i) == in+sizeof (in)/sizeof (in[0 ])-1 );
209
228
assert (t.tm_sec == 59 );
210
229
assert (t.tm_min == 55 );
230
+ #if defined(_AIX)
231
+ assert (t.tm_hour == 11 );
232
+ #else
211
233
assert (t.tm_hour == 23 );
234
+ #endif
212
235
assert (err == std::ios_base::eofbit);
213
236
}
214
237
0 commit comments