brintos

brintos / llvm-project-archived public Read only

0
0
Text · 721 B · 625eadd Raw
25 lines · python
1"""2Test the lldb Python SBFormat API.3"""4 5import lldb6from lldbsuite.test.decorators import *7from lldbsuite.test.lldbtest import *8 9 10class FormatAPITestCase(TestBase):11    def test_format(self):12        format = lldb.SBFormat()13        self.assertFalse(format)14 15        error = lldb.SBError()16        format = lldb.SBFormat("${bad}", error)17        self.assertIn("invalid top level item 'bad'", error.GetCString())18        self.assertFalse(format)  # We expect an invalid object back if we have an error19        self.assertTrue(error.Fail())20 21        format = lldb.SBFormat("${frame.index}", error)22        self.assertIsNone(error.GetCString())23        self.assertTrue(format)24        self.assertTrue(error.Success())25