Commit 156f0a5c authored by charliea's avatar charliea Committed by Commit bot

tools/battor_agent: Fixes VS warnings for protocol types unit test

This is part of my (apparently neverending) goal to get the battor agent
unit tests on the waterfall.

TBR=zhenw@chromium.org,nednguyen@google.com

Review URL: https://codereview.chromium.org/1634263004

Cr-Commit-Position: refs/heads/master@{#371709}
parent 9b6d756c
...@@ -16,7 +16,8 @@ namespace battor { ...@@ -16,7 +16,8 @@ namespace battor {
namespace { namespace {
// Prints the character array as hex to a comma-separated list. // Prints the character array as hex to a comma-separated list.
std::string CharArrayToFormattedString(const char* arr, size_t length) { std::string CharArrayToFormattedString(const unsigned char* arr,
size_t length) {
std::string s; std::string s;
char num_buff[6]; char num_buff[6];
...@@ -36,7 +37,7 @@ const BattOrEEPROM kUnserializedEEPROM{ ...@@ -36,7 +37,7 @@ const BattOrEEPROM kUnserializedEEPROM{
}; };
// The serialized version of the above EEPROM. // The serialized version of the above EEPROM.
const char kSerializedEEPROM[] = { const unsigned char kSerializedEEPROM[] = {
0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c,
0x6e, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00,
...@@ -54,8 +55,8 @@ TEST(BattOrProtocolTypeTest, EEPROMSerializesCorrectly) { ...@@ -54,8 +55,8 @@ TEST(BattOrProtocolTypeTest, EEPROMSerializesCorrectly) {
// the EEPROM will change in the future and we'll need to update the // the EEPROM will change in the future and we'll need to update the
// serialized version when it does, it makes sense to print the bytes as a // serialized version when it does, it makes sense to print the bytes as a
// string that can just be copied and pasted into kSerializedEEPROM. // string that can just be copied and pasted into kSerializedEEPROM.
const char* eeprom_bytes = const unsigned char* eeprom_bytes =
reinterpret_cast<const char*>(&kUnserializedEEPROM); reinterpret_cast<const unsigned char*>(&kUnserializedEEPROM);
ASSERT_EQ( ASSERT_EQ(
CharArrayToFormattedString(kSerializedEEPROM, sizeof(kSerializedEEPROM)), CharArrayToFormattedString(kSerializedEEPROM, sizeof(kSerializedEEPROM)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment