Refactor fallback ints

This commit is contained in:
Victor Zverovich
2022-02-17 20:24:42 -08:00
parent 15c2a3bacc
commit d38f72aff2
4 changed files with 30 additions and 26 deletions
+1 -1
View File
@@ -361,7 +361,7 @@ TEST(format_impl_test, write_fallback_uintptr) {
std::string s;
fmt::detail::write_ptr<char>(
std::back_inserter(s),
fmt::detail::fallback_uintptr(reinterpret_cast<void*>(0xface)), nullptr);
fmt::detail::uintptr_fallback(reinterpret_cast<void*>(0xface)), nullptr);
EXPECT_EQ(s, "0xface");
}
+5 -5
View File
@@ -40,16 +40,16 @@ using testing::StrictMock;
enum { buffer_size = 256 };
TEST(uint128_test, ctor) {
using fmt::detail::uint128_t;
auto n = uint128_t();
using fmt::detail::uint128_fallback;
auto n = uint128_fallback();
EXPECT_EQ(n, 0);
n = uint128_t(42);
n = uint128_fallback(42);
EXPECT_EQ(n, 42);
EXPECT_EQ(static_cast<uint64_t>(n), 42);
}
TEST(uint128_test, shift) {
auto n = fmt::detail::uint128_t(42);
auto n = fmt::detail::uint128_fallback(42);
n = n << 64;
EXPECT_EQ(static_cast<uint64_t>(n), 0);
n = n >> 64;
@@ -62,7 +62,7 @@ TEST(uint128_test, shift) {
}
TEST(uint128_test, minus) {
auto n = fmt::detail::uint128_t(42);
auto n = fmt::detail::uint128_fallback(42);
EXPECT_EQ(n - 2, 40);
}