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

Unified Diff: ppapi/tests/test_host_resolver.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ppapi_unittests win x64 Created 5 years, 10 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 | « ppapi/tests/test_flash_file.cc ('k') | ppapi/tests/test_host_resolver_private.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_host_resolver.cc
diff --git a/ppapi/tests/test_host_resolver.cc b/ppapi/tests/test_host_resolver.cc
index 2bb501245414daea23801da92eb3bc6c10e3e538..27ecae1339228e8ff00a9530df3533005edeee1f 100644
--- a/ppapi/tests/test_host_resolver.cc
+++ b/ppapi/tests/test_host_resolver.cc
@@ -85,10 +85,12 @@ std::string TestHostResolver::CheckHTTPResponse(pp::TCPSocket* socket,
const std::string& response) {
int32_t rv = 0;
ASSERT_SUBTEST_SUCCESS(
- SyncWrite(socket, request.c_str(), request.size(), &rv));
+ SyncWrite(socket, request.c_str(), static_cast<int32_t>(request.size()),
+ &rv));
std::vector<char> response_buffer(response.size());
ASSERT_SUBTEST_SUCCESS(
- SyncRead(socket, &response_buffer[0], response.size(), &rv));
+ SyncRead(socket, &response_buffer[0],
+ static_cast<int32_t>(response.size()), &rv));
std::string actual_response(&response_buffer[0], rv);
if (response != actual_response) {
return "CheckHTTPResponse failed, expected: " + response +
@@ -121,7 +123,7 @@ std::string TestHostResolver::ParameterizedTestResolve(
pp::NetAddress address;
for (size_t i = 0; i < size; ++i) {
- address = host_resolver.GetNetAddress(i);
+ address = host_resolver.GetNetAddress(static_cast<uint32_t>(i));
ASSERT_NE(0, address.pp_resource());
pp::TCPSocket socket(instance_);
@@ -132,7 +134,7 @@ std::string TestHostResolver::ParameterizedTestResolve(
socket.Close();
}
- address = host_resolver.GetNetAddress(size);
+ address = host_resolver.GetNetAddress(static_cast<uint32_t>(size));
ASSERT_EQ(0, address.pp_resource());
pp::Var canonical_name = host_resolver.GetCanonicalName();
ASSERT_TRUE(canonical_name.is_string());
« no previous file with comments | « ppapi/tests/test_flash_file.cc ('k') | ppapi/tests/test_host_resolver_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698