OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import functools | 6 import functools |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import sys | |
10 import unittest | 9 import unittest |
11 | 10 |
12 sys.path.insert(0, os.path.dirname(__file__)) | 11 from pylib.symbols import elf_symbolizer |
13 import elf_symbolizer | 12 from pylib.symbols import mock_addr2line |
14 import mock_addr2line | |
15 | 13 |
16 | 14 |
17 _MOCK_A2L_PATH = os.path.join(os.path.dirname(mock_addr2line.__file__), | 15 _MOCK_A2L_PATH = os.path.join(os.path.dirname(mock_addr2line.__file__), |
18 'mock_addr2line') | 16 'mock_addr2line') |
19 _INCOMPLETE_MOCK_ADDR = 1024 * 1024 | 17 _INCOMPLETE_MOCK_ADDR = 1024 * 1024 |
20 _UNKNOWN_MOCK_ADDR = 2 * 1024 * 1024 | 18 _UNKNOWN_MOCK_ADDR = 2 * 1024 * 1024 |
21 _INLINE_MOCK_ADDR = 3 * 1024 * 1024 | 19 _INLINE_MOCK_ADDR = 3 * 1024 * 1024 |
22 | 20 |
23 | 21 |
24 class ELFSymbolizerTest(unittest.TestCase): | 22 class ELFSymbolizerTest(unittest.TestCase): |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 self.assertEqual(sym_info.inlined_by.inlined_by.name, | 162 self.assertEqual(sym_info.inlined_by.inlined_by.name, |
165 exp_name + '_outer') | 163 exp_name + '_outer') |
166 | 164 |
167 # Check against duplicate callbacks. | 165 # Check against duplicate callbacks. |
168 self.assertNotIn(addr, self._resolved_addresses) | 166 self.assertNotIn(addr, self._resolved_addresses) |
169 self._resolved_addresses.add(addr) | 167 self._resolved_addresses.add(addr) |
170 | 168 |
171 | 169 |
172 if __name__ == '__main__': | 170 if __name__ == '__main__': |
173 unittest.main() | 171 unittest.main() |
OLD | NEW |