Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Unified Diff: util/file/string_file_writer_test.cc

Issue 700383007: Use implicit_cast<> instead of static_cast<> whenever possible (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: util/file/string_file_writer_test.cc
diff --git a/util/file/string_file_writer_test.cc b/util/file/string_file_writer_test.cc
index d6ea2e496a1e3be4c2ce6e14e60da3d0e11adf83..ea26db3df6461756978a24a487144858dbbcf0d2 100644
--- a/util/file/string_file_writer_test.cc
+++ b/util/file/string_file_writer_test.cc
@@ -101,13 +101,13 @@ TEST(StringFileWriter, WriteInvalid) {
EXPECT_EQ(0, writer.Seek(0, SEEK_CUR));
EXPECT_FALSE(writer.Write(
- "", static_cast<size_t>(std::numeric_limits<ssize_t>::max()) + 1));
+ "", implicit_cast<size_t>(std::numeric_limits<ssize_t>::max()) + 1));
EXPECT_TRUE(writer.string().empty());
EXPECT_EQ(0, writer.Seek(0, SEEK_CUR));
EXPECT_TRUE(writer.Write("a", 1));
EXPECT_FALSE(writer.Write(
- "", static_cast<size_t>(std::numeric_limits<ssize_t>::max())));
+ "", implicit_cast<size_t>(std::numeric_limits<ssize_t>::max())));
EXPECT_EQ(1u, writer.string().size());
EXPECT_EQ("a", writer.string());
EXPECT_EQ(1, writer.Seek(0, SEEK_CUR));
@@ -363,8 +363,8 @@ TEST(StringFileWriter, SeekInvalid) {
EXPECT_TRUE(writer.string().empty());
const off_t kMaxOffset =
- std::min(static_cast<uint64_t>(std::numeric_limits<off_t>::max()),
- static_cast<uint64_t>(std::numeric_limits<size_t>::max()));
+ std::min(implicit_cast<uint64_t>(std::numeric_limits<off_t>::max()),
+ implicit_cast<uint64_t>(std::numeric_limits<size_t>::max()));
EXPECT_EQ(kMaxOffset, writer.Seek(kMaxOffset, SEEK_SET));
EXPECT_EQ(kMaxOffset, writer.Seek(0, SEEK_CUR));

Powered by Google App Engine
This is Rietveld 408576698