blob: 3cfa9dc1835a56ce6698efc7b61c50ba871540d3 [file] [log] [blame]
Austin Schuh36244a12019-09-21 17:52:38 -07001// Copyright 2017 The Abseil Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#include "absl/numeric/int128.h"
16
17#include <sstream>
18#include <string>
19
20#include "gtest/gtest.h"
21
22namespace {
23
24struct Uint128TestCase {
25 absl::uint128 value;
26 std::ios_base::fmtflags flags;
27 std::streamsize width;
28 const char* expected;
29};
30
31constexpr char kFill = '_';
32
33std::string StreamFormatToString(std::ios_base::fmtflags flags,
34 std::streamsize width) {
35 std::vector<const char*> flagstr;
36 switch (flags & std::ios::basefield) {
37 case std::ios::dec:
38 flagstr.push_back("std::ios::dec");
39 break;
40 case std::ios::oct:
41 flagstr.push_back("std::ios::oct");
42 break;
43 case std::ios::hex:
44 flagstr.push_back("std::ios::hex");
45 break;
46 default: // basefield not specified
47 break;
48 }
49 switch (flags & std::ios::adjustfield) {
50 case std::ios::left:
51 flagstr.push_back("std::ios::left");
52 break;
53 case std::ios::internal:
54 flagstr.push_back("std::ios::internal");
55 break;
56 case std::ios::right:
57 flagstr.push_back("std::ios::right");
58 break;
59 default: // adjustfield not specified
60 break;
61 }
62 if (flags & std::ios::uppercase) flagstr.push_back("std::ios::uppercase");
63 if (flags & std::ios::showbase) flagstr.push_back("std::ios::showbase");
64 if (flags & std::ios::showpos) flagstr.push_back("std::ios::showpos");
65
66 std::ostringstream msg;
67 msg << "\n StreamFormatToString(test_case.flags, test_case.width)\n "
68 "flags: ";
69 if (!flagstr.empty()) {
70 for (size_t i = 0; i < flagstr.size() - 1; ++i) msg << flagstr[i] << " | ";
71 msg << flagstr.back();
72 } else {
73 msg << "(default)";
74 }
75 msg << "\n width: " << width << "\n fill: '" << kFill << "'";
76 return msg.str();
77}
78
79void CheckUint128Case(const Uint128TestCase& test_case) {
80 std::ostringstream os;
81 os.flags(test_case.flags);
82 os.width(test_case.width);
83 os.fill(kFill);
84 os << test_case.value;
85 SCOPED_TRACE(StreamFormatToString(test_case.flags, test_case.width));
86 EXPECT_EQ(test_case.expected, os.str());
87}
88
89constexpr std::ios::fmtflags kDec = std::ios::dec;
90constexpr std::ios::fmtflags kOct = std::ios::oct;
91constexpr std::ios::fmtflags kHex = std::ios::hex;
92constexpr std::ios::fmtflags kLeft = std::ios::left;
93constexpr std::ios::fmtflags kInt = std::ios::internal;
94constexpr std::ios::fmtflags kRight = std::ios::right;
95constexpr std::ios::fmtflags kUpper = std::ios::uppercase;
96constexpr std::ios::fmtflags kBase = std::ios::showbase;
97constexpr std::ios::fmtflags kPos = std::ios::showpos;
98
99TEST(Uint128, OStreamValueTest) {
100 CheckUint128Case({1, kDec, /*width = */ 0, "1"});
101 CheckUint128Case({1, kOct, /*width = */ 0, "1"});
102 CheckUint128Case({1, kHex, /*width = */ 0, "1"});
103 CheckUint128Case({9, kDec, /*width = */ 0, "9"});
104 CheckUint128Case({9, kOct, /*width = */ 0, "11"});
105 CheckUint128Case({9, kHex, /*width = */ 0, "9"});
106 CheckUint128Case({12345, kDec, /*width = */ 0, "12345"});
107 CheckUint128Case({12345, kOct, /*width = */ 0, "30071"});
108 CheckUint128Case({12345, kHex, /*width = */ 0, "3039"});
109 CheckUint128Case(
110 {0x8000000000000000, kDec, /*width = */ 0, "9223372036854775808"});
111 CheckUint128Case(
112 {0x8000000000000000, kOct, /*width = */ 0, "1000000000000000000000"});
113 CheckUint128Case(
114 {0x8000000000000000, kHex, /*width = */ 0, "8000000000000000"});
115 CheckUint128Case({std::numeric_limits<uint64_t>::max(), kDec,
116 /*width = */ 0, "18446744073709551615"});
117 CheckUint128Case({std::numeric_limits<uint64_t>::max(), kOct,
118 /*width = */ 0, "1777777777777777777777"});
119 CheckUint128Case({std::numeric_limits<uint64_t>::max(), kHex,
120 /*width = */ 0, "ffffffffffffffff"});
121 CheckUint128Case(
122 {absl::MakeUint128(1, 0), kDec, /*width = */ 0, "18446744073709551616"});
123 CheckUint128Case({absl::MakeUint128(1, 0), kOct, /*width = */ 0,
124 "2000000000000000000000"});
125 CheckUint128Case(
126 {absl::MakeUint128(1, 0), kHex, /*width = */ 0, "10000000000000000"});
127 CheckUint128Case({absl::MakeUint128(0x8000000000000000, 0), kDec,
128 /*width = */ 0, "170141183460469231731687303715884105728"});
129 CheckUint128Case({absl::MakeUint128(0x8000000000000000, 0), kOct,
130 /*width = */ 0,
131 "2000000000000000000000000000000000000000000"});
132 CheckUint128Case({absl::MakeUint128(0x8000000000000000, 0), kHex,
133 /*width = */ 0, "80000000000000000000000000000000"});
134 CheckUint128Case({absl::kuint128max, kDec, /*width = */ 0,
135 "340282366920938463463374607431768211455"});
136 CheckUint128Case({absl::kuint128max, kOct, /*width = */ 0,
137 "3777777777777777777777777777777777777777777"});
138 CheckUint128Case({absl::kuint128max, kHex, /*width = */ 0,
139 "ffffffffffffffffffffffffffffffff"});
140}
141
142std::vector<Uint128TestCase> GetUint128FormatCases();
143
144TEST(Uint128, OStreamFormatTest) {
145 for (const Uint128TestCase& test_case : GetUint128FormatCases()) {
146 CheckUint128Case(test_case);
147 }
148}
149
150std::vector<Uint128TestCase> GetUint128FormatCases() {
151 return {
152 {0, std::ios_base::fmtflags(), /*width = */ 0, "0"},
153 {0, std::ios_base::fmtflags(), /*width = */ 6, "_____0"},
154 {0, kPos, /*width = */ 0, "0"},
155 {0, kPos, /*width = */ 6, "_____0"},
156 {0, kBase, /*width = */ 0, "0"},
157 {0, kBase, /*width = */ 6, "_____0"},
158 {0, kBase | kPos, /*width = */ 0, "0"},
159 {0, kBase | kPos, /*width = */ 6, "_____0"},
160 {0, kUpper, /*width = */ 0, "0"},
161 {0, kUpper, /*width = */ 6, "_____0"},
162 {0, kUpper | kPos, /*width = */ 0, "0"},
163 {0, kUpper | kPos, /*width = */ 6, "_____0"},
164 {0, kUpper | kBase, /*width = */ 0, "0"},
165 {0, kUpper | kBase, /*width = */ 6, "_____0"},
166 {0, kUpper | kBase | kPos, /*width = */ 0, "0"},
167 {0, kUpper | kBase | kPos, /*width = */ 6, "_____0"},
168 {0, kLeft, /*width = */ 0, "0"},
169 {0, kLeft, /*width = */ 6, "0_____"},
170 {0, kLeft | kPos, /*width = */ 0, "0"},
171 {0, kLeft | kPos, /*width = */ 6, "0_____"},
172 {0, kLeft | kBase, /*width = */ 0, "0"},
173 {0, kLeft | kBase, /*width = */ 6, "0_____"},
174 {0, kLeft | kBase | kPos, /*width = */ 0, "0"},
175 {0, kLeft | kBase | kPos, /*width = */ 6, "0_____"},
176 {0, kLeft | kUpper, /*width = */ 0, "0"},
177 {0, kLeft | kUpper, /*width = */ 6, "0_____"},
178 {0, kLeft | kUpper | kPos, /*width = */ 0, "0"},
179 {0, kLeft | kUpper | kPos, /*width = */ 6, "0_____"},
180 {0, kLeft | kUpper | kBase, /*width = */ 0, "0"},
181 {0, kLeft | kUpper | kBase, /*width = */ 6, "0_____"},
182 {0, kLeft | kUpper | kBase | kPos, /*width = */ 0, "0"},
183 {0, kLeft | kUpper | kBase | kPos, /*width = */ 6, "0_____"},
184 {0, kInt, /*width = */ 0, "0"},
185 {0, kInt, /*width = */ 6, "_____0"},
186 {0, kInt | kPos, /*width = */ 0, "0"},
187 {0, kInt | kPos, /*width = */ 6, "_____0"},
188 {0, kInt | kBase, /*width = */ 0, "0"},
189 {0, kInt | kBase, /*width = */ 6, "_____0"},
190 {0, kInt | kBase | kPos, /*width = */ 0, "0"},
191 {0, kInt | kBase | kPos, /*width = */ 6, "_____0"},
192 {0, kInt | kUpper, /*width = */ 0, "0"},
193 {0, kInt | kUpper, /*width = */ 6, "_____0"},
194 {0, kInt | kUpper | kPos, /*width = */ 0, "0"},
195 {0, kInt | kUpper | kPos, /*width = */ 6, "_____0"},
196 {0, kInt | kUpper | kBase, /*width = */ 0, "0"},
197 {0, kInt | kUpper | kBase, /*width = */ 6, "_____0"},
198 {0, kInt | kUpper | kBase | kPos, /*width = */ 0, "0"},
199 {0, kInt | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
200 {0, kRight, /*width = */ 0, "0"},
201 {0, kRight, /*width = */ 6, "_____0"},
202 {0, kRight | kPos, /*width = */ 0, "0"},
203 {0, kRight | kPos, /*width = */ 6, "_____0"},
204 {0, kRight | kBase, /*width = */ 0, "0"},
205 {0, kRight | kBase, /*width = */ 6, "_____0"},
206 {0, kRight | kBase | kPos, /*width = */ 0, "0"},
207 {0, kRight | kBase | kPos, /*width = */ 6, "_____0"},
208 {0, kRight | kUpper, /*width = */ 0, "0"},
209 {0, kRight | kUpper, /*width = */ 6, "_____0"},
210 {0, kRight | kUpper | kPos, /*width = */ 0, "0"},
211 {0, kRight | kUpper | kPos, /*width = */ 6, "_____0"},
212 {0, kRight | kUpper | kBase, /*width = */ 0, "0"},
213 {0, kRight | kUpper | kBase, /*width = */ 6, "_____0"},
214 {0, kRight | kUpper | kBase | kPos, /*width = */ 0, "0"},
215 {0, kRight | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
216 {0, kDec, /*width = */ 0, "0"},
217 {0, kDec, /*width = */ 6, "_____0"},
218 {0, kDec | kPos, /*width = */ 0, "0"},
219 {0, kDec | kPos, /*width = */ 6, "_____0"},
220 {0, kDec | kBase, /*width = */ 0, "0"},
221 {0, kDec | kBase, /*width = */ 6, "_____0"},
222 {0, kDec | kBase | kPos, /*width = */ 0, "0"},
223 {0, kDec | kBase | kPos, /*width = */ 6, "_____0"},
224 {0, kDec | kUpper, /*width = */ 0, "0"},
225 {0, kDec | kUpper, /*width = */ 6, "_____0"},
226 {0, kDec | kUpper | kPos, /*width = */ 0, "0"},
227 {0, kDec | kUpper | kPos, /*width = */ 6, "_____0"},
228 {0, kDec | kUpper | kBase, /*width = */ 0, "0"},
229 {0, kDec | kUpper | kBase, /*width = */ 6, "_____0"},
230 {0, kDec | kUpper | kBase | kPos, /*width = */ 0, "0"},
231 {0, kDec | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
232 {0, kDec | kLeft, /*width = */ 0, "0"},
233 {0, kDec | kLeft, /*width = */ 6, "0_____"},
234 {0, kDec | kLeft | kPos, /*width = */ 0, "0"},
235 {0, kDec | kLeft | kPos, /*width = */ 6, "0_____"},
236 {0, kDec | kLeft | kBase, /*width = */ 0, "0"},
237 {0, kDec | kLeft | kBase, /*width = */ 6, "0_____"},
238 {0, kDec | kLeft | kBase | kPos, /*width = */ 0, "0"},
239 {0, kDec | kLeft | kBase | kPos, /*width = */ 6, "0_____"},
240 {0, kDec | kLeft | kUpper, /*width = */ 0, "0"},
241 {0, kDec | kLeft | kUpper, /*width = */ 6, "0_____"},
242 {0, kDec | kLeft | kUpper | kPos, /*width = */ 0, "0"},
243 {0, kDec | kLeft | kUpper | kPos, /*width = */ 6, "0_____"},
244 {0, kDec | kLeft | kUpper | kBase, /*width = */ 0, "0"},
245 {0, kDec | kLeft | kUpper | kBase, /*width = */ 6, "0_____"},
246 {0, kDec | kLeft | kUpper | kBase | kPos, /*width = */ 0, "0"},
247 {0, kDec | kLeft | kUpper | kBase | kPos, /*width = */ 6, "0_____"},
248 {0, kDec | kInt, /*width = */ 0, "0"},
249 {0, kDec | kInt, /*width = */ 6, "_____0"},
250 {0, kDec | kInt | kPos, /*width = */ 0, "0"},
251 {0, kDec | kInt | kPos, /*width = */ 6, "_____0"},
252 {0, kDec | kInt | kBase, /*width = */ 0, "0"},
253 {0, kDec | kInt | kBase, /*width = */ 6, "_____0"},
254 {0, kDec | kInt | kBase | kPos, /*width = */ 0, "0"},
255 {0, kDec | kInt | kBase | kPos, /*width = */ 6, "_____0"},
256 {0, kDec | kInt | kUpper, /*width = */ 0, "0"},
257 {0, kDec | kInt | kUpper, /*width = */ 6, "_____0"},
258 {0, kDec | kInt | kUpper | kPos, /*width = */ 0, "0"},
259 {0, kDec | kInt | kUpper | kPos, /*width = */ 6, "_____0"},
260 {0, kDec | kInt | kUpper | kBase, /*width = */ 0, "0"},
261 {0, kDec | kInt | kUpper | kBase, /*width = */ 6, "_____0"},
262 {0, kDec | kInt | kUpper | kBase | kPos, /*width = */ 0, "0"},
263 {0, kDec | kInt | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
264 {0, kDec | kRight, /*width = */ 0, "0"},
265 {0, kDec | kRight, /*width = */ 6, "_____0"},
266 {0, kDec | kRight | kPos, /*width = */ 0, "0"},
267 {0, kDec | kRight | kPos, /*width = */ 6, "_____0"},
268 {0, kDec | kRight | kBase, /*width = */ 0, "0"},
269 {0, kDec | kRight | kBase, /*width = */ 6, "_____0"},
270 {0, kDec | kRight | kBase | kPos, /*width = */ 0, "0"},
271 {0, kDec | kRight | kBase | kPos, /*width = */ 6, "_____0"},
272 {0, kDec | kRight | kUpper, /*width = */ 0, "0"},
273 {0, kDec | kRight | kUpper, /*width = */ 6, "_____0"},
274 {0, kDec | kRight | kUpper | kPos, /*width = */ 0, "0"},
275 {0, kDec | kRight | kUpper | kPos, /*width = */ 6, "_____0"},
276 {0, kDec | kRight | kUpper | kBase, /*width = */ 0, "0"},
277 {0, kDec | kRight | kUpper | kBase, /*width = */ 6, "_____0"},
278 {0, kDec | kRight | kUpper | kBase | kPos, /*width = */ 0, "0"},
279 {0, kDec | kRight | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
280 {0, kOct, /*width = */ 0, "0"},
281 {0, kOct, /*width = */ 6, "_____0"},
282 {0, kOct | kPos, /*width = */ 0, "0"},
283 {0, kOct | kPos, /*width = */ 6, "_____0"},
284 {0, kOct | kBase, /*width = */ 0, "0"},
285 {0, kOct | kBase, /*width = */ 6, "_____0"},
286 {0, kOct | kBase | kPos, /*width = */ 0, "0"},
287 {0, kOct | kBase | kPos, /*width = */ 6, "_____0"},
288 {0, kOct | kUpper, /*width = */ 0, "0"},
289 {0, kOct | kUpper, /*width = */ 6, "_____0"},
290 {0, kOct | kUpper | kPos, /*width = */ 0, "0"},
291 {0, kOct | kUpper | kPos, /*width = */ 6, "_____0"},
292 {0, kOct | kUpper | kBase, /*width = */ 0, "0"},
293 {0, kOct | kUpper | kBase, /*width = */ 6, "_____0"},
294 {0, kOct | kUpper | kBase | kPos, /*width = */ 0, "0"},
295 {0, kOct | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
296 {0, kOct | kLeft, /*width = */ 0, "0"},
297 {0, kOct | kLeft, /*width = */ 6, "0_____"},
298 {0, kOct | kLeft | kPos, /*width = */ 0, "0"},
299 {0, kOct | kLeft | kPos, /*width = */ 6, "0_____"},
300 {0, kOct | kLeft | kBase, /*width = */ 0, "0"},
301 {0, kOct | kLeft | kBase, /*width = */ 6, "0_____"},
302 {0, kOct | kLeft | kBase | kPos, /*width = */ 0, "0"},
303 {0, kOct | kLeft | kBase | kPos, /*width = */ 6, "0_____"},
304 {0, kOct | kLeft | kUpper, /*width = */ 0, "0"},
305 {0, kOct | kLeft | kUpper, /*width = */ 6, "0_____"},
306 {0, kOct | kLeft | kUpper | kPos, /*width = */ 0, "0"},
307 {0, kOct | kLeft | kUpper | kPos, /*width = */ 6, "0_____"},
308 {0, kOct | kLeft | kUpper | kBase, /*width = */ 0, "0"},
309 {0, kOct | kLeft | kUpper | kBase, /*width = */ 6, "0_____"},
310 {0, kOct | kLeft | kUpper | kBase | kPos, /*width = */ 0, "0"},
311 {0, kOct | kLeft | kUpper | kBase | kPos, /*width = */ 6, "0_____"},
312 {0, kOct | kInt, /*width = */ 0, "0"},
313 {0, kOct | kInt, /*width = */ 6, "_____0"},
314 {0, kOct | kInt | kPos, /*width = */ 0, "0"},
315 {0, kOct | kInt | kPos, /*width = */ 6, "_____0"},
316 {0, kOct | kInt | kBase, /*width = */ 0, "0"},
317 {0, kOct | kInt | kBase, /*width = */ 6, "_____0"},
318 {0, kOct | kInt | kBase | kPos, /*width = */ 0, "0"},
319 {0, kOct | kInt | kBase | kPos, /*width = */ 6, "_____0"},
320 {0, kOct | kInt | kUpper, /*width = */ 0, "0"},
321 {0, kOct | kInt | kUpper, /*width = */ 6, "_____0"},
322 {0, kOct | kInt | kUpper | kPos, /*width = */ 0, "0"},
323 {0, kOct | kInt | kUpper | kPos, /*width = */ 6, "_____0"},
324 {0, kOct | kInt | kUpper | kBase, /*width = */ 0, "0"},
325 {0, kOct | kInt | kUpper | kBase, /*width = */ 6, "_____0"},
326 {0, kOct | kInt | kUpper | kBase | kPos, /*width = */ 0, "0"},
327 {0, kOct | kInt | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
328 {0, kOct | kRight, /*width = */ 0, "0"},
329 {0, kOct | kRight, /*width = */ 6, "_____0"},
330 {0, kOct | kRight | kPos, /*width = */ 0, "0"},
331 {0, kOct | kRight | kPos, /*width = */ 6, "_____0"},
332 {0, kOct | kRight | kBase, /*width = */ 0, "0"},
333 {0, kOct | kRight | kBase, /*width = */ 6, "_____0"},
334 {0, kOct | kRight | kBase | kPos, /*width = */ 0, "0"},
335 {0, kOct | kRight | kBase | kPos, /*width = */ 6, "_____0"},
336 {0, kOct | kRight | kUpper, /*width = */ 0, "0"},
337 {0, kOct | kRight | kUpper, /*width = */ 6, "_____0"},
338 {0, kOct | kRight | kUpper | kPos, /*width = */ 0, "0"},
339 {0, kOct | kRight | kUpper | kPos, /*width = */ 6, "_____0"},
340 {0, kOct | kRight | kUpper | kBase, /*width = */ 0, "0"},
341 {0, kOct | kRight | kUpper | kBase, /*width = */ 6, "_____0"},
342 {0, kOct | kRight | kUpper | kBase | kPos, /*width = */ 0, "0"},
343 {0, kOct | kRight | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
344 {0, kHex, /*width = */ 0, "0"},
345 {0, kHex, /*width = */ 6, "_____0"},
346 {0, kHex | kPos, /*width = */ 0, "0"},
347 {0, kHex | kPos, /*width = */ 6, "_____0"},
348 {0, kHex | kBase, /*width = */ 0, "0"},
349 {0, kHex | kBase, /*width = */ 6, "_____0"},
350 {0, kHex | kBase | kPos, /*width = */ 0, "0"},
351 {0, kHex | kBase | kPos, /*width = */ 6, "_____0"},
352 {0, kHex | kUpper, /*width = */ 0, "0"},
353 {0, kHex | kUpper, /*width = */ 6, "_____0"},
354 {0, kHex | kUpper | kPos, /*width = */ 0, "0"},
355 {0, kHex | kUpper | kPos, /*width = */ 6, "_____0"},
356 {0, kHex | kUpper | kBase, /*width = */ 0, "0"},
357 {0, kHex | kUpper | kBase, /*width = */ 6, "_____0"},
358 {0, kHex | kUpper | kBase | kPos, /*width = */ 0, "0"},
359 {0, kHex | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
360 {0, kHex | kLeft, /*width = */ 0, "0"},
361 {0, kHex | kLeft, /*width = */ 6, "0_____"},
362 {0, kHex | kLeft | kPos, /*width = */ 0, "0"},
363 {0, kHex | kLeft | kPos, /*width = */ 6, "0_____"},
364 {0, kHex | kLeft | kBase, /*width = */ 0, "0"},
365 {0, kHex | kLeft | kBase, /*width = */ 6, "0_____"},
366 {0, kHex | kLeft | kBase | kPos, /*width = */ 0, "0"},
367 {0, kHex | kLeft | kBase | kPos, /*width = */ 6, "0_____"},
368 {0, kHex | kLeft | kUpper, /*width = */ 0, "0"},
369 {0, kHex | kLeft | kUpper, /*width = */ 6, "0_____"},
370 {0, kHex | kLeft | kUpper | kPos, /*width = */ 0, "0"},
371 {0, kHex | kLeft | kUpper | kPos, /*width = */ 6, "0_____"},
372 {0, kHex | kLeft | kUpper | kBase, /*width = */ 0, "0"},
373 {0, kHex | kLeft | kUpper | kBase, /*width = */ 6, "0_____"},
374 {0, kHex | kLeft | kUpper | kBase | kPos, /*width = */ 0, "0"},
375 {0, kHex | kLeft | kUpper | kBase | kPos, /*width = */ 6, "0_____"},
376 {0, kHex | kInt, /*width = */ 0, "0"},
377 {0, kHex | kInt, /*width = */ 6, "_____0"},
378 {0, kHex | kInt | kPos, /*width = */ 0, "0"},
379 {0, kHex | kInt | kPos, /*width = */ 6, "_____0"},
380 {0, kHex | kInt | kBase, /*width = */ 0, "0"},
381 {0, kHex | kInt | kBase, /*width = */ 6, "_____0"},
382 {0, kHex | kInt | kBase | kPos, /*width = */ 0, "0"},
383 {0, kHex | kInt | kBase | kPos, /*width = */ 6, "_____0"},
384 {0, kHex | kInt | kUpper, /*width = */ 0, "0"},
385 {0, kHex | kInt | kUpper, /*width = */ 6, "_____0"},
386 {0, kHex | kInt | kUpper | kPos, /*width = */ 0, "0"},
387 {0, kHex | kInt | kUpper | kPos, /*width = */ 6, "_____0"},
388 {0, kHex | kInt | kUpper | kBase, /*width = */ 0, "0"},
389 {0, kHex | kInt | kUpper | kBase, /*width = */ 6, "_____0"},
390 {0, kHex | kInt | kUpper | kBase | kPos, /*width = */ 0, "0"},
391 {0, kHex | kInt | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
392 {0, kHex | kRight, /*width = */ 0, "0"},
393 {0, kHex | kRight, /*width = */ 6, "_____0"},
394 {0, kHex | kRight | kPos, /*width = */ 0, "0"},
395 {0, kHex | kRight | kPos, /*width = */ 6, "_____0"},
396 {0, kHex | kRight | kBase, /*width = */ 0, "0"},
397 {0, kHex | kRight | kBase, /*width = */ 6, "_____0"},
398 {0, kHex | kRight | kBase | kPos, /*width = */ 0, "0"},
399 {0, kHex | kRight | kBase | kPos, /*width = */ 6, "_____0"},
400 {0, kHex | kRight | kUpper, /*width = */ 0, "0"},
401 {0, kHex | kRight | kUpper, /*width = */ 6, "_____0"},
402 {0, kHex | kRight | kUpper | kPos, /*width = */ 0, "0"},
403 {0, kHex | kRight | kUpper | kPos, /*width = */ 6, "_____0"},
404 {0, kHex | kRight | kUpper | kBase, /*width = */ 0, "0"},
405 {0, kHex | kRight | kUpper | kBase, /*width = */ 6, "_____0"},
406 {0, kHex | kRight | kUpper | kBase | kPos, /*width = */ 0, "0"},
407 {0, kHex | kRight | kUpper | kBase | kPos, /*width = */ 6, "_____0"},
408 {37, std::ios_base::fmtflags(), /*width = */ 0, "37"},
409 {37, std::ios_base::fmtflags(), /*width = */ 6, "____37"},
410 {37, kPos, /*width = */ 0, "37"},
411 {37, kPos, /*width = */ 6, "____37"},
412 {37, kBase, /*width = */ 0, "37"},
413 {37, kBase, /*width = */ 6, "____37"},
414 {37, kBase | kPos, /*width = */ 0, "37"},
415 {37, kBase | kPos, /*width = */ 6, "____37"},
416 {37, kUpper, /*width = */ 0, "37"},
417 {37, kUpper, /*width = */ 6, "____37"},
418 {37, kUpper | kPos, /*width = */ 0, "37"},
419 {37, kUpper | kPos, /*width = */ 6, "____37"},
420 {37, kUpper | kBase, /*width = */ 0, "37"},
421 {37, kUpper | kBase, /*width = */ 6, "____37"},
422 {37, kUpper | kBase | kPos, /*width = */ 0, "37"},
423 {37, kUpper | kBase | kPos, /*width = */ 6, "____37"},
424 {37, kLeft, /*width = */ 0, "37"},
425 {37, kLeft, /*width = */ 6, "37____"},
426 {37, kLeft | kPos, /*width = */ 0, "37"},
427 {37, kLeft | kPos, /*width = */ 6, "37____"},
428 {37, kLeft | kBase, /*width = */ 0, "37"},
429 {37, kLeft | kBase, /*width = */ 6, "37____"},
430 {37, kLeft | kBase | kPos, /*width = */ 0, "37"},
431 {37, kLeft | kBase | kPos, /*width = */ 6, "37____"},
432 {37, kLeft | kUpper, /*width = */ 0, "37"},
433 {37, kLeft | kUpper, /*width = */ 6, "37____"},
434 {37, kLeft | kUpper | kPos, /*width = */ 0, "37"},
435 {37, kLeft | kUpper | kPos, /*width = */ 6, "37____"},
436 {37, kLeft | kUpper | kBase, /*width = */ 0, "37"},
437 {37, kLeft | kUpper | kBase, /*width = */ 6, "37____"},
438 {37, kLeft | kUpper | kBase | kPos, /*width = */ 0, "37"},
439 {37, kLeft | kUpper | kBase | kPos, /*width = */ 6, "37____"},
440 {37, kInt, /*width = */ 0, "37"},
441 {37, kInt, /*width = */ 6, "____37"},
442 {37, kInt | kPos, /*width = */ 0, "37"},
443 {37, kInt | kPos, /*width = */ 6, "____37"},
444 {37, kInt | kBase, /*width = */ 0, "37"},
445 {37, kInt | kBase, /*width = */ 6, "____37"},
446 {37, kInt | kBase | kPos, /*width = */ 0, "37"},
447 {37, kInt | kBase | kPos, /*width = */ 6, "____37"},
448 {37, kInt | kUpper, /*width = */ 0, "37"},
449 {37, kInt | kUpper, /*width = */ 6, "____37"},
450 {37, kInt | kUpper | kPos, /*width = */ 0, "37"},
451 {37, kInt | kUpper | kPos, /*width = */ 6, "____37"},
452 {37, kInt | kUpper | kBase, /*width = */ 0, "37"},
453 {37, kInt | kUpper | kBase, /*width = */ 6, "____37"},
454 {37, kInt | kUpper | kBase | kPos, /*width = */ 0, "37"},
455 {37, kInt | kUpper | kBase | kPos, /*width = */ 6, "____37"},
456 {37, kRight, /*width = */ 0, "37"},
457 {37, kRight, /*width = */ 6, "____37"},
458 {37, kRight | kPos, /*width = */ 0, "37"},
459 {37, kRight | kPos, /*width = */ 6, "____37"},
460 {37, kRight | kBase, /*width = */ 0, "37"},
461 {37, kRight | kBase, /*width = */ 6, "____37"},
462 {37, kRight | kBase | kPos, /*width = */ 0, "37"},
463 {37, kRight | kBase | kPos, /*width = */ 6, "____37"},
464 {37, kRight | kUpper, /*width = */ 0, "37"},
465 {37, kRight | kUpper, /*width = */ 6, "____37"},
466 {37, kRight | kUpper | kPos, /*width = */ 0, "37"},
467 {37, kRight | kUpper | kPos, /*width = */ 6, "____37"},
468 {37, kRight | kUpper | kBase, /*width = */ 0, "37"},
469 {37, kRight | kUpper | kBase, /*width = */ 6, "____37"},
470 {37, kRight | kUpper | kBase | kPos, /*width = */ 0, "37"},
471 {37, kRight | kUpper | kBase | kPos, /*width = */ 6, "____37"},
472 {37, kDec, /*width = */ 0, "37"},
473 {37, kDec, /*width = */ 6, "____37"},
474 {37, kDec | kPos, /*width = */ 0, "37"},
475 {37, kDec | kPos, /*width = */ 6, "____37"},
476 {37, kDec | kBase, /*width = */ 0, "37"},
477 {37, kDec | kBase, /*width = */ 6, "____37"},
478 {37, kDec | kBase | kPos, /*width = */ 0, "37"},
479 {37, kDec | kBase | kPos, /*width = */ 6, "____37"},
480 {37, kDec | kUpper, /*width = */ 0, "37"},
481 {37, kDec | kUpper, /*width = */ 6, "____37"},
482 {37, kDec | kUpper | kPos, /*width = */ 0, "37"},
483 {37, kDec | kUpper | kPos, /*width = */ 6, "____37"},
484 {37, kDec | kUpper | kBase, /*width = */ 0, "37"},
485 {37, kDec | kUpper | kBase, /*width = */ 6, "____37"},
486 {37, kDec | kUpper | kBase | kPos, /*width = */ 0, "37"},
487 {37, kDec | kUpper | kBase | kPos, /*width = */ 6, "____37"},
488 {37, kDec | kLeft, /*width = */ 0, "37"},
489 {37, kDec | kLeft, /*width = */ 6, "37____"},
490 {37, kDec | kLeft | kPos, /*width = */ 0, "37"},
491 {37, kDec | kLeft | kPos, /*width = */ 6, "37____"},
492 {37, kDec | kLeft | kBase, /*width = */ 0, "37"},
493 {37, kDec | kLeft | kBase, /*width = */ 6, "37____"},
494 {37, kDec | kLeft | kBase | kPos, /*width = */ 0, "37"},
495 {37, kDec | kLeft | kBase | kPos, /*width = */ 6, "37____"},
496 {37, kDec | kLeft | kUpper, /*width = */ 0, "37"},
497 {37, kDec | kLeft | kUpper, /*width = */ 6, "37____"},
498 {37, kDec | kLeft | kUpper | kPos, /*width = */ 0, "37"},
499 {37, kDec | kLeft | kUpper | kPos, /*width = */ 6, "37____"},
500 {37, kDec | kLeft | kUpper | kBase, /*width = */ 0, "37"},
501 {37, kDec | kLeft | kUpper | kBase, /*width = */ 6, "37____"},
502 {37, kDec | kLeft | kUpper | kBase | kPos, /*width = */ 0, "37"},
503 {37, kDec | kLeft | kUpper | kBase | kPos, /*width = */ 6, "37____"},
504 {37, kDec | kInt, /*width = */ 0, "37"},
505 {37, kDec | kInt, /*width = */ 6, "____37"},
506 {37, kDec | kInt | kPos, /*width = */ 0, "37"},
507 {37, kDec | kInt | kPos, /*width = */ 6, "____37"},
508 {37, kDec | kInt | kBase, /*width = */ 0, "37"},
509 {37, kDec | kInt | kBase, /*width = */ 6, "____37"},
510 {37, kDec | kInt | kBase | kPos, /*width = */ 0, "37"},
511 {37, kDec | kInt | kBase | kPos, /*width = */ 6, "____37"},
512 {37, kDec | kInt | kUpper, /*width = */ 0, "37"},
513 {37, kDec | kInt | kUpper, /*width = */ 6, "____37"},
514 {37, kDec | kInt | kUpper | kPos, /*width = */ 0, "37"},
515 {37, kDec | kInt | kUpper | kPos, /*width = */ 6, "____37"},
516 {37, kDec | kInt | kUpper | kBase, /*width = */ 0, "37"},
517 {37, kDec | kInt | kUpper | kBase, /*width = */ 6, "____37"},
518 {37, kDec | kInt | kUpper | kBase | kPos, /*width = */ 0, "37"},
519 {37, kDec | kInt | kUpper | kBase | kPos, /*width = */ 6, "____37"},
520 {37, kDec | kRight, /*width = */ 0, "37"},
521 {37, kDec | kRight, /*width = */ 6, "____37"},
522 {37, kDec | kRight | kPos, /*width = */ 0, "37"},
523 {37, kDec | kRight | kPos, /*width = */ 6, "____37"},
524 {37, kDec | kRight | kBase, /*width = */ 0, "37"},
525 {37, kDec | kRight | kBase, /*width = */ 6, "____37"},
526 {37, kDec | kRight | kBase | kPos, /*width = */ 0, "37"},
527 {37, kDec | kRight | kBase | kPos, /*width = */ 6, "____37"},
528 {37, kDec | kRight | kUpper, /*width = */ 0, "37"},
529 {37, kDec | kRight | kUpper, /*width = */ 6, "____37"},
530 {37, kDec | kRight | kUpper | kPos, /*width = */ 0, "37"},
531 {37, kDec | kRight | kUpper | kPos, /*width = */ 6, "____37"},
532 {37, kDec | kRight | kUpper | kBase, /*width = */ 0, "37"},
533 {37, kDec | kRight | kUpper | kBase, /*width = */ 6, "____37"},
534 {37, kDec | kRight | kUpper | kBase | kPos, /*width = */ 0, "37"},
535 {37, kDec | kRight | kUpper | kBase | kPos, /*width = */ 6, "____37"},
536 {37, kOct, /*width = */ 0, "45"},
537 {37, kOct, /*width = */ 6, "____45"},
538 {37, kOct | kPos, /*width = */ 0, "45"},
539 {37, kOct | kPos, /*width = */ 6, "____45"},
540 {37, kOct | kBase, /*width = */ 0, "045"},
541 {37, kOct | kBase, /*width = */ 6, "___045"},
542 {37, kOct | kBase | kPos, /*width = */ 0, "045"},
543 {37, kOct | kBase | kPos, /*width = */ 6, "___045"},
544 {37, kOct | kUpper, /*width = */ 0, "45"},
545 {37, kOct | kUpper, /*width = */ 6, "____45"},
546 {37, kOct | kUpper | kPos, /*width = */ 0, "45"},
547 {37, kOct | kUpper | kPos, /*width = */ 6, "____45"},
548 {37, kOct | kUpper | kBase, /*width = */ 0, "045"},
549 {37, kOct | kUpper | kBase, /*width = */ 6, "___045"},
550 {37, kOct | kUpper | kBase | kPos, /*width = */ 0, "045"},
551 {37, kOct | kUpper | kBase | kPos, /*width = */ 6, "___045"},
552 {37, kOct | kLeft, /*width = */ 0, "45"},
553 {37, kOct | kLeft, /*width = */ 6, "45____"},
554 {37, kOct | kLeft | kPos, /*width = */ 0, "45"},
555 {37, kOct | kLeft | kPos, /*width = */ 6, "45____"},
556 {37, kOct | kLeft | kBase, /*width = */ 0, "045"},
557 {37, kOct | kLeft | kBase, /*width = */ 6, "045___"},
558 {37, kOct | kLeft | kBase | kPos, /*width = */ 0, "045"},
559 {37, kOct | kLeft | kBase | kPos, /*width = */ 6, "045___"},
560 {37, kOct | kLeft | kUpper, /*width = */ 0, "45"},
561 {37, kOct | kLeft | kUpper, /*width = */ 6, "45____"},
562 {37, kOct | kLeft | kUpper | kPos, /*width = */ 0, "45"},
563 {37, kOct | kLeft | kUpper | kPos, /*width = */ 6, "45____"},
564 {37, kOct | kLeft | kUpper | kBase, /*width = */ 0, "045"},
565 {37, kOct | kLeft | kUpper | kBase, /*width = */ 6, "045___"},
566 {37, kOct | kLeft | kUpper | kBase | kPos, /*width = */ 0, "045"},
567 {37, kOct | kLeft | kUpper | kBase | kPos, /*width = */ 6, "045___"},
568 {37, kOct | kInt, /*width = */ 0, "45"},
569 {37, kOct | kInt, /*width = */ 6, "____45"},
570 {37, kOct | kInt | kPos, /*width = */ 0, "45"},
571 {37, kOct | kInt | kPos, /*width = */ 6, "____45"},
572 {37, kOct | kInt | kBase, /*width = */ 0, "045"},
573 {37, kOct | kInt | kBase, /*width = */ 6, "___045"},
574 {37, kOct | kInt | kBase | kPos, /*width = */ 0, "045"},
575 {37, kOct | kInt | kBase | kPos, /*width = */ 6, "___045"},
576 {37, kOct | kInt | kUpper, /*width = */ 0, "45"},
577 {37, kOct | kInt | kUpper, /*width = */ 6, "____45"},
578 {37, kOct | kInt | kUpper | kPos, /*width = */ 0, "45"},
579 {37, kOct | kInt | kUpper | kPos, /*width = */ 6, "____45"},
580 {37, kOct | kInt | kUpper | kBase, /*width = */ 0, "045"},
581 {37, kOct | kInt | kUpper | kBase, /*width = */ 6, "___045"},
582 {37, kOct | kInt | kUpper | kBase | kPos, /*width = */ 0, "045"},
583 {37, kOct | kInt | kUpper | kBase | kPos, /*width = */ 6, "___045"},
584 {37, kOct | kRight, /*width = */ 0, "45"},
585 {37, kOct | kRight, /*width = */ 6, "____45"},
586 {37, kOct | kRight | kPos, /*width = */ 0, "45"},
587 {37, kOct | kRight | kPos, /*width = */ 6, "____45"},
588 {37, kOct | kRight | kBase, /*width = */ 0, "045"},
589 {37, kOct | kRight | kBase, /*width = */ 6, "___045"},
590 {37, kOct | kRight | kBase | kPos, /*width = */ 0, "045"},
591 {37, kOct | kRight | kBase | kPos, /*width = */ 6, "___045"},
592 {37, kOct | kRight | kUpper, /*width = */ 0, "45"},
593 {37, kOct | kRight | kUpper, /*width = */ 6, "____45"},
594 {37, kOct | kRight | kUpper | kPos, /*width = */ 0, "45"},
595 {37, kOct | kRight | kUpper | kPos, /*width = */ 6, "____45"},
596 {37, kOct | kRight | kUpper | kBase, /*width = */ 0, "045"},
597 {37, kOct | kRight | kUpper | kBase, /*width = */ 6, "___045"},
598 {37, kOct | kRight | kUpper | kBase | kPos, /*width = */ 0, "045"},
599 {37, kOct | kRight | kUpper | kBase | kPos, /*width = */ 6, "___045"},
600 {37, kHex, /*width = */ 0, "25"},
601 {37, kHex, /*width = */ 6, "____25"},
602 {37, kHex | kPos, /*width = */ 0, "25"},
603 {37, kHex | kPos, /*width = */ 6, "____25"},
604 {37, kHex | kBase, /*width = */ 0, "0x25"},
605 {37, kHex | kBase, /*width = */ 6, "__0x25"},
606 {37, kHex | kBase | kPos, /*width = */ 0, "0x25"},
607 {37, kHex | kBase | kPos, /*width = */ 6, "__0x25"},
608 {37, kHex | kUpper, /*width = */ 0, "25"},
609 {37, kHex | kUpper, /*width = */ 6, "____25"},
610 {37, kHex | kUpper | kPos, /*width = */ 0, "25"},
611 {37, kHex | kUpper | kPos, /*width = */ 6, "____25"},
612 {37, kHex | kUpper | kBase, /*width = */ 0, "0X25"},
613 {37, kHex | kUpper | kBase, /*width = */ 6, "__0X25"},
614 {37, kHex | kUpper | kBase | kPos, /*width = */ 0, "0X25"},
615 {37, kHex | kUpper | kBase | kPos, /*width = */ 6, "__0X25"},
616 {37, kHex | kLeft, /*width = */ 0, "25"},
617 {37, kHex | kLeft, /*width = */ 6, "25____"},
618 {37, kHex | kLeft | kPos, /*width = */ 0, "25"},
619 {37, kHex | kLeft | kPos, /*width = */ 6, "25____"},
620 {37, kHex | kLeft | kBase, /*width = */ 0, "0x25"},
621 {37, kHex | kLeft | kBase, /*width = */ 6, "0x25__"},
622 {37, kHex | kLeft | kBase | kPos, /*width = */ 0, "0x25"},
623 {37, kHex | kLeft | kBase | kPos, /*width = */ 6, "0x25__"},
624 {37, kHex | kLeft | kUpper, /*width = */ 0, "25"},
625 {37, kHex | kLeft | kUpper, /*width = */ 6, "25____"},
626 {37, kHex | kLeft | kUpper | kPos, /*width = */ 0, "25"},
627 {37, kHex | kLeft | kUpper | kPos, /*width = */ 6, "25____"},
628 {37, kHex | kLeft | kUpper | kBase, /*width = */ 0, "0X25"},
629 {37, kHex | kLeft | kUpper | kBase, /*width = */ 6, "0X25__"},
630 {37, kHex | kLeft | kUpper | kBase | kPos, /*width = */ 0, "0X25"},
631 {37, kHex | kLeft | kUpper | kBase | kPos, /*width = */ 6, "0X25__"},
632 {37, kHex | kInt, /*width = */ 0, "25"},
633 {37, kHex | kInt, /*width = */ 6, "____25"},
634 {37, kHex | kInt | kPos, /*width = */ 0, "25"},
635 {37, kHex | kInt | kPos, /*width = */ 6, "____25"},
636 {37, kHex | kInt | kBase, /*width = */ 0, "0x25"},
637 {37, kHex | kInt | kBase, /*width = */ 6, "0x__25"},
638 {37, kHex | kInt | kBase | kPos, /*width = */ 0, "0x25"},
639 {37, kHex | kInt | kBase | kPos, /*width = */ 6, "0x__25"},
640 {37, kHex | kInt | kUpper, /*width = */ 0, "25"},
641 {37, kHex | kInt | kUpper, /*width = */ 6, "____25"},
642 {37, kHex | kInt | kUpper | kPos, /*width = */ 0, "25"},
643 {37, kHex | kInt | kUpper | kPos, /*width = */ 6, "____25"},
644 {37, kHex | kInt | kUpper | kBase, /*width = */ 0, "0X25"},
645 {37, kHex | kInt | kUpper | kBase, /*width = */ 6, "0X__25"},
646 {37, kHex | kInt | kUpper | kBase | kPos, /*width = */ 0, "0X25"},
647 {37, kHex | kInt | kUpper | kBase | kPos, /*width = */ 6, "0X__25"},
648 {37, kHex | kRight, /*width = */ 0, "25"},
649 {37, kHex | kRight, /*width = */ 6, "____25"},
650 {37, kHex | kRight | kPos, /*width = */ 0, "25"},
651 {37, kHex | kRight | kPos, /*width = */ 6, "____25"},
652 {37, kHex | kRight | kBase, /*width = */ 0, "0x25"},
653 {37, kHex | kRight | kBase, /*width = */ 6, "__0x25"},
654 {37, kHex | kRight | kBase | kPos, /*width = */ 0, "0x25"},
655 {37, kHex | kRight | kBase | kPos, /*width = */ 6, "__0x25"},
656 {37, kHex | kRight | kUpper, /*width = */ 0, "25"},
657 {37, kHex | kRight | kUpper, /*width = */ 6, "____25"},
658 {37, kHex | kRight | kUpper | kPos, /*width = */ 0, "25"},
659 {37, kHex | kRight | kUpper | kPos, /*width = */ 6, "____25"},
660 {37, kHex | kRight | kUpper | kBase, /*width = */ 0, "0X25"},
661 {37, kHex | kRight | kUpper | kBase, /*width = */ 6, "__0X25"},
662 {37, kHex | kRight | kUpper | kBase | kPos, /*width = */ 0, "0X25"},
663 {37, kHex | kRight | kUpper | kBase | kPos, /*width = */ 6, "__0X25"}};
664}
665
666} // namespace