diff options
Diffstat (limited to 'lldb/test')
-rw-r--r-- | lldb/test/expression_command/test/TestExprs.py | 2 | ||||
-rw-r--r-- | lldb/test/lang/c/array_types/TestArrayTypes.py | 12 | ||||
-rw-r--r-- | lldb/test/lang/cpp/class_types/TestClassTypes.py | 2 | ||||
-rw-r--r-- | lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py | 6 | ||||
-rw-r--r-- | lldb/test/lldbutil.py | 4 | ||||
-rw-r--r-- | lldb/test/python_api/module_section/TestModuleAndSection.py | 10 | ||||
-rw-r--r-- | lldb/test/python_api/sbdata/TestSBData.py | 7 | ||||
-rw-r--r-- | lldb/test/python_api/symbol-context/TestSymbolContext.py | 2 |
8 files changed, 23 insertions, 22 deletions
diff --git a/lldb/test/expression_command/test/TestExprs.py b/lldb/test/expression_command/test/TestExprs.py index fe60b3e9726..0f7dc9e4abd 100644 --- a/lldb/test/expression_command/test/TestExprs.py +++ b/lldb/test/expression_command/test/TestExprs.py @@ -94,7 +94,7 @@ class BasicExprCommandsTestCase(TestBase): self.assertTrue(breakpoint, VALID_BREAKPOINT) # Verify the breakpoint just created. - self.expect(repr(breakpoint), BREAKPOINT_CREATED, exe=False, + self.expect(str(breakpoint), BREAKPOINT_CREATED, exe=False, substrs = ['main.cpp', str(self.line)]) diff --git a/lldb/test/lang/c/array_types/TestArrayTypes.py b/lldb/test/lang/c/array_types/TestArrayTypes.py index 7aca609d84b..a2d94b16a89 100644 --- a/lldb/test/lang/c/array_types/TestArrayTypes.py +++ b/lldb/test/lang/c/array_types/TestArrayTypes.py @@ -101,7 +101,7 @@ class ArrayTypesTestCase(TestBase): self.assertTrue(breakpoint, VALID_BREAKPOINT) # Sanity check the print representation of breakpoint. - bp = repr(breakpoint) + bp = str(breakpoint) self.expect(bp, msg="Breakpoint looks good", exe=False, substrs = ["file ='main.c'", "line = %d" % self.line, @@ -114,7 +114,7 @@ class ArrayTypesTestCase(TestBase): self.assertTrue(process, PROCESS_IS_VALID) # Sanity check the print representation of process. - proc = repr(process) + proc = str(process) self.expect(proc, msg="Process looks good", exe=False, substrs = ["state = stopped", "executable = a.out"]) @@ -127,7 +127,7 @@ class ArrayTypesTestCase(TestBase): stop_reason_to_str(thread.GetStopReason())) # Sanity check the print representation of thread. - thr = repr(thread) + thr = str(thread) self.expect(thr, "Thread looks good with stop reason = breakpoint", exe=False, substrs = ["tid = 0x%4.4x" % thread.GetThreadID()]) @@ -135,7 +135,7 @@ class ArrayTypesTestCase(TestBase): self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE) # The breakpoint should be resolved by now. - bp = repr(breakpoint) + bp = str(breakpoint) self.expect(bp, "Breakpoint looks good and is resolved", exe=False, substrs = ["file ='main.c'", "line = %d" % self.line, @@ -143,7 +143,7 @@ class ArrayTypesTestCase(TestBase): # Sanity check the print representation of frame. frame = thread.GetFrameAtIndex(0) - frm = repr(frame) + frm = str(frame) self.expect(frm, "Frame looks good with correct index %d" % frame.GetFrameID(), exe=False, @@ -152,7 +152,7 @@ class ArrayTypesTestCase(TestBase): # Lookup the "strings" string array variable and sanity check its print # representation. variable = frame.FindVariable("strings") - var = repr(variable) + var = str(variable) self.expect(var, "Variable for 'strings' looks good with correct name", exe=False, substrs = ["%s" % variable.GetName()]) self.DebugSBValue(variable) diff --git a/lldb/test/lang/cpp/class_types/TestClassTypes.py b/lldb/test/lang/cpp/class_types/TestClassTypes.py index 4be117a0d0a..21bb489264b 100644 --- a/lldb/test/lang/cpp/class_types/TestClassTypes.py +++ b/lldb/test/lang/cpp/class_types/TestClassTypes.py @@ -114,7 +114,7 @@ class ClassTypesTestCase(TestBase): self.assertTrue(breakpoint, VALID_BREAKPOINT) # Verify the breakpoint just created. - self.expect(repr(breakpoint), BREAKPOINT_CREATED, exe=False, + self.expect(str(breakpoint), BREAKPOINT_CREATED, exe=False, substrs = ['main.cpp', str(self.line)]) diff --git a/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py b/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py index 64aba7f3dde..80a224e5307 100644 --- a/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py +++ b/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py @@ -43,7 +43,7 @@ class StdCXXDisassembleTestCase(TestBase): process = target.GetProcess() # The process should be in a 'stopped' state. - self.expect(repr(process), STOPPED_DUE_TO_BREAKPOINT, exe=False, + self.expect(str(process), STOPPED_DUE_TO_BREAKPOINT, exe=False, substrs = ["a.out", "stopped"]) @@ -61,7 +61,7 @@ class StdCXXDisassembleTestCase(TestBase): module = target.GetModuleAtIndex(i) fs = module.GetFileSpec() if (fs.GetFilename().startswith("libstdc++")): - lib_stdcxx = repr(fs) + lib_stdcxx = str(fs) break # At this point, lib_stdcxx is the full path to the stdc++ library and @@ -70,7 +70,7 @@ class StdCXXDisassembleTestCase(TestBase): self.expect(fs.GetFilename(), "Libraray StdC++ is located", exe=False, substrs = ["libstdc++"]) - self.runCmd("image dump symtab %s" % repr(fs)) + self.runCmd("image dump symtab %s" % str(fs)) raw_output = self.res.GetOutput() # Now, look for every 'Code' symbol and feed its load address into the # command: 'disassemble -s load_address -e end_address', where the diff --git a/lldb/test/lldbutil.py b/lldb/test/lldbutil.py index 8341f2cd9b7..7e4b4fcee8e 100644 --- a/lldb/test/lldbutil.py +++ b/lldb/test/lldbutil.py @@ -459,7 +459,7 @@ def print_stacktraces(process, string_buffer = False): output = StringIO.StringIO() if string_buffer else sys.stdout - print >> output, "Stack traces for " + repr(process) + print >> output, "Stack traces for " + str(process) for thread in process: print >> output, print_stacktrace(thread, string_buffer=True) @@ -516,7 +516,7 @@ def print_registers(frame, string_buffer = False): output = StringIO.StringIO() if string_buffer else sys.stdout - print >> output, "Register sets for " + repr(frame) + print >> output, "Register sets for " + str(frame) registerSet = frame.GetRegisters() # Return type of SBValueList. print >> output, "Frame registers (size of register set = %d):" % registerSet.GetSize() diff --git a/lldb/test/python_api/module_section/TestModuleAndSection.py b/lldb/test/python_api/module_section/TestModuleAndSection.py index 1ebe9d33433..f9562cbf490 100644 --- a/lldb/test/python_api/module_section/TestModuleAndSection.py +++ b/lldb/test/python_api/module_section/TestModuleAndSection.py @@ -43,7 +43,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): # Get the executable module at index 0. exe_module = target.GetModuleAtIndex(0) - print "Exe module: %s" % repr(exe_module) + print "Exe module: %s" % str(exe_module) print "Number of sections: %d" % exe_module.GetNumSections() INDENT = ' ' * 4 INDENT2 = INDENT * 2 @@ -52,14 +52,14 @@ class ModuleAndSectionAPIsTestCase(TestBase): print INDENT + "Number of subsections: %d" % sec.GetNumSubSections() if sec.GetNumSubSections() == 0: for sym in exe_module.symbol_in_section_iter(sec): - print INDENT + repr(sym) + print INDENT + str(sym) print INDENT + "symbol type: %s" % symbol_type_to_str(sym.GetType()) else: for subsec in sec: - print INDENT + repr(subsec) + print INDENT + str(subsec) # Now print the symbols belonging to the subsection.... for sym in exe_module.symbol_in_section_iter(subsec): - print INDENT2 + repr(sym) + print INDENT2 + str(sym) print INDENT2 + "symbol type: %s" % symbol_type_to_str(sym.GetType()) def module_and_section_boundary_condition(self): @@ -80,7 +80,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): # Get the executable module at index 0. exe_module = target.GetModuleAtIndex(0) - print "Exe module: %s" % repr(exe_module) + print "Exe module: %s" % str(exe_module) print "Number of sections: %d" % exe_module.GetNumSections() # Boundary condition testings. Should not crash lldb! diff --git a/lldb/test/python_api/sbdata/TestSBData.py b/lldb/test/python_api/sbdata/TestSBData.py index 9d5b5c06765..e9856d7b85e 100644 --- a/lldb/test/python_api/sbdata/TestSBData.py +++ b/lldb/test/python_api/sbdata/TestSBData.py @@ -53,9 +53,9 @@ class SBDataAPICase(TestBase): thread = process.GetThreadAtIndex(0) frame = thread.GetSelectedFrame() - + print frame foobar = frame.FindVariable('foobar') - + self.assertTrue(foobar.IsValid()) if self.TraceOn(): print foobar @@ -98,6 +98,7 @@ class SBDataAPICase(TestBase): self.assertTrue(data.GetUnsignedInt32(error, offset) == 0, 'do not read beyond end') star_foobar = foobar.Dereference() + self.assertTrue(star_foobar.IsValid()) data = star_foobar.GetData() @@ -118,7 +119,7 @@ class SBDataAPICase(TestBase): nothing = foobar.CreateValueFromAddress("nothing", foobar_addr, star_foobar.GetType().GetBasicType(lldb.eBasicTypeInvalid)) new_foobar = foobar.CreateValueFromAddress("f00", foobar_addr, star_foobar.GetType()) - + self.assertTrue(new_foobar.IsValid()) if self.TraceOn(): print new_foobar diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py index b601920e10f..ad0a55b22f4 100644 --- a/lldb/test/python_api/symbol-context/TestSymbolContext.py +++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py @@ -68,7 +68,7 @@ class SymbolContextAPITestCase(TestBase): substrs = [os.path.join(self.mydir, 'a.out')]) compileUnit = context.GetCompileUnit() - self.expect(repr(compileUnit), "The compile unit should match", exe=False, + self.expect(str(compileUnit), "The compile unit should match", exe=False, substrs = [os.path.join(self.mydir, 'main.c')]) function = context.GetFunction() |