diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
commit | 14f1b3e8826ce43b978db93a62d1166055db5394 (patch) | |
tree | 0a00ad8d3498783fe0193f3b656bca17c4c8697d /packages/Python/lldbsuite/test/python_api/lldbutil/iter | |
parent | 4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/lldbutil/iter')
-rw-r--r-- | packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py | 19 | ||||
-rw-r--r-- | packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py | 29 |
2 files changed, 32 insertions, 16 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py index 90f879d37610..ae7ec3dfc3cc 100644 --- a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py +++ b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py @@ -5,14 +5,15 @@ Test the iteration protocol for some lldb container objects. from __future__ import print_function - -import os, time +import os +import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class LLDBIteratorTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -21,7 +22,8 @@ class LLDBIteratorTestCase(TestBase): # Call super's setUp(). TestBase.setUp(self) # Find the line numbers to break inside main(). - self.line1 = line_number('main.cpp', '// Set break point at this line.') + self.line1 = line_number( + 'main.cpp', '// Set break point at this line.') self.line2 = line_number('main.cpp', '// And that line.') @add_test_categories(['pyapi']) @@ -37,7 +39,8 @@ class LLDBIteratorTestCase(TestBase): self.assertTrue(breakpoint, VALID_BREAKPOINT) # Now launch the process, and do not stop at entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) if not process: self.fail("SBTarget.LaunchProcess() failed") @@ -55,8 +58,9 @@ class LLDBIteratorTestCase(TestBase): if self.TraceOn(): print("yours[%d]='%s'" % (i, get_description(yours[i]))) print("mine[%d]='%s'" % (i, get_description(mine[i]))) - self.assertTrue(yours[i] == mine[i], - "UUID+FileSpec of yours[{0}] and mine[{0}] matches".format(i)) + self.assertTrue( + yours[i] == mine[i], + "UUID+FileSpec of yours[{0}] and mine[{0}] matches".format(i)) @add_test_categories(['pyapi']) def test_lldb_iter_breakpoint(self): @@ -103,7 +107,8 @@ class LLDBIteratorTestCase(TestBase): self.assertTrue(breakpoint, VALID_BREAKPOINT) # Now launch the process, and do not stop at entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) if not process: self.fail("SBTarget.LaunchProcess() failed") diff --git a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py index 84ef44d2dd73..49a78888ad89 100644 --- a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py +++ b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py @@ -5,14 +5,15 @@ Test the iteration protocol for frame registers. from __future__ import print_function - -import os, time +import os +import time import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class RegistersIteratorTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -21,7 +22,8 @@ class RegistersIteratorTestCase(TestBase): # Call super's setUp(). TestBase.setUp(self) # Find the line number to break inside main(). - self.line1 = line_number('main.cpp', '// Set break point at this line.') + self.line1 = line_number( + 'main.cpp', '// Set break point at this line.') @add_test_categories(['pyapi']) @expectedFailureAll(oslist=["windows"]) @@ -37,7 +39,8 @@ class RegistersIteratorTestCase(TestBase): self.assertTrue(breakpoint, VALID_BREAKPOINT) # Now launch the process, and do not stop at entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) if not process: self.fail("SBTarget.LaunchProcess() failed") @@ -46,14 +49,17 @@ class RegistersIteratorTestCase(TestBase): for thread in process: if thread.GetStopReason() == lldb.eStopReasonBreakpoint: for frame in thread: - # Dump the registers of this frame using lldbutil.get_GPRs() and friends. + # Dump the registers of this frame using + # lldbutil.get_GPRs() and friends. if self.TraceOn(): print(frame) REGs = lldbutil.get_GPRs(frame) num = len(REGs) if self.TraceOn(): - print("\nNumber of general purpose registers: %d" % num) + print( + "\nNumber of general purpose registers: %d" % + num) for reg in REGs: self.assertTrue(reg) if self.TraceOn(): @@ -72,11 +78,15 @@ class RegistersIteratorTestCase(TestBase): if self.platformIsDarwin(): num = len(REGs) if self.TraceOn(): - print("\nNumber of exception state registers: %d" % num) + print( + "\nNumber of exception state registers: %d" % + num) for reg in REGs: self.assertTrue(reg) if self.TraceOn(): - print("%s => %s" % (reg.GetName(), reg.GetValue())) + print( + "%s => %s" % + (reg.GetName(), reg.GetValue())) else: self.assertIsNone(REGs) @@ -86,7 +96,8 @@ class RegistersIteratorTestCase(TestBase): REGs = lldbutil.get_registers(frame, kind) self.assertTrue(REGs) - REGs = lldbutil.get_registers(frame, "Exception State Registers") + REGs = lldbutil.get_registers( + frame, "Exception State Registers") if self.platformIsDarwin(): self.assertIsNotNone(REGs) else: |