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

Unified Diff: ppapi/tests/test_host_resolver_private.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_host_resolver.cc ('k') | ppapi/tests/test_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_host_resolver_private.cc
diff --git a/ppapi/tests/test_host_resolver_private.cc b/ppapi/tests/test_host_resolver_private.cc
index 88429eddf24cbb01d73a5245fb62ec7a4f27dc9f..e13cb99214231b63320f382003bfe1cc9290241e 100644
--- a/ppapi/tests/test_host_resolver_private.cc
+++ b/ppapi/tests/test_host_resolver_private.cc
@@ -100,10 +100,12 @@ std::string TestHostResolverPrivate::CheckHTTPResponse(
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 +
@@ -144,7 +146,8 @@ std::string TestHostResolverPrivate::ParametrizedTestResolve(
PP_NetAddress_Private address;
for (size_t i = 0; i < size; ++i) {
- ASSERT_TRUE(host_resolver.GetNetAddress(i, &address));
+ ASSERT_TRUE(host_resolver.GetNetAddress(
+ static_cast<uint32_t>(i), &address));
pp::TCPSocketPrivate socket(instance_);
ASSERT_SUBTEST_SUCCESS(SyncConnect(&socket, address));
@@ -154,7 +157,8 @@ std::string TestHostResolverPrivate::ParametrizedTestResolve(
socket.Disconnect();
}
- ASSERT_FALSE(host_resolver.GetNetAddress(size, &address));
+ ASSERT_FALSE(host_resolver.GetNetAddress(
+ static_cast<uint32_t>(size), &address));
pp::Var canonical_name = host_resolver.GetCanonicalName();
ASSERT_TRUE(canonical_name.is_string());
pp::TCPSocketPrivate socket(instance_);
« no previous file with comments | « ppapi/tests/test_host_resolver.cc ('k') | ppapi/tests/test_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698