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

Side by Side Diff: util/net/http_body_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 unified diff | Download patch
« no previous file with comments | « util/net/http_body.cc ('k') | util/net/http_body_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 29 matching lines...) Expand all
40 EXPECT_EQ(0, stream.GetBytesBuffer(buf, sizeof(buf))); 40 EXPECT_EQ(0, stream.GetBytesBuffer(buf, sizeof(buf)));
41 ExpectBufferSet(buf, '!', sizeof(buf)); 41 ExpectBufferSet(buf, '!', sizeof(buf));
42 } 42 }
43 43
44 TEST(StringHTTPBodyStream, SmallString) { 44 TEST(StringHTTPBodyStream, SmallString) {
45 uint8_t buf[32]; 45 uint8_t buf[32];
46 memset(buf, '!', sizeof(buf)); 46 memset(buf, '!', sizeof(buf));
47 47
48 std::string string("Hello, world"); 48 std::string string("Hello, world");
49 StringHTTPBodyStream stream(string); 49 StringHTTPBodyStream stream(string);
50 EXPECT_EQ(implicit_cast<ssize_t>(string.length()), 50 EXPECT_EQ(implicit_cast<FileOperationResult>(string.length()),
51 stream.GetBytesBuffer(buf, sizeof(buf))); 51 stream.GetBytesBuffer(buf, sizeof(buf)));
52 52
53 std::string actual(reinterpret_cast<const char*>(buf), string.length()); 53 std::string actual(reinterpret_cast<const char*>(buf), string.length());
54 EXPECT_EQ(string, actual); 54 EXPECT_EQ(string, actual);
55 ExpectBufferSet(buf + string.length(), '!', sizeof(buf) - string.length()); 55 ExpectBufferSet(buf + string.length(), '!', sizeof(buf) - string.length());
56 56
57 EXPECT_EQ(0, stream.GetBytesBuffer(buf, sizeof(buf))); 57 EXPECT_EQ(0, stream.GetBytesBuffer(buf, sizeof(buf)));
58 } 58 }
59 59
60 TEST(StringHTTPBodyStream, MultipleReads) { 60 TEST(StringHTTPBodyStream, MultipleReads) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 EXPECT_EQ(expected_string, actual_string); 209 EXPECT_EQ(expected_string, actual_string);
210 } 210 }
211 211
212 INSTANTIATE_TEST_CASE_P(VariableBufferSize, 212 INSTANTIATE_TEST_CASE_P(VariableBufferSize,
213 CompositeHTTPBodyStreamBufferSize, 213 CompositeHTTPBodyStreamBufferSize,
214 testing::Values(1, 2, 9, 16, 31, 128, 1024)); 214 testing::Values(1, 2, 9, 16, 31, 128, 1024));
215 215
216 } // namespace 216 } // namespace
217 } // namespace test 217 } // namespace test
218 } // namespace crashpad 218 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/net/http_body.cc ('k') | util/net/http_body_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698