diff options
| author | Enrico Granata <granata.enrico@gmail.com> | 2012-02-17 03:18:30 +0000 |
|---|---|---|
| committer | Enrico Granata <granata.enrico@gmail.com> | 2012-02-17 03:18:30 +0000 |
| commit | 864e3e8413b2ab0fad4432943056be03d60e73fc (patch) | |
| tree | c2e52326a4d6fd1f025d256dcc6dbdc2d452e86e /lldb/test/python_api/formatters | |
| parent | 355efbb2e044126adecdcadca87c8cdfb5c33a85 (diff) | |
| download | bcm5719-llvm-864e3e8413b2ab0fad4432943056be03d60e73fc.tar.gz bcm5719-llvm-864e3e8413b2ab0fad4432943056be03d60e73fc.zip | |
Adding formatters for several useful Objective-C/Cocoa data types. The new categories are not enabled at startup, but can be manually activated if desired.
Adding new API calls to SBValue to be able to retrieve the associated formatters
Some refactoring to FormatNavigator::Get() in order to shrink its size down to more manageable terms (a future, massive, refactoring effort will still be needed)
Test cases added for the above
llvm-svn: 150784
Diffstat (limited to 'lldb/test/python_api/formatters')
| -rw-r--r-- | lldb/test/python_api/formatters/TestFormattersSBAPI.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/test/python_api/formatters/TestFormattersSBAPI.py index 39f0fc27503..52cf01462d1 100644 --- a/lldb/test/python_api/formatters/TestFormattersSBAPI.py +++ b/lldb/test/python_api/formatters/TestFormattersSBAPI.py @@ -251,9 +251,24 @@ class SBFormattersAPITestCase(TestBase): self.expect("frame variable foo", matching=True, substrs = ['hello scripted world']) + frame = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() + foo_ptr = frame.FindVariable("foo_ptr") + summary = foo_ptr.GetTypeSummary() + + self.assertFalse(summary.IsValid(), "summary found for foo* when none was planned") + self.expect("frame variable foo_ptr", matching=False, substrs = ['hello scripted world']) + new_category.AddTypeSummary(lldb.SBTypeNameSpecifier("JustAStruct"), + lldb.SBTypeSummary.CreateWithSummaryString("hello static world", + lldb.eTypeOptionNone)) + + summary = foo_ptr.GetTypeSummary() + + self.assertTrue(summary.IsValid(), "no summary found for foo* when one was in place") + self.assertTrue(summary.GetData() == "hello static world", "wrong summary found for foo*") + if __name__ == '__main__': import atexit lldb.SBDebugger.Initialize() |

