diff --git a/absl/base/BUILD.bazel b/absl/base/BUILD.bazel index e52846334..743add7e0 100644 --- a/absl/base/BUILD.bazel +++ b/absl/base/BUILD.bazel @@ -241,6 +241,7 @@ cc_library( "//absl/memory", "//absl/meta:type_traits", "//absl/strings", + "//absl/types:optional", "@com_google_googletest//:gtest", ], ) diff --git a/absl/base/exception_safety_testing_test.cc b/absl/base/exception_safety_testing_test.cc index 4931c8865..20cbb4359 100644 --- a/absl/base/exception_safety_testing_test.cc +++ b/absl/base/exception_safety_testing_test.cc @@ -384,70 +384,62 @@ struct CallOperator { } }; -struct FailsBasicGuarantee { +struct NonNegative { + friend testing::AssertionResult AbslCheckInvariants(NonNegative* g) { + if (g->i >= 0) return testing::AssertionSuccess(); + return testing::AssertionFailure() + << "i should be non-negative but is " << g->i; + } + bool operator==(const NonNegative& other) const { return i == other.i; } + + int i; +}; + +template +struct DefaultFactory { + std::unique_ptr operator()() const { return absl::make_unique(); } +}; + +struct FailsBasicGuarantee : public NonNegative { void operator()() { --i; ThrowingValue<> bomb; ++i; } - - bool operator==(const FailsBasicGuarantee& other) const { - return i == other.i; - } - - friend testing::AssertionResult AbslCheckInvariants( - const FailsBasicGuarantee& g) { - if (g.i >= 0) return testing::AssertionSuccess(); - return testing::AssertionFailure() - << "i should be non-negative but is " << g.i; - } - - int i = 0; }; TEST(ExceptionCheckTest, BasicGuaranteeFailure) { - FailsBasicGuarantee g; - EXPECT_FALSE(TestExceptionSafety(&g, CallOperator{})); + EXPECT_FALSE(TestExceptionSafety(DefaultFactory(), + CallOperator{})); } -struct FollowsBasicGuarantee { +struct FollowsBasicGuarantee : public NonNegative { void operator()() { ++i; ThrowingValue<> bomb; } - - bool operator==(const FollowsBasicGuarantee& other) const { - return i == other.i; - } - - friend testing::AssertionResult AbslCheckInvariants( - const FollowsBasicGuarantee& g) { - if (g.i >= 0) return testing::AssertionSuccess(); - return testing::AssertionFailure() - << "i should be non-negative but is " << g.i; - } - - int i = 0; }; TEST(ExceptionCheckTest, BasicGuarantee) { - FollowsBasicGuarantee g; - EXPECT_TRUE(TestExceptionSafety(&g, CallOperator{})); + EXPECT_TRUE(TestExceptionSafety(DefaultFactory(), + CallOperator{})); } TEST(ExceptionCheckTest, StrongGuaranteeFailure) { { - FailsBasicGuarantee g; - EXPECT_FALSE(TestExceptionSafety(&g, CallOperator{}, StrongGuarantee(g))); + DefaultFactory factory; + EXPECT_FALSE( + TestExceptionSafety(factory, CallOperator{}, StrongGuarantee(factory))); } { - FollowsBasicGuarantee g; - EXPECT_FALSE(TestExceptionSafety(&g, CallOperator{}, StrongGuarantee(g))); + DefaultFactory factory; + EXPECT_FALSE( + TestExceptionSafety(factory, CallOperator{}, StrongGuarantee(factory))); } } -struct BasicGuaranteeWithExtraInvariants { +struct BasicGuaranteeWithExtraInvariants : public NonNegative { // After operator(), i is incremented. If operator() throws, i is set to 9999 void operator()() { int old_i = i; @@ -456,92 +448,94 @@ struct BasicGuaranteeWithExtraInvariants { i = ++old_i; } - bool operator==(const FollowsBasicGuarantee& other) const { - return i == other.i; - } - - friend testing::AssertionResult AbslCheckInvariants( - const BasicGuaranteeWithExtraInvariants& g) { - if (g.i >= 0) return testing::AssertionSuccess(); - return testing::AssertionFailure() - << "i should be non-negative but is " << g.i; - } - - int i = 0; static constexpr int kExceptionSentinel = 9999; }; constexpr int BasicGuaranteeWithExtraInvariants::kExceptionSentinel; TEST(ExceptionCheckTest, BasicGuaranteeWithInvariants) { - { - BasicGuaranteeWithExtraInvariants g; - EXPECT_TRUE(TestExceptionSafety(&g, CallOperator{})); - } + DefaultFactory factory; - { - BasicGuaranteeWithExtraInvariants g; - EXPECT_TRUE(TestExceptionSafety( - &g, CallOperator{}, [](const BasicGuaranteeWithExtraInvariants& w) { - if (w.i == BasicGuaranteeWithExtraInvariants::kExceptionSentinel) { - return testing::AssertionSuccess(); - } - return testing::AssertionFailure() - << "i should be " - << BasicGuaranteeWithExtraInvariants::kExceptionSentinel - << ", but is " << w.i; - })); - } + EXPECT_TRUE(TestExceptionSafety(factory, CallOperator{})); + + EXPECT_TRUE(TestExceptionSafety( + factory, CallOperator{}, [](BasicGuaranteeWithExtraInvariants* w) { + if (w->i == BasicGuaranteeWithExtraInvariants::kExceptionSentinel) { + return testing::AssertionSuccess(); + } + return testing::AssertionFailure() + << "i should be " + << BasicGuaranteeWithExtraInvariants::kExceptionSentinel + << ", but is " << w->i; + })); } -struct FollowsStrongGuarantee { +struct FollowsStrongGuarantee : public NonNegative { void operator()() { ThrowingValue<> bomb; } - - bool operator==(const FollowsStrongGuarantee& other) const { - return i == other.i; - } - - friend testing::AssertionResult AbslCheckInvariants( - const FollowsStrongGuarantee& g) { - if (g.i >= 0) return testing::AssertionSuccess(); - return testing::AssertionFailure() - << "i should be non-negative but is " << g.i; - } - - int i = 0; }; TEST(ExceptionCheckTest, StrongGuarantee) { - FollowsStrongGuarantee g; - EXPECT_TRUE(TestExceptionSafety(&g, CallOperator{})); - EXPECT_TRUE(TestExceptionSafety(&g, CallOperator{}, StrongGuarantee(g))); + DefaultFactory factory; + EXPECT_TRUE(TestExceptionSafety(factory, CallOperator{})); + EXPECT_TRUE( + TestExceptionSafety(factory, CallOperator{}, StrongGuarantee(factory))); } -struct NonCopyable { - NonCopyable(const NonCopyable&) = delete; - explicit NonCopyable(int ii) : i(ii) {} - - void operator()() { ThrowingValue<> bomb; } - - bool operator==(const NonCopyable& other) const { return i == other.i; } - - friend testing::AssertionResult AbslCheckInvariants(const NonCopyable& g) { - if (g.i >= 0) return testing::AssertionSuccess(); - return testing::AssertionFailure() - << "i should be non-negative but is " << g.i; +struct HasReset : public NonNegative { + void operator()() { + i = -1; + ThrowingValue<> bomb; + i = 1; } - int i; + void reset() { i = 0; } + + friend bool AbslCheckInvariants(HasReset* h) { + h->reset(); + return h->i == 0; + } +}; + +TEST(ExceptionCheckTest, ModifyingChecker) { + { + DefaultFactory factory; + EXPECT_FALSE(TestExceptionSafety( + factory, CallOperator{}, + [](FollowsBasicGuarantee* g) { + g->i = 1000; + return true; + }, + [](FollowsBasicGuarantee* g) { return g->i == 1000; })); + } + { + DefaultFactory factory; + EXPECT_TRUE(TestExceptionSafety(factory, CallOperator{}, + [](FollowsStrongGuarantee* g) { + ++g->i; + return true; + }, + StrongGuarantee(factory))); + } + { + DefaultFactory factory; + EXPECT_TRUE(TestExceptionSafety(factory, CallOperator{})); + } +} + +struct NonCopyable : public NonNegative { + NonCopyable(const NonCopyable&) = delete; + NonCopyable() : NonNegative{0} {} + + void operator()() { ThrowingValue<> bomb; } }; TEST(ExceptionCheckTest, NonCopyable) { - NonCopyable g(0); - EXPECT_TRUE(TestExceptionSafety(&g, CallOperator{})); - EXPECT_TRUE(TestExceptionSafety( - &g, CallOperator{}, - PointeeStrongGuarantee(absl::make_unique(g.i)))); + DefaultFactory factory; + EXPECT_TRUE(TestExceptionSafety(factory, CallOperator{})); + EXPECT_TRUE( + TestExceptionSafety(factory, CallOperator{}, StrongGuarantee(factory))); } -struct NonEqualityComparable { +struct NonEqualityComparable : public NonNegative { void operator()() { ThrowingValue<> bomb; } void ModifyOnThrow() { @@ -550,71 +544,61 @@ struct NonEqualityComparable { static_cast(bomb); --i; } - - friend testing::AssertionResult AbslCheckInvariants( - const NonEqualityComparable& g) { - if (g.i >= 0) return testing::AssertionSuccess(); - return testing::AssertionFailure() - << "i should be non-negative but is " << g.i; - } - - int i = 0; }; TEST(ExceptionCheckTest, NonEqualityComparable) { - NonEqualityComparable g; + DefaultFactory factory; auto comp = [](const NonEqualityComparable& a, const NonEqualityComparable& b) { return a.i == b.i; }; - EXPECT_TRUE(TestExceptionSafety(&g, CallOperator{})); - EXPECT_TRUE( - TestExceptionSafety(&g, CallOperator{}, absl::StrongGuarantee(g, comp))); + EXPECT_TRUE(TestExceptionSafety(factory, CallOperator{})); + EXPECT_TRUE(TestExceptionSafety(factory, CallOperator{}, + absl::StrongGuarantee(factory, comp))); EXPECT_FALSE(TestExceptionSafety( - &g, [&](NonEqualityComparable* n) { n->ModifyOnThrow(); }, - absl::StrongGuarantee(g, comp))); + factory, [&](NonEqualityComparable* n) { n->ModifyOnThrow(); }, + absl::StrongGuarantee(factory, comp))); } template -struct InstructionCounter { +struct ExhaustivenessTester { void operator()() { - ++counter; + successes |= 1; T b1; static_cast(b1); - ++counter; + successes |= (1 << 1); T b2; static_cast(b2); - ++counter; + successes |= (1 << 2); T b3; static_cast(b3); - ++counter; + successes |= (1 << 3); } - bool operator==(const InstructionCounter>&) const { + bool operator==(const ExhaustivenessTester>&) const { return true; } - friend testing::AssertionResult AbslCheckInvariants( - const InstructionCounter&) { + friend testing::AssertionResult AbslCheckInvariants(ExhaustivenessTester*) { return testing::AssertionSuccess(); } - static int counter; + static unsigned char successes; }; template -int InstructionCounter::counter = 0; +unsigned char ExhaustivenessTester::successes = 0; TEST(ExceptionCheckTest, Exhaustiveness) { - InstructionCounter int_factory; - EXPECT_TRUE(TestExceptionSafety(&int_factory, CallOperator{})); - EXPECT_EQ(InstructionCounter::counter, 4); + DefaultFactory> int_factory; + EXPECT_TRUE(TestExceptionSafety(int_factory, CallOperator{})); + EXPECT_EQ(ExhaustivenessTester::successes, 0xF); - InstructionCounter> bomb_factory; - EXPECT_TRUE(TestExceptionSafety(&bomb_factory, CallOperator{})); - EXPECT_EQ(InstructionCounter>::counter, 10); + DefaultFactory>> bomb_factory; + EXPECT_TRUE(TestExceptionSafety(bomb_factory, CallOperator{})); + EXPECT_EQ(ExhaustivenessTester>::successes, 0xF); - InstructionCounter>::counter = 0; - EXPECT_TRUE(TestExceptionSafety(&bomb_factory, CallOperator{}, + ExhaustivenessTester>::successes = 0; + EXPECT_TRUE(TestExceptionSafety(bomb_factory, CallOperator{}, StrongGuarantee(bomb_factory))); - EXPECT_EQ(InstructionCounter>::counter, 10); + EXPECT_EQ(ExhaustivenessTester>::successes, 0xF); } struct LeaksIfCtorThrows : private exceptions_internal::TrackedObject { diff --git a/absl/base/internal/exception_safety_testing.h b/absl/base/internal/exception_safety_testing.h index a0a70d91d..05bcd0ab5 100644 --- a/absl/base/internal/exception_safety_testing.h +++ b/absl/base/internal/exception_safety_testing.h @@ -18,6 +18,7 @@ #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" +#include "absl/types/optional.h" namespace absl { struct AllocInspector; @@ -97,19 +98,50 @@ class TrackedObject { friend struct ::absl::AllocInspector; }; -template -testing::AssertionResult TestInvariants(const T& t, const TestException& e, - int count, - const Checkers&... checkers) { - auto out = AbslCheckInvariants(t); - // Don't bother with the checkers if the class invariants are already broken. - bool dummy[] = {true, - (out && (out = testing::AssertionResult(checkers(t))))...}; - static_cast(dummy); +template +using FactoryType = typename absl::result_of_t::element_type; - return out ? out - : out << " Caused by exception " << count << "thrown by " - << e.what(); +// Returns an optional with the result of the check if op fails, or an empty +// optional if op passes +template +absl::optional TestCheckerAtCountdown( + Factory factory, const Op& op, int count, const Checker& check) { + exceptions_internal::countdown = count; + auto t_ptr = factory(); + absl::optional out; + try { + op(t_ptr.get()); + } catch (const exceptions_internal::TestException& e) { + out.emplace(check(t_ptr.get())); + if (!*out) { + *out << " caused by exception thrown by " << e.what(); + } + } + return out; +} + +template +int UpdateOut(Factory factory, const Op& op, int count, const Checker& checker, + testing::AssertionResult* out) { + if (*out) *out = *TestCheckerAtCountdown(factory, op, count, checker); + return 0; +} + +// Returns an optional with the result of the check if op fails, or an empty +// optional if op passes +template +absl::optional TestAtCountdown( + Factory factory, const Op& op, int count, const Checkers&... checkers) { + // Don't bother with the checkers if the class invariants are already broken. + auto out = TestCheckerAtCountdown( + factory, op, count, + [](FactoryType* t_ptr) { return AbslCheckInvariants(t_ptr); }); + if (!out.has_value()) return out; + + // Run each checker, short circuiting after the first failure + int dummy[] = {0, (UpdateOut(factory, op, count, checkers, &*out))...}; + static_cast(dummy); + return out; } template @@ -118,9 +150,9 @@ class StrongGuaranteeTester { explicit StrongGuaranteeTester(std::unique_ptr t_ptr, EqualTo eq) noexcept : val_(std::move(t_ptr)), eq_(eq) {} - testing::AssertionResult operator()(const T& other) const { - return eq_(*val_, other) ? testing::AssertionSuccess() - : testing::AssertionFailure() << "State changed"; + testing::AssertionResult operator()(T* other) const { + return eq_(*val_, *other) ? testing::AssertionSuccess() + : testing::AssertionFailure() << "State changed"; } private: @@ -673,58 +705,52 @@ T TestThrowingCtor(Args&&... args) { } // Tests that performing operation Op on a T follows exception safety -// guarantees. By default only tests the basic guarantee. +// guarantees. By default only tests the basic guarantee. There must be a +// function, AbslCheckInvariants(T*) which returns +// anything convertible to bool and which makes sure the invariants of the type +// are upheld. This is called before any of the checkers. // // Parameters: -// * T: the type under test. +// * TFactory: operator() returns a unique_ptr to the type under test (T). It +// should always return pointers to values which compare equal. // * FunctionFromTPtrToVoid: A functor exercising the function under test. It // should take a T* and return void. -// * Checkers: Any number of functions taking a const T& and returning +// * Checkers: Any number of functions taking a T* and returning // anything contextually convertible to bool. If a testing::AssertionResult // is used then the error message is kept. These test invariants related to // the operation. To test the strong guarantee, pass -// absl::StrongGuarantee(...) as one of these arguments if T has operator==. -// Some types for which the strong guarantee makes sense don't have operator== -// (eg std::any). A function capturing *t or a T equal to it, taking a const -// T&, and returning contextually-convertible-to-bool may be passed instead. -template -testing::AssertionResult TestExceptionSafety(T* t, FunctionFromTPtrToVoid&& op, +// absl::StrongGuarantee(factory). A checker may freely modify the passed-in +// T, for example to make sure the T can be set to a known state. +template +testing::AssertionResult TestExceptionSafety(TFactory factory, + FunctionFromTPtrToVoid&& op, const Checkers&... checkers) { - auto out = testing::AssertionSuccess(); for (int countdown = 0;; ++countdown) { - exceptions_internal::countdown = countdown; - try { - op(t); - break; - } catch (const exceptions_internal::TestException& e) { - out = exceptions_internal::TestInvariants(*t, e, countdown, checkers...); - if (!out) return out; + auto out = exceptions_internal::TestAtCountdown(factory, op, countdown, + checkers...); + if (!out.has_value()) { + UnsetCountdown(); + return testing::AssertionSuccess(); } + if (!*out) return *out; } - UnsetCountdown(); - return out; } -// Returns a functor to test for the strong exception-safety guarantee. If T is -// copyable, use the const T& overload, otherwise pass a unique_ptr. -// Equality comparisons are made against the T provided and default to using -// operator==. See the documentation for TestExceptionSafety if T doesn't have -// operator== but the strong guarantee still makes sense for it. +// Returns a functor to test for the strong exception-safety guarantee. +// Equality comparisons are made against the T provided by the factory and +// default to using operator==. // // Parameters: -// * T: The type under test. -template > -exceptions_internal::StrongGuaranteeTester StrongGuarantee( - const T& t, EqualTo eq = EqualTo()) { - return exceptions_internal::StrongGuaranteeTester( - absl::make_unique(t), eq); -} - -template > -exceptions_internal::StrongGuaranteeTester PointeeStrongGuarantee( - std::unique_ptr t_ptr, EqualTo eq = EqualTo()) { - return exceptions_internal::StrongGuaranteeTester( - std::move(t_ptr), eq); +// * TFactory: operator() returns a unique_ptr to the type under test. It +// should always return pointers to values which compare equal. +template >> +exceptions_internal::StrongGuaranteeTester< + exceptions_internal::FactoryType, EqualTo> +StrongGuarantee(TFactory factory, EqualTo eq = EqualTo()) { + return exceptions_internal::StrongGuaranteeTester< + exceptions_internal::FactoryType, EqualTo>(factory(), eq); } } // namespace absl diff --git a/absl/numeric/BUILD.bazel b/absl/numeric/BUILD.bazel index c118d013c..26d04774a 100644 --- a/absl/numeric/BUILD.bazel +++ b/absl/numeric/BUILD.bazel @@ -28,6 +28,7 @@ cc_test( size = "small", srcs = [ "int128_test.cc", + "int128_test_unsigned_ostream_cases.inc", ], copts = ABSL_TEST_COPTS, deps = [ diff --git a/absl/numeric/int128.cc b/absl/numeric/int128.cc index 5081def5e..73a8f737a 100644 --- a/absl/numeric/int128.cc +++ b/absl/numeric/int128.cc @@ -192,9 +192,8 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) { rep.append(width - rep.size(), o.fill()); } else if (adjustfield == std::ios::internal && (flags & std::ios::showbase) && - (flags & std::ios::basefield) != std::ios::dec) { - size_t base_size = (flags & std::ios::basefield) == std::ios::hex ? 2 : 1; - rep.insert(base_size, width - rep.size(), o.fill()); + (flags & std::ios::basefield) == std::ios::hex && b != 0) { + rep.insert(2, width - rep.size(), o.fill()); } else { rep.insert(0, width - rep.size(), o.fill()); } diff --git a/absl/numeric/int128_test.cc b/absl/numeric/int128_test.cc index 46d5546f9..ce44cd4b9 100644 --- a/absl/numeric/int128_test.cc +++ b/absl/numeric/int128_test.cc @@ -428,79 +428,18 @@ TEST(Uint128, ConstexprTest) { } TEST(Uint128, OStream) { - struct { + struct StreamCase { absl::uint128 val; std::ios_base::fmtflags flags; std::streamsize width; char fill; const char* rep; - } cases[] = { - // zero with different bases - {absl::uint128(0), std::ios::dec, 0, '_', "0"}, - {absl::uint128(0), std::ios::oct, 0, '_', "0"}, - {absl::uint128(0), std::ios::hex, 0, '_', "0"}, - // crossover between lo_ and hi_ - {absl::MakeUint128(0, -1), std::ios::dec, 0, '_', "18446744073709551615"}, - {absl::MakeUint128(0, -1), std::ios::oct, 0, '_', - "1777777777777777777777"}, - {absl::MakeUint128(0, -1), std::ios::hex, 0, '_', "ffffffffffffffff"}, - {absl::MakeUint128(1, 0), std::ios::dec, 0, '_', "18446744073709551616"}, - {absl::MakeUint128(1, 0), std::ios::oct, 0, '_', - "2000000000000000000000"}, - {absl::MakeUint128(1, 0), std::ios::hex, 0, '_', "10000000000000000"}, - // just the top bit - {absl::MakeUint128(0x8000000000000000, 0), std::ios::dec, 0, '_', - "170141183460469231731687303715884105728"}, - {absl::MakeUint128(0x8000000000000000, 0), std::ios::oct, 0, '_', - "2000000000000000000000000000000000000000000"}, - {absl::MakeUint128(0x8000000000000000, 0), std::ios::hex, 0, '_', - "80000000000000000000000000000000"}, - // maximum absl::uint128 value - {absl::MakeUint128(-1, -1), std::ios::dec, 0, '_', - "340282366920938463463374607431768211455"}, - {absl::MakeUint128(-1, -1), std::ios::oct, 0, '_', - "3777777777777777777777777777777777777777777"}, - {absl::MakeUint128(-1, -1), std::ios::hex, 0, '_', - "ffffffffffffffffffffffffffffffff"}, - // uppercase - {absl::MakeUint128(-1, -1), std::ios::hex | std::ios::uppercase, 0, '_', - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"}, - // showbase - {absl::uint128(1), std::ios::dec | std::ios::showbase, 0, '_', "1"}, - {absl::uint128(1), std::ios::oct | std::ios::showbase, 0, '_', "01"}, - {absl::uint128(1), std::ios::hex | std::ios::showbase, 0, '_', "0x1"}, - // showbase does nothing on zero - {absl::uint128(0), std::ios::dec | std::ios::showbase, 0, '_', "0"}, - {absl::uint128(0), std::ios::oct | std::ios::showbase, 0, '_', "0"}, - {absl::uint128(0), std::ios::hex | std::ios::showbase, 0, '_', "0"}, - // showpos does nothing on unsigned types - {absl::uint128(1), std::ios::dec | std::ios::showpos, 0, '_', "1"}, - // right adjustment - {absl::uint128(9), std::ios::dec, 6, '_', "_____9"}, - {absl::uint128(12345), std::ios::dec, 6, '_', "_12345"}, - {absl::uint128(31), std::ios::hex | std::ios::showbase, 6, '_', "__0x1f"}, - {absl::uint128(7), std::ios::oct | std::ios::showbase, 6, '_', "____07"}, - // left adjustment - {absl::uint128(9), std::ios::dec | std::ios::left, 6, '_', "9_____"}, - {absl::uint128(12345), std::ios::dec | std::ios::left, 6, '_', "12345_"}, - {absl::uint128(31), std::ios::hex | std::ios::left | std::ios::showbase, - 6, '_', "0x1f__"}, - {absl::uint128(7), std::ios::oct | std::ios::left | std::ios::showbase, 6, - '_', "07____"}, - // internal adjustment - {absl::uint128(123), - std::ios::dec | std::ios::internal | std::ios::showbase, 6, '_', - "___123"}, - {absl::uint128(31), - std::ios::hex | std::ios::internal | std::ios::showbase, 6, '_', - "0x__1f"}, - {absl::uint128(7), - std::ios::oct | std::ios::internal | std::ios::showbase, 6, '_', - "0____7"}, - {absl::uint128(34), std::ios::hex | std::ios::internal, 6, '_', "____22"}, - {absl::uint128(9), std::ios::oct | std::ios::internal, 6, '_', "____11"}, }; - for (const auto& test_case : cases) { + + std::vector cases = { +#include "absl/numeric/int128_test_unsigned_ostream_cases.inc" + }; + for (const StreamCase& test_case : cases) { std::ostringstream os; os.flags(test_case.flags); os.width(test_case.width); diff --git a/absl/numeric/int128_test_unsigned_ostream_cases.inc b/absl/numeric/int128_test_unsigned_ostream_cases.inc new file mode 100644 index 000000000..7d2fc77f1 --- /dev/null +++ b/absl/numeric/int128_test_unsigned_ostream_cases.inc @@ -0,0 +1,880 @@ +// A small set of cases created manually for values greater than 2^64. + +{absl::MakeUint128(1, 0), std::ios::dec, 0, '_', "18446744073709551616"}, +{absl::MakeUint128(1, 0), std::ios::oct, 0, '_', "2000000000000000000000"}, +{absl::MakeUint128(1, 0), std::ios::hex, 0, '_', "10000000000000000"}, +{absl::MakeUint128(0x8000000000000000, 0), std::ios::dec, 0, '_', "170141183460469231731687303715884105728"}, +{absl::MakeUint128(0x8000000000000000, 0), std::ios::oct, 0, '_', "2000000000000000000000000000000000000000000"}, +{absl::MakeUint128(0x8000000000000000, 0), std::ios::hex, 0, '_', "80000000000000000000000000000000"}, +{absl::MakeUint128(-1, -1), std::ios::dec, 0, '_', "340282366920938463463374607431768211455"}, +{absl::MakeUint128(-1, -1), std::ios::oct, 0, '_', "3777777777777777777777777777777777777777777"}, +{absl::MakeUint128(-1, -1), std::ios::hex, 0, '_', "ffffffffffffffffffffffffffffffff"}, + +// An exhaustive set of formatting cases generated with select values that fit +// into a uint64_t so they can be compared to what was output by the standard +// implementation. + +{0, std::ios::dec | std::ios::left, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::left | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::left | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left | std::ios::showbase, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::dec | std::ios::internal, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::internal | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::internal | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::left, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::left | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::left | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left | std::ios::showbase, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::oct | std::ios::internal, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::internal | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::internal | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::left, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::left | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::left | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left | std::ios::showbase, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0_________"}, +{0, std::ios::hex | std::ios::internal, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::internal | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::internal | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_________0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0"}, +{0, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________0"}, +{8, std::ios::dec | std::ios::left, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::left | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left | std::ios::showpos, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::left | std::ios::showbase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left | std::ios::showbase, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "8_________"}, +{8, std::ios::dec | std::ios::internal, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::internal | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::internal | std::ios::showbase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal | std::ios::showbase, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right | std::ios::showbase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right | std::ios::showbase, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_________8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::oct | std::ios::left, 0, '_', "10"}, +{8, std::ios::oct | std::ios::left, 10, '_', "10________"}, +{8, std::ios::oct | std::ios::left | std::ios::showpos, 0, '_', "10"}, +{8, std::ios::oct | std::ios::left | std::ios::showpos, 10, '_', "10________"}, +{8, std::ios::oct | std::ios::left | std::ios::showbase, 0, '_', "010"}, +{8, std::ios::oct | std::ios::left | std::ios::showbase, 10, '_', "010_______"}, +{8, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "010"}, +{8, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "010_______"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase, 0, '_', "10"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase, 10, '_', "10________"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "10"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "10________"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "010"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "010_______"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "010"}, +{8, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "010_______"}, +{8, std::ios::oct | std::ios::internal, 0, '_', "10"}, +{8, std::ios::oct | std::ios::internal, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::internal | std::ios::showpos, 0, '_', "10"}, +{8, std::ios::oct | std::ios::internal | std::ios::showpos, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::internal | std::ios::showbase, 0, '_', "010"}, +{8, std::ios::oct | std::ios::internal | std::ios::showbase, 10, '_', "_______010"}, +{8, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "010"}, +{8, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "_______010"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase, 0, '_', "10"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "10"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "010"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "_______010"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "010"}, +{8, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_______010"}, +{8, std::ios::oct | std::ios::right, 0, '_', "10"}, +{8, std::ios::oct | std::ios::right, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::right | std::ios::showpos, 0, '_', "10"}, +{8, std::ios::oct | std::ios::right | std::ios::showpos, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::right | std::ios::showbase, 0, '_', "010"}, +{8, std::ios::oct | std::ios::right | std::ios::showbase, 10, '_', "_______010"}, +{8, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "010"}, +{8, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_______010"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase, 0, '_', "10"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "10"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "________10"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "010"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_______010"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "010"}, +{8, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_______010"}, +{8, std::ios::hex | std::ios::left, 0, '_', "8"}, +{8, std::ios::hex | std::ios::left, 10, '_', "8_________"}, +{8, std::ios::hex | std::ios::left | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::hex | std::ios::left | std::ios::showpos, 10, '_', "8_________"}, +{8, std::ios::hex | std::ios::left | std::ios::showbase, 0, '_', "0x8"}, +{8, std::ios::hex | std::ios::left | std::ios::showbase, 10, '_', "0x8_______"}, +{8, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0x8"}, +{8, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0x8_______"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase, 0, '_', "8"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase, 10, '_', "8_________"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "8_________"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0X8"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0X8_______"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X8"}, +{8, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X8_______"}, +{8, std::ios::hex | std::ios::internal, 0, '_', "8"}, +{8, std::ios::hex | std::ios::internal, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::internal | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::hex | std::ios::internal | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::internal | std::ios::showbase, 0, '_', "0x8"}, +{8, std::ios::hex | std::ios::internal | std::ios::showbase, 10, '_', "0x_______8"}, +{8, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0x8"}, +{8, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "0x_______8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase, 0, '_', "8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0X8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "0X_______8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X8"}, +{8, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X_______8"}, +{8, std::ios::hex | std::ios::right, 0, '_', "8"}, +{8, std::ios::hex | std::ios::right, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::right | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::hex | std::ios::right | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::right | std::ios::showbase, 0, '_', "0x8"}, +{8, std::ios::hex | std::ios::right | std::ios::showbase, 10, '_', "_______0x8"}, +{8, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0x8"}, +{8, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_______0x8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase, 0, '_', "8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "_________8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0X8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_______0X8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X8"}, +{8, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_______0X8"}, +{31, std::ios::dec | std::ios::left, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::left | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left | std::ios::showpos, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::left | std::ios::showbase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left | std::ios::showbase, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "31________"}, +{31, std::ios::dec | std::ios::internal, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::internal | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::internal | std::ios::showbase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal | std::ios::showbase, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right | std::ios::showbase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right | std::ios::showbase, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "________31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "31"}, +{31, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "________31"}, +{31, std::ios::oct | std::ios::left, 0, '_', "37"}, +{31, std::ios::oct | std::ios::left, 10, '_', "37________"}, +{31, std::ios::oct | std::ios::left | std::ios::showpos, 0, '_', "37"}, +{31, std::ios::oct | std::ios::left | std::ios::showpos, 10, '_', "37________"}, +{31, std::ios::oct | std::ios::left | std::ios::showbase, 0, '_', "037"}, +{31, std::ios::oct | std::ios::left | std::ios::showbase, 10, '_', "037_______"}, +{31, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "037"}, +{31, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "037_______"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase, 0, '_', "37"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase, 10, '_', "37________"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "37"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "37________"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "037"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "037_______"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "037"}, +{31, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "037_______"}, +{31, std::ios::oct | std::ios::internal, 0, '_', "37"}, +{31, std::ios::oct | std::ios::internal, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::internal | std::ios::showpos, 0, '_', "37"}, +{31, std::ios::oct | std::ios::internal | std::ios::showpos, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::internal | std::ios::showbase, 0, '_', "037"}, +{31, std::ios::oct | std::ios::internal | std::ios::showbase, 10, '_', "_______037"}, +{31, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "037"}, +{31, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "_______037"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase, 0, '_', "37"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "37"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "037"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "_______037"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "037"}, +{31, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_______037"}, +{31, std::ios::oct | std::ios::right, 0, '_', "37"}, +{31, std::ios::oct | std::ios::right, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::right | std::ios::showpos, 0, '_', "37"}, +{31, std::ios::oct | std::ios::right | std::ios::showpos, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::right | std::ios::showbase, 0, '_', "037"}, +{31, std::ios::oct | std::ios::right | std::ios::showbase, 10, '_', "_______037"}, +{31, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "037"}, +{31, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_______037"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase, 0, '_', "37"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "37"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "________37"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "037"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_______037"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "037"}, +{31, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_______037"}, +{31, std::ios::hex | std::ios::left, 0, '_', "1f"}, +{31, std::ios::hex | std::ios::left, 10, '_', "1f________"}, +{31, std::ios::hex | std::ios::left | std::ios::showpos, 0, '_', "1f"}, +{31, std::ios::hex | std::ios::left | std::ios::showpos, 10, '_', "1f________"}, +{31, std::ios::hex | std::ios::left | std::ios::showbase, 0, '_', "0x1f"}, +{31, std::ios::hex | std::ios::left | std::ios::showbase, 10, '_', "0x1f______"}, +{31, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0x1f"}, +{31, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0x1f______"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase, 0, '_', "1F"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase, 10, '_', "1F________"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "1F"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "1F________"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0X1F"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0X1F______"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X1F"}, +{31, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X1F______"}, +{31, std::ios::hex | std::ios::internal, 0, '_', "1f"}, +{31, std::ios::hex | std::ios::internal, 10, '_', "________1f"}, +{31, std::ios::hex | std::ios::internal | std::ios::showpos, 0, '_', "1f"}, +{31, std::ios::hex | std::ios::internal | std::ios::showpos, 10, '_', "________1f"}, +{31, std::ios::hex | std::ios::internal | std::ios::showbase, 0, '_', "0x1f"}, +{31, std::ios::hex | std::ios::internal | std::ios::showbase, 10, '_', "0x______1f"}, +{31, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0x1f"}, +{31, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "0x______1f"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase, 0, '_', "1F"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase, 10, '_', "________1F"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "1F"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "________1F"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0X1F"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "0X______1F"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X1F"}, +{31, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X______1F"}, +{31, std::ios::hex | std::ios::right, 0, '_', "1f"}, +{31, std::ios::hex | std::ios::right, 10, '_', "________1f"}, +{31, std::ios::hex | std::ios::right | std::ios::showpos, 0, '_', "1f"}, +{31, std::ios::hex | std::ios::right | std::ios::showpos, 10, '_', "________1f"}, +{31, std::ios::hex | std::ios::right | std::ios::showbase, 0, '_', "0x1f"}, +{31, std::ios::hex | std::ios::right | std::ios::showbase, 10, '_', "______0x1f"}, +{31, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0x1f"}, +{31, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "______0x1f"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase, 0, '_', "1F"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase, 10, '_', "________1F"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "1F"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "________1F"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0X1F"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "______0X1F"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X1F"}, +{31, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "______0X1F"}, +{12345, std::ios::dec | std::ios::left, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::left | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left | std::ios::showpos, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::left | std::ios::showbase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left | std::ios::showbase, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "12345_____"}, +{12345, std::ios::dec | std::ios::internal, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::showbase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::showbase, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::showbase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::showbase, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "_____12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "12345"}, +{12345, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "_____12345"}, +{12345, std::ios::oct | std::ios::left, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::left, 10, '_', "30071_____"}, +{12345, std::ios::oct | std::ios::left | std::ios::showpos, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::left | std::ios::showpos, 10, '_', "30071_____"}, +{12345, std::ios::oct | std::ios::left | std::ios::showbase, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::left | std::ios::showbase, 10, '_', "030071____"}, +{12345, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "030071____"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase, 10, '_', "30071_____"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "30071_____"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "030071____"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "030071____"}, +{12345, std::ios::oct | std::ios::internal, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::internal, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::showpos, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::showpos, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::showbase, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::showbase, 10, '_', "____030071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "____030071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "____030071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "____030071"}, +{12345, std::ios::oct | std::ios::right, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::right, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::right | std::ios::showpos, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::right | std::ios::showpos, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::right | std::ios::showbase, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::right | std::ios::showbase, 10, '_', "____030071"}, +{12345, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "____030071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "30071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "_____30071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "____030071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "030071"}, +{12345, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "____030071"}, +{12345, std::ios::hex | std::ios::left, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::left, 10, '_', "3039______"}, +{12345, std::ios::hex | std::ios::left | std::ios::showpos, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::left | std::ios::showpos, 10, '_', "3039______"}, +{12345, std::ios::hex | std::ios::left | std::ios::showbase, 0, '_', "0x3039"}, +{12345, std::ios::hex | std::ios::left | std::ios::showbase, 10, '_', "0x3039____"}, +{12345, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0x3039"}, +{12345, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0x3039____"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase, 10, '_', "3039______"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "3039______"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0X3039"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0X3039____"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X3039"}, +{12345, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X3039____"}, +{12345, std::ios::hex | std::ios::internal, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::internal, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::showpos, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::showpos, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::showbase, 0, '_', "0x3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::showbase, 10, '_', "0x____3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0x3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "0x____3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0X3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "0X____3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X3039"}, +{12345, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X____3039"}, +{12345, std::ios::hex | std::ios::right, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::right, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::showpos, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::showpos, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::showbase, 0, '_', "0x3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::showbase, 10, '_', "____0x3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0x3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "____0x3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "______3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0X3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "____0X3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X3039"}, +{12345, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "____0X3039"}, +{0x8000000000000000, std::ios::dec | std::ios::left, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::showbase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::showbase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::showbase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::showbase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::showbase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::showbase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "9223372036854775808"}, +{0x8000000000000000, std::ios::oct | std::ios::left, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::showpos, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::showpos, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::showbase, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::showbase, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::showpos, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::showpos, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::showbase, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::showbase, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::showpos, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::showpos, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::showbase, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::showbase, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "1000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "01000000000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::showpos, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::showpos, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::showbase, 0, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::showbase, 10, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::showpos, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::showpos, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::showbase, 0, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::showbase, 10, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::showpos, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::showpos, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::showbase, 0, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::showbase, 10, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "0x8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0X8000000000000000"}, +{0x8000000000000000, std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0X8000000000000000"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::showbase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::showbase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::showbase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::showbase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::showbase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::showbase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::dec | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "18446744073709551615"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::showpos, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::showpos, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::showbase, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::showbase, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::showpos, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::showpos, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::showbase, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::showbase, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::showpos, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::showpos, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::showbase, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::showbase, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "1777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::oct | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "01777777777777777777777"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left, 0, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left, 10, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::showpos, 0, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::showpos, 10, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::showbase, 0, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::showbase, 10, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 0, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::showbase | std::ios::showpos, 10, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase, 0, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase, 10, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 0, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showpos, 10, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 0, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase, 10, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::left | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal, 0, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal, 10, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::showpos, 0, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::showpos, 10, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::showbase, 0, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::showbase, 10, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 0, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::showbase | std::ios::showpos, 10, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase, 0, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase, 10, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 0, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showpos, 10, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 0, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase, 10, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::internal | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right, 0, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right, 10, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::showpos, 0, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::showpos, 10, '_', "ffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::showbase, 0, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::showbase, 10, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 0, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::showbase | std::ios::showpos, 10, '_', "0xffffffffffffffff"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase, 0, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase, 10, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 0, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showpos, 10, '_', "FFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 0, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase, 10, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 0, '_', "0XFFFFFFFFFFFFFFFF"}, +{std::numeric_limits::max(), std::ios::hex | std::ios::right | std::ios::uppercase | std::ios::showbase | std::ios::showpos, 10, '_', "0XFFFFFFFFFFFFFFFF"}, diff --git a/absl/strings/str_join.h b/absl/strings/str_join.h index 82a3cac2d..47337490d 100644 --- a/absl/strings/str_join.h +++ b/absl/strings/str_join.h @@ -208,11 +208,11 @@ DereferenceFormatter() { // // Joins a `std::map`, with each key-value pair separated by an equals // // sign. This pattern would also work with, say, a // // `std::vector>`. -// std::map m = { -// std::make_pair("a", 1), -// std::make_pair("b", 2), -// std::make_pair("c", 3)}; -// std::string s = absl::StrJoin(m, ",", strings::PairFormatter("=")); +// std::map m = { +// std::make_pair("a", 1), +// std::make_pair("b", 2), +// std::make_pair("c", 3)}; +// std::string s = absl::StrJoin(m, ",", absl::PairFormatter("=")); // EXPECT_EQ("a=1,b=2,c=3", s); // // Example 7: diff --git a/absl/strings/str_split_test.cc b/absl/strings/str_split_test.cc index 22a68d0f8..9c79d7dcd 100644 --- a/absl/strings/str_split_test.cc +++ b/absl/strings/str_split_test.cc @@ -857,12 +857,10 @@ TEST(Delimiter, ByLength) { EXPECT_FALSE(IsFoundAt("abcd", four_char_delim, 0)); } -// Allocates too much memory for TSan and MSan. -#if !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) TEST(Split, WorksWithLargeStrings) { - if (sizeof(size_t) > 4 && !RunningOnValgrind()) { - std::string s(1ULL << 31, 'x'); - s.push_back('-'); // 2G + 1 byte + if (sizeof(size_t) > 4) { + std::string s((uint32_t{1} << 31) + 1, 'x'); // 2G + 1 byte + s.back() = '-'; std::vector v = absl::StrSplit(s, '-'); EXPECT_EQ(2, v.size()); // The first element will contain 2G of 'x's. @@ -873,7 +871,6 @@ TEST(Split, WorksWithLargeStrings) { EXPECT_EQ("", v[1]); } } -#endif // THREAD_SANITIZER TEST(SplitInternalTest, TypeTraits) { EXPECT_FALSE(absl::strings_internal::HasMappedType::value); diff --git a/absl/synchronization/BUILD.bazel b/absl/synchronization/BUILD.bazel index 4faf62de5..5e190c559 100644 --- a/absl/synchronization/BUILD.bazel +++ b/absl/synchronization/BUILD.bazel @@ -190,3 +190,19 @@ cc_test( "@com_google_googletest//:gtest_main", ], ) + +cc_test( + name = "lifetime_test", + srcs = [ + "lifetime_test.cc", + ], + copts = ABSL_TEST_COPTS, + linkopts = select({ + "//absl:windows": [], + "//conditions:default": ["-pthread"], + }), + deps = [ + ":synchronization", + "//absl/base", + ], +) diff --git a/absl/synchronization/lifetime_test.cc b/absl/synchronization/lifetime_test.cc new file mode 100644 index 000000000..6aea60e13 --- /dev/null +++ b/absl/synchronization/lifetime_test.cc @@ -0,0 +1,95 @@ +// Copyright 2017 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include // NOLINT(build/c++11), Abseil test +#include + +#include "absl/base/attributes.h" +#include "absl/base/internal/raw_logging.h" +#include "absl/synchronization/mutex.h" +#include "absl/synchronization/notification.h" + +namespace { + +// A two-threaded test which checks that Mutex, CondVar, and Notification have +// correct basic functionality. The intent is to establish that they +// function correctly in various phases of construction and destruction. +// +// Thread one acquires a lock on 'mutex', wakes thread two via 'notification', +// then waits for 'state' to be set, as signalled by 'condvar'. +// +// Thread two waits on 'notification', then sets 'state' inside the 'mutex', +// signalling the change via 'condvar'. +// +// These tests use ABSL_RAW_CHECK to validate invariants, rather than EXPECT or +// ASSERT from gUnit, because we need to invoke them during global destructors, +// when gUnit teardown would have already begun. +void ThreadOne(absl::Mutex* mutex, absl::CondVar* condvar, + absl::Notification* notification, bool* state) { + // Test that the notification is in a valid initial state. + ABSL_RAW_CHECK(!notification->HasBeenNotified(), "invalid Notification"); + ABSL_RAW_CHECK(*state == false, "*state not initialized"); + + { + absl::MutexLock lock(mutex); + + notification->Notify(); + ABSL_RAW_CHECK(notification->HasBeenNotified(), "invalid Notification"); + + while (*state == false) { + condvar->Wait(mutex); + } + } +} + +void ThreadTwo(absl::Mutex* mutex, absl::CondVar* condvar, + absl::Notification* notification, bool* state) { + ABSL_RAW_CHECK(*state == false, "*state not initialized"); + + // Wake thread one + notification->WaitForNotification(); + ABSL_RAW_CHECK(notification->HasBeenNotified(), "invalid Notification"); + { + absl::MutexLock lock(mutex); + *state = true; + condvar->Signal(); + } +} + +// Launch thread 1 and thread 2, and block on their completion. +void RunTests(absl::Mutex* mutex, absl::CondVar* condvar, + absl::Notification* notification) { + bool state = false; + std::thread thread_one(ThreadOne, mutex, condvar, notification, &state); + std::thread thread_two(ThreadTwo, mutex, condvar, notification, &state); + thread_one.join(); + thread_two.join(); +} + +void TestLocals() { + absl::Mutex mutex; + absl::CondVar condvar; + absl::Notification notification; + RunTests(&mutex, &condvar, ¬ification); +} + +} // namespace + +int main() { + TestLocals(); + // Explicitly call exit(0) here, to make it clear that we intend for the + // above global object destructors to run. + std::exit(0); +}