From e06d524c9ead3610896c3488c48e296b8bbf3fe4 Mon Sep 17 00:00:00 2001 From: Florin Iucha Date: Sat, 30 Nov 2019 17:25:50 -0500 Subject: [PATCH] Clean-up sign-conversion warning with 128-bit value --- test/format-test.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/format-test.cc b/test/format-test.cc index aebd6943..c201d02f 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -2005,9 +2005,11 @@ class mock_arg_formatter : public fmt::internal::arg_formatter_base { private: #if FMT_USE_INT128 - MOCK_METHOD1(call, void(__int128_t value)); + MOCK_METHOD1(callSigned, void(__int128_t value)); + MOCK_METHOD1(callUnsigned, void(__uint128_t value)); #else - MOCK_METHOD1(call, void(long long value)); + MOCK_METHOD1(callSigned, void(long long value)); + MOCK_METHOD1(callUnsigned, void(unsigned long long value)); #endif public: @@ -2017,13 +2019,20 @@ class mock_arg_formatter mock_arg_formatter(fmt::format_context& ctx, fmt::format_parse_context*, fmt::format_specs* s = nullptr) : base(fmt::internal::get_container(ctx.out()), s, ctx.locale()) { - EXPECT_CALL(*this, call(42)); + EXPECT_CALL(*this, callSigned(42)); } template - typename std::enable_if::value, iterator>::type + typename std::enable_if::value && std::is_signed::value, iterator>::type operator()(T value) { - call(value); + callSigned(value); + return base::operator()(value); + } + + template + typename std::enable_if::value && !std::is_signed::value, iterator>::type + operator()(T value) { + callUnsigned(value); return base::operator()(value); }