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

Unified Diff: device/hid/hid_connection_unittest.cc

Issue 656583003: Fix type truncation warnings in HID code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 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 | « device/hid/hid_connection_linux.cc ('k') | device/hid/hid_connection_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_connection_unittest.cc
diff --git a/device/hid/hid_connection_unittest.cc b/device/hid/hid_connection_unittest.cc
index 5654fc0a802ddb98a9a4b1e0babbdf8a3695bf0b..5e48ef9bc5ba11e95ab94bb7ca8dfc83f41471c2 100644
--- a/device/hid/hid_connection_unittest.cc
+++ b/device/hid/hid_connection_unittest.cc
@@ -158,10 +158,11 @@ TEST_F(HidConnectionTest, ReadWrite) {
scoped_refptr<HidConnection> conn = connect_callback.WaitForConnection();
ASSERT_TRUE(conn.get());
- for (int i = 0; i < 8; ++i) {
- scoped_refptr<IOBufferWithSize> buffer(new IOBufferWithSize(9));
+ const char kBufferSize = 9;
+ for (char i = 0; i < 8; ++i) {
+ scoped_refptr<IOBufferWithSize> buffer(new IOBufferWithSize(kBufferSize));
buffer->data()[0] = 0;
- for (int j = 1; j < buffer->size(); ++j) {
+ for (char j = 1; j < kBufferSize; ++j) {
buffer->data()[j] = i + j - 1;
}
@@ -174,7 +175,7 @@ TEST_F(HidConnectionTest, ReadWrite) {
ASSERT_TRUE(read_callback.WaitForResult());
ASSERT_EQ(9UL, read_callback.size());
ASSERT_EQ(0, read_callback.buffer()->data()[0]);
- for (int j = 1; j < buffer->size(); ++j) {
+ for (char j = 1; j < kBufferSize; ++j) {
ASSERT_EQ(i + j - 1, read_callback.buffer()->data()[j]);
}
}
« no previous file with comments | « device/hid/hid_connection_linux.cc ('k') | device/hid/hid_connection_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698