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

Unified Diff: ppapi/proxy/ppb_var_unittest.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/proxy/ppb_testing_proxy.cc ('k') | ppapi/proxy/ppb_video_decoder_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_var_unittest.cc
diff --git a/ppapi/proxy/ppb_var_unittest.cc b/ppapi/proxy/ppb_var_unittest.cc
index 5e25379eeb0213f5c9ef6793a36885fb262ba44a..98b642832219e015f575f312a235dc10722e21c5 100644
--- a/ppapi/proxy/ppb_var_unittest.cc
+++ b/ppapi/proxy/ppb_var_unittest.cc
@@ -33,7 +33,7 @@ class PPB_VarTest : public PluginProxyTest {
ppb_var_(ppapi::PPB_Var_Shared::GetVarInterface1_2()) {
// Set the value of test_strings_[i] to "i".
for (size_t i = 0; i < kNumStrings; ++i)
- test_strings_[i] = base::IntToString(i);
+ test_strings_[i] = base::IntToString(static_cast<int>(i));
}
protected:
std::vector<std::string> test_strings_;
@@ -44,8 +44,9 @@ class PPB_VarTest : public PluginProxyTest {
// Test basic String operations.
TEST_F(PPB_VarTest, Strings) {
for (size_t i = 0; i < kNumStrings; ++i) {
- vars_[i] = ppb_var_->VarFromUtf8(test_strings_[i].c_str(),
- test_strings_[i].length());
+ vars_[i] = ppb_var_->VarFromUtf8(
+ test_strings_[i].c_str(),
+ static_cast<uint32_t>(test_strings_[i].length()));
EXPECT_EQ(test_strings_[i], VarToString(vars_[i], ppb_var_));
}
// At this point, they should each have a ref count of 1. Add some more.
@@ -104,8 +105,9 @@ class CreateVarThreadDelegate : public base::PlatformThread::Delegate {
virtual void ThreadMain() {
const PPB_Var* ppb_var = ppapi::PPB_Var_Shared::GetVarInterface1_2();
for (size_t i = 0; i < size_; ++i) {
- vars_out_[i] = ppb_var->VarFromUtf8(strings_in_[i].c_str(),
- strings_in_[i].length());
+ vars_out_[i] = ppb_var->VarFromUtf8(
+ strings_in_[i].c_str(),
+ static_cast<uint32_t>(strings_in_[i].length()));
strings_out_[i] = VarToString(vars_out_[i], ppb_var);
}
}
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.cc ('k') | ppapi/proxy/ppb_video_decoder_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698