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

Side by Side Diff: tools/battor_agent/battor_connection_impl_unittest.cc

Issue 1650843002: Fix new -Wconstant-conversion versions after clang r259271 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « rlz/lib/machine_id_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/battor_agent/battor_connection_impl.h" 5 #include "tools/battor_agent/battor_connection_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/test/test_simple_task_runner.h" 10 #include "base/test/test_simple_task_runner.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 ASSERT_EQ(BATTOR_MESSAGE_TYPE_CONTROL, GetReadType()); 191 ASSERT_EQ(BATTOR_MESSAGE_TYPE_CONTROL, GetReadType());
192 ASSERT_EQ(0, std::memcmp(GetReadMessage()->data(), expected, 5)); 192 ASSERT_EQ(0, std::memcmp(GetReadMessage()->data(), expected, 5));
193 } 193 }
194 194
195 TEST_F(BattOrConnectionImplTest, ReadMessageInvalidType) { 195 TEST_F(BattOrConnectionImplTest, ReadMessageInvalidType) {
196 OpenConnection(); 196 OpenConnection();
197 ASSERT_TRUE(GetOpenSuccess()); 197 ASSERT_TRUE(GetOpenSuccess());
198 198
199 const char data[] = { 199 const char data[] = {
200 BATTOR_CONTROL_BYTE_START, 200 BATTOR_CONTROL_BYTE_START,
201 UINT8_MAX, 201 static_cast<char>(UINT8_MAX),
202 BATTOR_CONTROL_BYTE_ESCAPE, 202 BATTOR_CONTROL_BYTE_ESCAPE,
203 BATTOR_CONTROL_MESSAGE_TYPE_RESET, 203 BATTOR_CONTROL_MESSAGE_TYPE_RESET,
204 0x04, 204 0x04,
205 0x04, 205 0x04,
206 0x04, 206 0x04,
207 0x04, 207 0x04,
208 BATTOR_CONTROL_BYTE_END, 208 BATTOR_CONTROL_BYTE_END,
209 }; 209 };
210 SendBytesRaw(data, 7); 210 SendBytesRaw(data, 7);
211 ReadMessage(BATTOR_MESSAGE_TYPE_CONTROL); 211 ReadMessage(BATTOR_MESSAGE_TYPE_CONTROL);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 BATTOR_CONTROL_BYTE_END, 387 BATTOR_CONTROL_BYTE_END,
388 }; 388 };
389 SendBytesRaw(data, 3); 389 SendBytesRaw(data, 3);
390 ReadMessage(BATTOR_MESSAGE_TYPE_PRINT); 390 ReadMessage(BATTOR_MESSAGE_TYPE_PRINT);
391 391
392 ASSERT_TRUE(IsReadComplete()); 392 ASSERT_TRUE(IsReadComplete());
393 ASSERT_FALSE(GetReadSuccess()); 393 ASSERT_FALSE(GetReadSuccess());
394 } 394 }
395 395
396 } // namespace battor 396 } // namespace battor
OLDNEW
« no previous file with comments | « rlz/lib/machine_id_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698