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

Side by Side Diff: src/common/linux/file_id_unittest.cc

Issue 2052263002: Dump INFO CODE_ID containing Build ID in Linux dump_syms (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Oops, it's supposed to be INFO CODE_ID Created 4 years, 6 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 | « src/common/linux/file_id.cc ('k') | src/common/module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010, Google Inc. 1 // Copyright (c) 2010, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 id_vector identifier_2(this->make_vector()); 314 id_vector identifier_2(this->make_vector());
315 EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata, 315 EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
316 identifier_2)); 316 identifier_2));
317 string identifier_string_2 = 317 string identifier_string_2 =
318 FileID::ConvertIdentifierToUUIDString(identifier_2); 318 FileID::ConvertIdentifierToUUIDString(identifier_2);
319 319
320 EXPECT_NE(identifier_string_1, identifier_string_2); 320 EXPECT_NE(identifier_string_1, identifier_string_2);
321 } 321 }
322
323 TYPED_TEST(FileIDTest, ConvertIdentifierToString) {
324 const uint8_t kIdentifierBytes[] =
325 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
326 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
327 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
328 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
329 const char* kExpected =
330 "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F";
331
332 id_vector identifier(this->make_vector());
333 identifier.insert(identifier.end(),
334 kIdentifierBytes,
335 kIdentifierBytes + sizeof(kIdentifierBytes));
336 ASSERT_EQ(kExpected,
337 FileID::ConvertIdentifierToString(identifier));
338 }
OLDNEW
« no previous file with comments | « src/common/linux/file_id.cc ('k') | src/common/module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698