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

Unified Diff: util/file/string_file_test.cc

Issue 1416493006: Change file op |ssize_t|s to FileOperationResult (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 2 months 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
« no previous file with comments | « util/file/string_file.cc ('k') | util/net/http_body.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/file/string_file_test.cc
diff --git a/util/file/string_file_test.cc b/util/file/string_file_test.cc
index e2a8214b26182c9f7cd1d4dd92cc1637ed827cc6..0990daf0a9a98b17c607bcfbbf1b0318aeba5ce1 100644
--- a/util/file/string_file_test.cc
+++ b/util/file/string_file_test.cc
@@ -197,13 +197,16 @@ TEST(StringFile, WriteInvalid) {
EXPECT_EQ(0, string_file.Seek(0, SEEK_CUR));
EXPECT_FALSE(string_file.Write(
- "", implicit_cast<size_t>(std::numeric_limits<ssize_t>::max()) + 1));
+ "",
+ implicit_cast<size_t>(std::numeric_limits<FileOperationResult>::max()) +
+ 1));
EXPECT_TRUE(string_file.string().empty());
EXPECT_EQ(0, string_file.Seek(0, SEEK_CUR));
EXPECT_TRUE(string_file.Write("a", 1));
EXPECT_FALSE(string_file.Write(
- "", implicit_cast<size_t>(std::numeric_limits<ssize_t>::max())));
+ "",
+ implicit_cast<size_t>(std::numeric_limits<FileOperationResult>::max())));
EXPECT_EQ(1u, string_file.string().size());
EXPECT_EQ("a", string_file.string());
EXPECT_EQ(1, string_file.Seek(0, SEEK_CUR));
@@ -290,7 +293,7 @@ TEST(StringFile, WriteIoVecInvalid) {
WritableIoVec iov;
EXPECT_EQ(1, string_file.Seek(1, SEEK_CUR));
iov.iov_base = "a";
- iov.iov_len = std::numeric_limits<ssize_t>::max();
+ iov.iov_len = std::numeric_limits<FileOperationResult>::max();
iovecs.push_back(iov);
EXPECT_FALSE(string_file.WriteIoVec(&iovecs));
EXPECT_TRUE(string_file.string().empty());
@@ -300,7 +303,7 @@ TEST(StringFile, WriteIoVecInvalid) {
iov.iov_base = "a";
iov.iov_len = 1;
iovecs.push_back(iov);
- iov.iov_len = std::numeric_limits<ssize_t>::max() - 1;
+ iov.iov_len = std::numeric_limits<FileOperationResult>::max() - 1;
iovecs.push_back(iov);
EXPECT_FALSE(string_file.WriteIoVec(&iovecs));
EXPECT_TRUE(string_file.string().empty());
@@ -449,7 +452,9 @@ TEST(StringFile, SeekInvalid) {
EXPECT_EQ(1, string_file.Seek(0, SEEK_CUR));
EXPECT_LT(string_file.Seek(-1, SEEK_SET), 0);
EXPECT_EQ(1, string_file.Seek(0, SEEK_CUR));
- EXPECT_LT(string_file.Seek(std::numeric_limits<ssize_t>::min(), SEEK_SET), 0);
+ EXPECT_LT(string_file.Seek(std::numeric_limits<FileOperationResult>::min(),
+ SEEK_SET),
+ 0);
EXPECT_EQ(1, string_file.Seek(0, SEEK_CUR));
EXPECT_LT(string_file.Seek(std::numeric_limits<FileOffset>::min(), SEEK_SET),
0);
@@ -487,7 +492,8 @@ TEST(StringFile, SeekSet) {
EXPECT_EQ(10, string_file.Seek(0, SEEK_CUR));
EXPECT_FALSE(string_file.SeekSet(-1));
EXPECT_EQ(10, string_file.Seek(0, SEEK_CUR));
- EXPECT_FALSE(string_file.SeekSet(std::numeric_limits<ssize_t>::min()));
+ EXPECT_FALSE(
+ string_file.SeekSet(std::numeric_limits<FileOperationResult>::min()));
EXPECT_EQ(10, string_file.Seek(0, SEEK_CUR));
EXPECT_FALSE(string_file.SeekSet(std::numeric_limits<FileOffset>::min()));
EXPECT_EQ(10, string_file.Seek(0, SEEK_CUR));
« no previous file with comments | « util/file/string_file.cc ('k') | util/net/http_body.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698