tools/android/elf_compression/test/elf_headers_test.py
def testElfHeaderSectionNames(self):
    """Test that the section names are correctly resolved"""
    with open(self.library_path, 'rb') as f:
      data = f.read()
    elf = elf_headers.ElfHeader(data)

    section_names = [
        '',
        '.hash',
        '.gnu.hash',
        '.dynsym',
        '.dynstr',
        '.gnu.version',
        '.gnu.version_r',
        '.rela.dyn',
        '.init',
        '.plt',
        '.plt.got',
        '.text',
        '.fini',
        '.eh_frame_hdr',
        '.eh_frame',
        '.init_array',
        '.fini_array',
        '.dynamic',
        '.got',
        '.got.plt',
        '.data',
        '.bss',
        '.comment',
        '.symtab',
        '.strtab',
        '.shstrtab',
    ]
    shdrs = elf.GetSectionHeaders()
    for i in range(0, len(shdrs)):
      self.assertEqual(shdrs[i].GetStrName(), section_names[i])
Test that the section names are correctly resolved
Test that the section names are correctly resolved
Test that the section names are correctly resolved
def testElfHeaderSectionNames(self):
    with open(self.library_path, 'rb') as f:
      data = f.read()
    elf = elf_headers.ElfHeader(data)
    section_names = [
        '',
        '.hash',
        '.gnu.hash',
        '.dynsym',
        '.dynstr',
        '.gnu.version',
        '.gnu.version_r',
        '.rela.dyn',
        '.init',
        '.plt',
        '.plt.got',
        '.text',
        '.fini',
        '.eh_frame_hdr',
        '.eh_frame',
        '.init_array',
        '.fini_array',
        '.dynamic',
        '.got',
        '.got.plt',
        '.data',
        '.bss',
        '.comment',
        '.symtab',
        '.strtab',
        '.shstrtab',
    ]
    shdrs = elf.GetSectionHeaders()
    for i in range(0, len(shdrs)):
      self.assertEqual(shdrs[i].GetStrName(), section_names[i])
def testElfHeaderSectionNames ( self ) : with open ( self . library_path , 'rb' ) as f : data = f . read ( ) elf = elf_headers . ElfHeader ( data ) section_names = [ '' , '.hash' , '.gnu.hash' , '.dynsym' , '.dynstr' , '.gnu.version' , '.gnu.version_r' , '.rela.dyn' , '.init' , '.plt' , '.plt.got' , '.text' , '.fini' , '.eh_frame_hdr' , '.eh_frame' , '.init_array' , '.fini_array' , '.dynamic' , '.got' , '.got.plt' , '.data' , '.bss' , '.comment' , '.symtab' , '.strtab' , '.shstrtab' , ] shdrs = elf . GetSectionHeaders ( ) for i in range ( 0 , len ( shdrs ) ) : self . assertEqual ( shdrs [ i ] . GetStrName ( ) , section_names [ i ] )
Test that the section names are correctly resolved
Test that the section names are correctly resolved
"""Test that the section names are correctly resolved"""
self