diff options
author | Ted Mielczarek <ted@mielczarek.org> | 2016-06-10 13:23:29 -0400 |
---|---|---|
committer | Ted Mielczarek <ted@mielczarek.org> | 2016-06-10 13:23:29 -0400 |
commit | c44217f6468152bf5693df7ec78a48d97e2b0e83 (patch) | |
tree | f05595f7a39b34c8111c6a74bfbf505c66dfa4b1 /src/common/linux/file_id_unittest.cc | |
parent | Fix a trivial parsing bug caught by static analysis (diff) | |
download | breakpad-c44217f6468152bf5693df7ec78a48d97e2b0e83.tar.xz |
Dump INFO CODE_ID containing Build ID in Linux dump_syms
I'd like to have the Build ID available for our symbol server
uploading, and this will make it easy.
Most of this change is me rewriting dump_symbols_unittest to be
typed tests so I could add a new test there.
R=mark@chromium.org
BUG=
Review URL: https://codereview.chromium.org/2052263002 .
Diffstat (limited to 'src/common/linux/file_id_unittest.cc')
-rw-r--r-- | src/common/linux/file_id_unittest.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc index ec11bb25..3a819303 100644 --- a/src/common/linux/file_id_unittest.cc +++ b/src/common/linux/file_id_unittest.cc @@ -319,3 +319,20 @@ TYPED_TEST(FileIDTest, UniqueHashes) { EXPECT_NE(identifier_string_1, identifier_string_2); } + +TYPED_TEST(FileIDTest, ConvertIdentifierToString) { + const uint8_t kIdentifierBytes[] = + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F}; + const char* kExpected = + "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"; + + id_vector identifier(this->make_vector()); + identifier.insert(identifier.end(), + kIdentifierBytes, + kIdentifierBytes + sizeof(kIdentifierBytes)); + ASSERT_EQ(kExpected, + FileID::ConvertIdentifierToString(identifier)); +} |