def testSymbolsAtOffsetInexectMatch(self): symbol_infos = [SimpleTestSymbol('1', 0x10, 0x13)] generator = cyglog_to_orderfile.OffsetOrderfileGenerator( test_utils.TestSymbolOffsetProcessor(symbol_infos), None) syms = generator._SymbolsAtOffset(0x11) self.assertEquals(1, len(syms)) self.assertEquals(symbol_infos[0], syms[0])
def testOutputOrderfile(self): # One symbol not matched, one with an odd address, one regularly matched # And two symbols aliased to the same address symbols = [SimpleTestSymbol('Symbol', 0x10, 0x100), SimpleTestSymbol('Symbol2', 0x12, 0x100), SimpleTestSymbol('Symbol3', 0x16, 0x100), SimpleTestSymbol('Symbol3.2', 0x16, 0x0)] generator = cyglog_to_orderfile.OffsetOrderfileGenerator( test_utils.TestSymbolOffsetProcessor(symbols), TestObjectFileProcessor({ 'Symbol': ['.text.Symbol'], 'Symbol2': ['.text.Symbol2', '.text.hot.Symbol2'], 'Symbol3': ['.text.Symbol3'], 'Symbol3.2': ['.text.Symbol3.2']})) ordered_sections = generator.GetOrderedSections([0x12, 0x17]) self.assertListEqual( ['.text.Symbol2', '.text.hot.Symbol2', '.text.Symbol3', '.text.Symbol3.2'], ordered_sections)