Fix large shift in uint128_fallback

This commit is contained in:
Victor Zverovich
2022-07-10 08:14:18 -07:00
parent e1d3d3a326
commit 2a1b3ac629
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -59,6 +59,8 @@ TEST(uint128_test, shift) {
EXPECT_EQ(static_cast<uint64_t>(n), 0x8000000000000000);
n = n >> 62;
EXPECT_EQ(static_cast<uint64_t>(n), 42);
EXPECT_EQ(uint128_fallback(1) << 112, uint128_fallback(0x1000000000000, 0));
EXPECT_EQ(uint128_fallback(0x1000000000000, 0) >> 112, uint128_fallback(1));
}
TEST(uint128_test, minus) {
@@ -234,7 +236,7 @@ TEST(util_test, format_system_error) {
throws_on_alloc = true;
}
if (!throws_on_alloc) {
fmt::print("warning: std::allocator allocates {} chars", max_size);
fmt::print("warning: std::allocator allocates {} chars\n", max_size);
return;
}
}