diff options
author | Greg Clayton <gclayton@apple.com> | 2014-11-03 23:02:08 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-11-03 23:02:08 +0000 |
commit | ed59d756d88dea5d181342083ce1cc193a76ad8d (patch) | |
tree | 236ddcd6fcd9e40cf3bed13af116e8132c26ce92 /lldb/test/python_api/section/TestSectionAPI.py | |
parent | c91d49b5050eb5053a248392d9d135458c8295d6 (diff) | |
download | bcm5719-llvm-ed59d756d88dea5d181342083ce1cc193a76ad8d.tar.gz bcm5719-llvm-ed59d756d88dea5d181342083ce1cc193a76ad8d.zip |
Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).
llvm-svn: 221197
Diffstat (limited to 'lldb/test/python_api/section/TestSectionAPI.py')
-rwxr-xr-x | lldb/test/python_api/section/TestSectionAPI.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/test/python_api/section/TestSectionAPI.py b/lldb/test/python_api/section/TestSectionAPI.py index c8638586a04..de13717f56c 100755 --- a/lldb/test/python_api/section/TestSectionAPI.py +++ b/lldb/test/python_api/section/TestSectionAPI.py @@ -46,12 +46,21 @@ class SectionAPITestCase(TestBase): mod = target.GetModuleAtIndex(0) data_section = None for s in mod.sections: - if ".data" == s.name: + sect_type = s.GetSectionType() + if sect_type == lldb.eSectionTypeData: data_section = s break + elif sect_type == lldb.eSectionTypeContainer: + for i in range(s.GetNumSubSections()): + ss = s.GetSubSectionAtIndex(i) + sect_type = ss.GetSectionType() + if sect_type == lldb.eSectionTypeData: + data_section = ss + break self.assertIsNotNone(data_section) return data_section + if __name__ == '__main__': import atexit |