diff options
Diffstat (limited to 'absl/crc/crc32c_test.cc')
-rw-r--r-- | absl/crc/crc32c_test.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/absl/crc/crc32c_test.cc b/absl/crc/crc32c_test.cc index 72d422a1..635424aa 100644 --- a/absl/crc/crc32c_test.cc +++ b/absl/crc/crc32c_test.cc @@ -18,6 +18,7 @@ #include <cstddef> #include <cstdint> #include <cstring> +#include <sstream> #include <string> #include "gtest/gtest.h" @@ -191,4 +192,22 @@ TEST(CRC32C, RemoveSuffix) { EXPECT_EQ(absl::RemoveCrc32cSuffix(crc_ab, crc_b, world.size()), crc_a); } + +TEST(CRC32C, InsertionOperator) { + { + std::ostringstream buf; + buf << absl::crc32c_t{0xc99465aa}; + EXPECT_EQ(buf.str(), "c99465aa"); + } + { + std::ostringstream buf; + buf << absl::crc32c_t{0}; + EXPECT_EQ(buf.str(), "00000000"); + } + { + std::ostringstream buf; + buf << absl::crc32c_t{17}; + EXPECT_EQ(buf.str(), "00000011"); + } +} } // namespace |