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/default-constructor | |
| parent | 4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff) | |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/default-constructor')
30 files changed, 55 insertions, 20 deletions
| diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index 3e2ff2ffa9dd..4739df000853 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -14,14 +14,15 @@ after default construction.  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 APIDefaultConstructorTestCase(TestBase):      mydir = TestBase.compute_mydir(__file__) @@ -125,7 +126,8 @@ class APIDefaultConstructorTestCase(TestBase):      @add_test_categories(['pyapi'])      @no_debug_info_test -    # darwin: This test passes with swig 3.0.2, fails w/3.0.5 other tests fail with 2.0.12 http://llvm.org/pr23488 +    # darwin: This test passes with swig 3.0.2, fails w/3.0.5 other tests fail +    # with 2.0.12 http://llvm.org/pr23488      def test_SBError(self):          obj = lldb.SBError()          if self.TraceOn(): @@ -228,8 +230,9 @@ class APIDefaultConstructorTestCase(TestBase):      @add_test_categories(['pyapi'])      @no_debug_info_test -    # Py3 asserts due to a bug in SWIG.  Trying to upstream a patch to fix this in 3.0.8 -    @skipIf(py_version=['>=', (3,0)], swig_version=['<', (3,0,8)]) +    # Py3 asserts due to a bug in SWIG.  Trying to upstream a patch to fix +    # this in 3.0.8 +    @skipIf(py_version=['>=', (3, 0)], swig_version=['<', (3, 0, 8)])      def test_SBModule(self):          obj = lldb.SBModule()          if self.TraceOn(): @@ -347,7 +350,7 @@ class APIDefaultConstructorTestCase(TestBase):          except:              # Exception is expected.              return -             +          # Unreachable code because lldb.SBType() should fail.          # Do fuzz testing on the invalid obj, it should not crash lldb.          import sb_type diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_address.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_address.py index f0e979543a4c..8f9665d3a73f 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_address.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_address.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetFileAddress()      obj.GetLoadAddress(lldb.SBTarget()) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_block.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_block.py index 3eeb24b42734..00654ca1246c 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_block.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_block.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.IsInlined()      obj.GetInlinedName() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpoint.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpoint.py index 2c05990edae0..3bdf5879d30d 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpoint.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpoint.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetID()      obj.ClearAllBreakpointSites() @@ -28,7 +29,7 @@ def fuzz_obj(obj):      obj.SetQueueName("my queue")      obj.GetQueueName()      obj.SetScriptCallbackFunction(None) -    obj.SetScriptCallbackBody (None) +    obj.SetScriptCallbackBody(None)      obj.GetNumResolvedLocations()      obj.GetNumLocations()      obj.GetDescription(lldb.SBStream()) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpointlocation.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpointlocation.py index 2251892643b3..26bf6f69c5de 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpointlocation.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpointlocation.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetAddress()      obj.GetLoadAddress() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_broadcaster.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_broadcaster.py index 27539e855cdd..b2f5ab5b2c5c 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_broadcaster.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_broadcaster.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.BroadcastEventByType(lldb.eBreakpointEventTypeInvalidType, True)      obj.BroadcastEvent(lldb.SBEvent(), False) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_communication.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_communication.py index d4b90840657b..9793e9be20e3 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_communication.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_communication.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      broadcaster = obj.GetBroadcaster()      # Do fuzz testing on the broadcaster obj, it should not crash lldb. diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_compileunit.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_compileunit.py index 92755ffa395d..0c27c94b752a 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_compileunit.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_compileunit.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetFileSpec()      obj.GetNumLineEntries() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py index e7c188f09bad..77e45c861e8d 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.SetAsync(True)      obj.SetAsync(False) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py index 7e069323bf3f..9c0f8d8e6d82 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetCString()      obj.Fail() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_event.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_event.py index c64f9ba927c2..4c24c606fa21 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_event.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_event.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetDataFlavor()      obj.GetType() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_filespec.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_filespec.py index 3aa9235b8a16..33b4d69cd6ae 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_filespec.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_filespec.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.Exists()      obj.ResolveExecutableLocation() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_frame.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_frame.py index 41edaff02ed7..4637fc428d8c 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_frame.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_frame.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetFrameID()      obj.GetPC() @@ -32,6 +33,9 @@ def fuzz_obj(obj):      obj.FindVariable("my_var")      obj.FindVariable("my_var", lldb.eDynamicCanRunTarget)      obj.FindValue("your_var", lldb.eValueTypeVariableGlobal) -    obj.FindValue("your_var", lldb.eValueTypeVariableStatic, lldb.eDynamicCanRunTarget) +    obj.FindValue( +        "your_var", +        lldb.eValueTypeVariableStatic, +        lldb.eDynamicCanRunTarget)      obj.GetDescription(lldb.SBStream())      obj.Clear() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_function.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_function.py index fb88d37ac19c..bd9c887e50fd 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_function.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_function.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetName()      obj.GetMangledName() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instruction.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instruction.py index b961bc389e31..e0be4132fc09 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instruction.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instruction.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetAddress()      obj.GetByteSize() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instructionlist.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instructionlist.py index 09d62f970480..8870bf5de472 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instructionlist.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instructionlist.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetSize()      obj.GetInstructionAtIndex(0xffffffff) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_lineentry.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_lineentry.py index d97f2517f4bc..9c89792791f7 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_lineentry.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_lineentry.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetStartAddress()      obj.GetEndAddress() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py index 0747547b9cfd..5f0ebdae73b5 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.AddEvent(lldb.SBEvent())      obj.StartListeningForEvents(lldb.SBBroadcaster(), 0xffffffff) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_module.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_module.py index 0b9aa99167af..175550a5a0fc 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_module.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_module.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetFileSpec()      obj.GetPlatformFileSpec() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_process.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_process.py index 40132b199580..5a3e1e6903cf 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_process.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_process.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetTarget()      obj.GetByteOrder() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_section.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_section.py index 899130abe27d..5e25e94d017f 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_section.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_section.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.IsValid()      obj.GetName() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_stringlist.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_stringlist.py index 9d8242c9b27d..44111addba59 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_stringlist.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_stringlist.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.AppendString("another string")      obj.AppendString(None) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbol.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbol.py index 4a4c67a08804..d2d107a13c2a 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbol.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbol.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetName()      obj.GetMangledName() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbolcontext.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbolcontext.py index 01b5b7b793ea..ac4392539db1 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbolcontext.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbolcontext.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetModule()      obj.GetCompileUnit() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_target.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_target.py index 3b01be3e3440..af7f17b69e7b 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_target.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_target.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetProcess()      listener = lldb.SBListener() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_thread.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_thread.py index b69b22ea6a9f..088972532f74 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_thread.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_thread.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetStopReason()      obj.GetStopReasonDataCount() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_type.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_type.py index 5c801c1fbf2e..6016a9004ec2 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_type.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_type.py @@ -5,10 +5,11 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetName()      obj.GetByteSize() -    #obj.GetEncoding(5) +    # obj.GetEncoding(5)      obj.GetNumberChildren(True)      member = lldb.SBTypeMember()      obj.GetChildAtIndex(True, 0, member) diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_value.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_value.py index 2bb8c58e2546..f283177425a7 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_value.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_value.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetError()      obj.GetID() @@ -40,26 +41,26 @@ def fuzz_obj(obj):      for child_val in obj:          s = str(child_val)      error = lldb.SBError() -    obj.GetValueAsSigned (error, 0) -    obj.GetValueAsUnsigned (error, 0) +    obj.GetValueAsSigned(error, 0) +    obj.GetValueAsUnsigned(error, 0)      obj.GetValueAsSigned(0)      obj.GetValueAsUnsigned(0) -    obj.GetDynamicValue (lldb.eNoDynamicValues) -    obj.GetStaticValue () +    obj.GetDynamicValue(lldb.eNoDynamicValues) +    obj.GetStaticValue()      obj.IsDynamic()      invalid_type = lldb.SBType() -    obj.CreateChildAtOffset ("a", 12, invalid_type) -    obj.Cast (invalid_type) -    obj.CreateValueFromExpression ("pt->x", "pt->x") -    obj.CreateValueFromAddress ("x", 0x123, invalid_type) +    obj.CreateChildAtOffset("a", 12, invalid_type) +    obj.Cast(invalid_type) +    obj.CreateValueFromExpression("pt->x", "pt->x") +    obj.CreateValueFromAddress("x", 0x123, invalid_type)      invalid_data = lldb.SBData() -    obj.CreateValueFromData ("x", invalid_data, invalid_type) +    obj.CreateValueFromData("x", invalid_data, invalid_type)      obj.GetValueForExpressionPath("[0]")      obj.AddressOf()      obj.GetLoadAddress()      obj.GetAddress() -    obj.GetPointeeData (0, 1) -    obj.GetData () +    obj.GetPointeeData(0, 1) +    obj.GetData()      obj.GetTarget()      obj.GetProcess()      obj.GetThread() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_valuelist.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_valuelist.py index 32f12f93dd81..cbd9810c44ed 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_valuelist.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_valuelist.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.Append(lldb.SBValue())      obj.GetSize() diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_watchpoint.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_watchpoint.py index f462e62ff164..b30d3bb8014d 100644 --- a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_watchpoint.py +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_watchpoint.py @@ -5,6 +5,7 @@ Fuzz tests an object after the default construction to make sure it does not cra  import sys  import lldb +  def fuzz_obj(obj):      obj.GetID()      obj.IsValid() | 
