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

Unified Diff: tools/cygprofile/symbol_extractor_unittest.py

Issue 947073003: Improve symbol_extractor.CreateNameToSymbolInfo handling of duplicate symbols. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/cygprofile/symbol_extractor.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cygprofile/symbol_extractor_unittest.py
diff --git a/tools/cygprofile/symbol_extractor_unittest.py b/tools/cygprofile/symbol_extractor_unittest.py
index 49f6e9337fe26e84f4c215cef1d69395518d2ef9..986a18768bd7c518f99c5b7b2b43a6e60246823e 100755
--- a/tools/cygprofile/symbol_extractor_unittest.py
+++ b/tools/cygprofile/symbol_extractor_unittest.py
@@ -103,6 +103,19 @@ class TestSymbolInfoMappings(unittest.TestCase):
self.assertIn(name, name_to_symbol_info)
self.assertEquals(self.symbol_infos[i], name_to_symbol_info[name])
+ def testSymbolCollisions(self):
+ symbol_infos_with_collision = list(self.symbol_infos)
+ symbol_infos_with_collision.append(symbol_extractor.SymbolInfo(
+ 'secondNameAtOffset', 0x84, 42, '.text'))
+
+ # The symbol added above should not affect the output.
+ name_to_symbol_info = symbol_extractor.CreateNameToSymbolInfo(
+ self.symbol_infos)
+ self.assertEquals(len(name_to_symbol_info), 3)
+ for i in range(3):
+ name = self.symbol_infos[i].name
+ self.assertIn(name, name_to_symbol_info)
+ self.assertEquals(self.symbol_infos[i], name_to_symbol_info[name])
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « tools/cygprofile/symbol_extractor.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698