diff options
author | António Afonso <aadsm@fb.com> | 2019-12-02 12:23:45 -0800 |
---|---|---|
committer | António Afonso <aadsm@fb.com> | 2019-12-02 12:24:11 -0800 |
commit | afd5d912812e6f2ea99c8890676d47a01bbcfbb1 (patch) | |
tree | 000974aed6a9a777fc94050f9c313d6cfbd7b2c5 /lldb/packages/Python/lldbsuite/test/python_api/formatters | |
parent | 3d02fa6da7d250e086b01b4ec66b513debb7950d (diff) | |
download | bcm5719-llvm-afd5d912812e6f2ea99c8890676d47a01bbcfbb1.tar.gz bcm5719-llvm-afd5d912812e6f2ea99c8890676d47a01bbcfbb1.zip |
[lldb] Fix TestFormattersSBAPI test
Summary:
This test was broken in two ways:
* Using the wrong API (e.g.: format = instead of SetFormat)
* The hex checker was only checking "01" which will pass with 0x0000001
Reviewers: clayborg, lanza, wallace
Reviewed By: clayborg
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70884
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/formatters')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py index 1bc52b3e667..5c87d74e22d 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py @@ -68,17 +68,17 @@ class SBFormattersAPITestCase(TestBase): self.expect("frame variable foo.E", substrs=['b8cca70a']) - format.format = lldb.eFormatOctal + format.SetFormat(lldb.eFormatOctal) category.AddTypeFormat(lldb.SBTypeNameSpecifier("int"), format) self.expect("frame variable foo.A", - substrs=['01']) + substrs=[' 01']) self.expect("frame variable foo.E", substrs=['b8cca70a']) category.DeleteTypeFormat(lldb.SBTypeNameSpecifier("int")) category.DeleteTypeFormat(lldb.SBTypeNameSpecifier("long")) self.expect("frame variable foo.A", matching=False, - substrs=['01']) + substrs=[' 01']) self.expect("frame variable foo.E", matching=False, substrs=['b8cca70a']) @@ -90,10 +90,13 @@ class SBFormattersAPITestCase(TestBase): new_category.IsValid(), "getting a non-existing category worked") new_category = self.dbg.CreateCategory("foobar") - new_category.enabled = True + new_category.SetEnabled(True) new_category.AddTypeSummary( lldb.SBTypeNameSpecifier( - "^.*t$", True), summary) + "^.*t$", + True, # is_regexp + ), summary) + self.expect("frame variable foo.A", substrs=['hello world']) self.expect("frame variable foo.E", matching=False, @@ -102,7 +105,7 @@ class SBFormattersAPITestCase(TestBase): substrs=['hello world']) self.expect("frame variable foo.F", substrs=['hello world']) - new_category.enabled = False + new_category.SetEnabled(False) self.expect("frame variable foo.A", matching=False, substrs=['hello world']) self.expect("frame variable foo.E", matching=False, @@ -379,7 +382,7 @@ class SBFormattersAPITestCase(TestBase): lldb.SBTypeSummary.CreateWithScriptCode("return 'hello scripted world';")) self.expect("frame variable foo", matching=False, substrs=['hello scripted world']) - new_category.enabled = True + new_category.SetEnabled(True) self.expect("frame variable foo", matching=True, substrs=['hello scripted world']) |