mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
[lldb] Replace assertEquals with assertEqual (NFC) (#82073)
assertEquals is a deprecated alias for assertEqual and has been removed in Python 3.12. This wasn't an issue previously because we used a vendored version of the unittest module. Now that we use the built-in version this gets updated together with the Python version used to run the test suite.
This commit is contained in:
committed by
GitHub
parent
8443ce563b
commit
80fcecb13c
@@ -696,24 +696,24 @@ def check_breakpoint(
|
||||
test.assertTrue(bkpt.IsValid(), "Breakpoint is not valid.")
|
||||
|
||||
if expected_locations is not None:
|
||||
test.assertEquals(expected_locations, bkpt.GetNumLocations())
|
||||
test.assertEqual(expected_locations, bkpt.GetNumLocations())
|
||||
|
||||
if expected_resolved_count is not None:
|
||||
test.assertEquals(expected_resolved_count, bkpt.GetNumResolvedLocations())
|
||||
test.assertEqual(expected_resolved_count, bkpt.GetNumResolvedLocations())
|
||||
else:
|
||||
expected_resolved_count = bkpt.GetNumLocations()
|
||||
if location_id is None:
|
||||
test.assertEquals(expected_resolved_count, bkpt.GetNumResolvedLocations())
|
||||
test.assertEqual(expected_resolved_count, bkpt.GetNumResolvedLocations())
|
||||
|
||||
if expected_hit_count is not None:
|
||||
test.assertEquals(expected_hit_count, bkpt.GetHitCount())
|
||||
test.assertEqual(expected_hit_count, bkpt.GetHitCount())
|
||||
|
||||
if location_id is not None:
|
||||
loc_bkpt = bkpt.FindLocationByID(location_id)
|
||||
test.assertTrue(loc_bkpt.IsValid(), "Breakpoint location is not valid.")
|
||||
test.assertEquals(loc_bkpt.IsResolved(), expected_location_resolved)
|
||||
test.assertEqual(loc_bkpt.IsResolved(), expected_location_resolved)
|
||||
if expected_location_hit_count is not None:
|
||||
test.assertEquals(expected_location_hit_count, loc_bkpt.GetHitCount())
|
||||
test.assertEqual(expected_location_hit_count, loc_bkpt.GetHitCount())
|
||||
|
||||
|
||||
# ==================================================
|
||||
|
||||
@@ -48,7 +48,7 @@ class FrameDisassembleTestCase(TestBase):
|
||||
)
|
||||
|
||||
# The hit count for the breakpoint should be 1.
|
||||
self.assertEquals(breakpoint.GetHitCount(), 1)
|
||||
self.assertEqual(breakpoint.GetHitCount(), 1)
|
||||
|
||||
frame = threads[0].GetFrameAtIndex(0)
|
||||
disassembly = frame.Disassemble()
|
||||
|
||||
@@ -75,7 +75,7 @@ class ExprCommandThatRestartsTestCase(TestBase):
|
||||
value = frame.EvaluateExpression("call_me (%d)" % (num_sigchld), options)
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsSigned(-1), num_sigchld)
|
||||
self.assertEqual(value.GetValueAsSigned(-1), num_sigchld)
|
||||
|
||||
self.check_after_call(num_sigchld)
|
||||
|
||||
@@ -92,7 +92,7 @@ class ExprCommandThatRestartsTestCase(TestBase):
|
||||
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsSigned(-1), num_sigchld)
|
||||
self.assertEqual(value.GetValueAsSigned(-1), num_sigchld)
|
||||
self.check_after_call(num_sigchld)
|
||||
|
||||
# Now set the signal to print but not stop and make sure that calling
|
||||
@@ -103,7 +103,7 @@ class ExprCommandThatRestartsTestCase(TestBase):
|
||||
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsSigned(-1), num_sigchld)
|
||||
self.assertEqual(value.GetValueAsSigned(-1), num_sigchld)
|
||||
self.check_after_call(num_sigchld)
|
||||
|
||||
# Now set this unwind on error to false, and make sure that we still
|
||||
@@ -113,7 +113,7 @@ class ExprCommandThatRestartsTestCase(TestBase):
|
||||
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsSigned(-1), num_sigchld)
|
||||
self.assertEqual(value.GetValueAsSigned(-1), num_sigchld)
|
||||
self.check_after_call(num_sigchld)
|
||||
|
||||
# Okay, now set UnwindOnError to true, and then make the signal behavior to stop
|
||||
|
||||
@@ -46,7 +46,7 @@ class ExprCommandWithThrowTestCase(TestBase):
|
||||
|
||||
value = frame.EvaluateExpression("[my_class callMeIThrow]", options)
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertEquals(value.GetError().Success(), False)
|
||||
self.assertEqual(value.GetError().Success(), False)
|
||||
|
||||
self.check_after_call()
|
||||
|
||||
@@ -86,7 +86,7 @@ class ExprCommandWithThrowTestCase(TestBase):
|
||||
value = frame.EvaluateExpression("[my_class iCatchMyself]", options)
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsUnsigned(), 57)
|
||||
self.assertEqual(value.GetValueAsUnsigned(), 57)
|
||||
self.check_after_call()
|
||||
options.SetTrapExceptions(True)
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ class CommandLineExprCompletionTestCase(TestBase):
|
||||
for m in match_strings:
|
||||
available_completions.append(m)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
num_matches,
|
||||
0,
|
||||
"Got matches, but didn't expect any: " + str(available_completions),
|
||||
|
||||
@@ -46,7 +46,7 @@ class ExprCommandWithFixits(TestBase):
|
||||
value = frame.EvaluateExpression("my_pointer.first", options)
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsUnsigned(), 10)
|
||||
self.assertEqual(value.GetValueAsUnsigned(), 10)
|
||||
|
||||
# Try with one error in a top-level expression.
|
||||
# The Fix-It changes "ptr.m" to "ptr->m".
|
||||
@@ -56,14 +56,14 @@ class ExprCommandWithFixits(TestBase):
|
||||
# unknown error . If a parsing error would have happened we
|
||||
# would get a different error kind, so let's check the error
|
||||
# kind here.
|
||||
self.assertEquals(value.GetError().GetCString(), "unknown error")
|
||||
self.assertEqual(value.GetError().GetCString(), "unknown error")
|
||||
|
||||
# Try with two errors:
|
||||
two_error_expression = "my_pointer.second->a"
|
||||
value = frame.EvaluateExpression(two_error_expression, options)
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsUnsigned(), 20)
|
||||
self.assertEqual(value.GetValueAsUnsigned(), 20)
|
||||
|
||||
# Try a Fix-It that is stored in the 'note:' diagnostic of an error.
|
||||
# The Fix-It here is adding parantheses around the ToStr parameters.
|
||||
@@ -71,7 +71,7 @@ class ExprCommandWithFixits(TestBase):
|
||||
value = frame.EvaluateExpression(fixit_in_note_expr, options)
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetSummary(), '"(0 {, })"')
|
||||
self.assertEqual(value.GetSummary(), '"(0 {, })"')
|
||||
|
||||
# Now turn off the fixits, and the expression should fail:
|
||||
options.SetAutoApplyFixIts(False)
|
||||
@@ -178,7 +178,7 @@ class ExprCommandWithFixits(TestBase):
|
||||
multiple_runs_options.SetRetriesWithFixIts(2)
|
||||
value = frame.EvaluateExpression(two_runs_expr, multiple_runs_options)
|
||||
# This error signals success for top level expressions.
|
||||
self.assertEquals(value.GetError().GetCString(), "unknown error")
|
||||
self.assertEqual(value.GetError().GetCString(), "unknown error")
|
||||
|
||||
# Test that the code above compiles to the right thing.
|
||||
self.expect_expr("test_X(1)", result_type="int", result_value="123")
|
||||
|
||||
@@ -37,7 +37,7 @@ class SaveJITObjectsTestCase(TestBase):
|
||||
|
||||
self.cleanJITFiles()
|
||||
frame.EvaluateExpression("(void*)malloc(0x1)")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.countJITFiles(), 0, "No files emitted with save-jit-objects-dir empty"
|
||||
)
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class BasicExprCommandsTestCase(TestBase):
|
||||
)
|
||||
|
||||
# We should be stopped on the breakpoint with a hit count of 1.
|
||||
self.assertEquals(breakpoint.GetHitCount(), 1, BREAKPOINT_HIT_ONCE)
|
||||
self.assertEqual(breakpoint.GetHitCount(), 1, BREAKPOINT_HIT_ONCE)
|
||||
|
||||
#
|
||||
# Use Python API to evaluate expressions while stopped in a stack frame.
|
||||
@@ -169,15 +169,15 @@ class BasicExprCommandsTestCase(TestBase):
|
||||
self.expect(
|
||||
"expression -i true -- a_function_to_call()", substrs=["(int) $", " 1"]
|
||||
)
|
||||
self.assertEquals(callee_break.GetHitCount(), 1)
|
||||
self.assertEqual(callee_break.GetHitCount(), 1)
|
||||
|
||||
# Now try ignoring breakpoints using the SB API's:
|
||||
options = lldb.SBExpressionOptions()
|
||||
options.SetIgnoreBreakpoints(True)
|
||||
value = frame.EvaluateExpression("a_function_to_call()", options)
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertEquals(value.GetValueAsSigned(0), 2)
|
||||
self.assertEquals(callee_break.GetHitCount(), 2)
|
||||
self.assertEqual(value.GetValueAsSigned(0), 2)
|
||||
self.assertEqual(callee_break.GetHitCount(), 2)
|
||||
|
||||
# rdar://problem/8686536
|
||||
# CommandInterpreter::HandleCommand is stripping \'s from input for
|
||||
|
||||
@@ -46,7 +46,7 @@ class ExprCommandWithTimeoutsTestCase(TestBase):
|
||||
return_value = interp.HandleCommand(
|
||||
"expr -t 100 -u true -- wait_a_while(1000000)", result
|
||||
)
|
||||
self.assertEquals(return_value, lldb.eReturnStatusFailed)
|
||||
self.assertEqual(return_value, lldb.eReturnStatusFailed)
|
||||
|
||||
# Okay, now do it again with long enough time outs:
|
||||
|
||||
@@ -63,7 +63,7 @@ class ExprCommandWithTimeoutsTestCase(TestBase):
|
||||
return_value = interp.HandleCommand(
|
||||
"expr -t 1000000 -u true -- wait_a_while(1000)", result
|
||||
)
|
||||
self.assertEquals(return_value, lldb.eReturnStatusSuccessFinishResult)
|
||||
self.assertEqual(return_value, lldb.eReturnStatusSuccessFinishResult)
|
||||
|
||||
# Finally set the one thread timeout and make sure that doesn't change
|
||||
# things much:
|
||||
|
||||
@@ -42,7 +42,7 @@ class UnwindFromExpressionTest(TestBase):
|
||||
main_frame = self.thread.GetFrameAtIndex(0)
|
||||
val = main_frame.EvaluateExpression("second_function(47)", options)
|
||||
self.assertSuccess(val.GetError(), "We did complete the execution.")
|
||||
self.assertEquals(47, val.GetValueAsSigned())
|
||||
self.assertEqual(47, val.GetValueAsSigned())
|
||||
|
||||
@add_test_categories(["pyapi"])
|
||||
@expectedFlakeyNetBSD
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestFrameGuessLanguage(TestBase):
|
||||
)
|
||||
|
||||
# The hit count for the breakpoint should be 1.
|
||||
self.assertEquals(breakpoint.GetHitCount(), 1)
|
||||
self.assertEqual(breakpoint.GetHitCount(), 1)
|
||||
|
||||
thread = threads[0]
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class TestFrameVar(TestBase):
|
||||
)
|
||||
|
||||
# The hit count for the breakpoint should be 1.
|
||||
self.assertEquals(breakpoint.GetHitCount(), 1)
|
||||
self.assertEqual(breakpoint.GetHitCount(), 1)
|
||||
|
||||
frame = threads[0].GetFrameAtIndex(0)
|
||||
command_result = lldb.SBCommandReturnObject()
|
||||
|
||||
@@ -62,7 +62,7 @@ class LogTestCase(TestBase):
|
||||
contents = f.read()
|
||||
|
||||
# check that it got removed
|
||||
self.assertEquals(contents.find("bacon"), -1)
|
||||
self.assertEqual(contents.find("bacon"), -1)
|
||||
|
||||
# Check that lldb can append to a log file
|
||||
def test_log_append(self):
|
||||
@@ -79,7 +79,7 @@ class LogTestCase(TestBase):
|
||||
contents = f.read()
|
||||
|
||||
# check that it is still there
|
||||
self.assertEquals(contents.find("bacon"), 0)
|
||||
self.assertEqual(contents.find("bacon"), 0)
|
||||
|
||||
# Enable all log options and check that nothing crashes.
|
||||
@skipIfWindows
|
||||
|
||||
@@ -57,7 +57,7 @@ class MemoryReadTestCase(TestBase):
|
||||
address = int(items[0], 0)
|
||||
argc = int(items[1], 0)
|
||||
self.assertGreater(address, 0)
|
||||
self.assertEquals(argc, 1)
|
||||
self.assertEqual(argc, 1)
|
||||
|
||||
# (lldb) memory read --format uint32_t[] --size 4 --count 4 `&argc`
|
||||
# 0x7fff5fbff9a0: {0x00000001}
|
||||
@@ -130,7 +130,7 @@ class MemoryReadTestCase(TestBase):
|
||||
# Check that we got back 4 0x0000 etc bytes
|
||||
for o in objects_read:
|
||||
self.assertEqual(len(o), expected_object_length)
|
||||
self.assertEquals(len(objects_read), 4)
|
||||
self.assertEqual(len(objects_read), 4)
|
||||
|
||||
def test_memory_read_file(self):
|
||||
self.build_run_stop()
|
||||
|
||||
@@ -53,11 +53,11 @@ class TestStepOverWatchpoint(TestBase):
|
||||
lldb.eStopReasonWatchpoint,
|
||||
STOPPED_DUE_TO_WATCHPOINT,
|
||||
)
|
||||
self.assertEquals(thread.GetStopDescription(20), "watchpoint 1")
|
||||
self.assertEqual(thread.GetStopDescription(20), "watchpoint 1")
|
||||
|
||||
process.Continue()
|
||||
self.assertState(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
|
||||
self.assertEquals(thread.GetStopDescription(20), "step over")
|
||||
self.assertEqual(thread.GetStopDescription(20), "step over")
|
||||
|
||||
self.step_inst_for_watchpoint(1)
|
||||
|
||||
@@ -95,11 +95,11 @@ class TestStepOverWatchpoint(TestBase):
|
||||
lldb.eStopReasonWatchpoint,
|
||||
STOPPED_DUE_TO_WATCHPOINT,
|
||||
)
|
||||
self.assertEquals(thread.GetStopDescription(20), "watchpoint 1")
|
||||
self.assertEqual(thread.GetStopDescription(20), "watchpoint 1")
|
||||
|
||||
process.Continue()
|
||||
self.assertState(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
|
||||
self.assertEquals(thread.GetStopDescription(20), "step over")
|
||||
self.assertEqual(thread.GetStopDescription(20), "step over")
|
||||
|
||||
self.step_inst_for_watchpoint(1)
|
||||
|
||||
@@ -113,7 +113,7 @@ class TestStepOverWatchpoint(TestBase):
|
||||
self.assertFalse(watchpoint_hit, "Watchpoint already hit.")
|
||||
expected_stop_desc = "watchpoint %d" % wp_id
|
||||
actual_stop_desc = self.thread().GetStopDescription(20)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
actual_stop_desc, expected_stop_desc, "Watchpoint ID didn't match."
|
||||
)
|
||||
watchpoint_hit = True
|
||||
|
||||
@@ -22,7 +22,7 @@ class JobControlTest(PExpectTest):
|
||||
status = int(self.child.match[1])
|
||||
|
||||
self.assertTrue(os.WIFSTOPPED(status))
|
||||
self.assertEquals(os.WSTOPSIG(status), signal.SIGTSTP)
|
||||
self.assertEqual(os.WSTOPSIG(status), signal.SIGTSTP)
|
||||
|
||||
os.kill(self.lldb_pid, signal.SIGCONT)
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class AddressBreakpointTestCase(TestBase):
|
||||
)
|
||||
|
||||
# The hit count for the breakpoint should be 1.
|
||||
self.assertEquals(breakpoint.GetHitCount(), 1)
|
||||
self.assertEqual(breakpoint.GetHitCount(), 1)
|
||||
|
||||
process.Kill()
|
||||
|
||||
@@ -82,4 +82,4 @@ class AddressBreakpointTestCase(TestBase):
|
||||
|
||||
# The hit count for the breakpoint should be 1, since we reset counts
|
||||
# for each run.
|
||||
self.assertEquals(breakpoint.GetHitCount(), 1)
|
||||
self.assertEqual(breakpoint.GetHitCount(), 1)
|
||||
|
||||
@@ -40,7 +40,7 @@ class BadAddressBreakpointTestCase(TestBase):
|
||||
bkpt = target.BreakpointCreateByAddress(illegal_address)
|
||||
# Verify that breakpoint is not resolved.
|
||||
for bp_loc in bkpt:
|
||||
self.assertEquals(bp_loc.IsResolved(), False)
|
||||
self.assertEqual(bp_loc.IsResolved(), False)
|
||||
else:
|
||||
self.fail(
|
||||
"Could not find an illegal address at which to set a bad breakpoint."
|
||||
|
||||
@@ -361,8 +361,8 @@ class BreakpointCommandTestCase(TestBase):
|
||||
self.runCmd("run", RUN_SUCCEEDED)
|
||||
|
||||
# Check the value of canary variables.
|
||||
self.assertEquals("one liner was here", side_effect.one_liner)
|
||||
self.assertEquals("function was here", side_effect.bktptcmd)
|
||||
self.assertEqual("one liner was here", side_effect.one_liner)
|
||||
self.assertEqual("function was here", side_effect.bktptcmd)
|
||||
|
||||
# Finish the program.
|
||||
self.runCmd("process continue")
|
||||
@@ -558,10 +558,10 @@ class BreakpointCommandTestCase(TestBase):
|
||||
return json.loads(stream.GetData())
|
||||
|
||||
def verify_source_map_entry_pair(self, entry, original, replacement):
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
entry[0], original, "source map entry 'original' does not match"
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
entry[1], replacement, "source map entry 'replacement' does not match"
|
||||
)
|
||||
|
||||
@@ -604,7 +604,7 @@ class BreakpointCommandTestCase(TestBase):
|
||||
# "./a/b/c/main.cpp".
|
||||
|
||||
source_map_json = self.get_source_map_json()
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(source_map_json), 0, "source map should be empty initially"
|
||||
)
|
||||
self.verify_source_map_deduce_statistics(target, 0)
|
||||
@@ -621,7 +621,7 @@ class BreakpointCommandTestCase(TestBase):
|
||||
)
|
||||
|
||||
source_map_json = self.get_source_map_json()
|
||||
self.assertEquals(len(source_map_json), 1, "source map should not be empty")
|
||||
self.assertEqual(len(source_map_json), 1, "source map should not be empty")
|
||||
self.verify_source_map_entry_pair(source_map_json[0], ".", "/x/y")
|
||||
self.verify_source_map_deduce_statistics(target, 1)
|
||||
|
||||
@@ -640,7 +640,7 @@ class BreakpointCommandTestCase(TestBase):
|
||||
)
|
||||
|
||||
source_map_json = self.get_source_map_json()
|
||||
self.assertEquals(len(source_map_json), 0, "source map should not be deduced")
|
||||
self.assertEqual(len(source_map_json), 0, "source map should not be deduced")
|
||||
|
||||
def test_breakpoint_statistics_hitcount(self):
|
||||
"""Test breakpoints statistics have hitCount field."""
|
||||
|
||||
@@ -163,7 +163,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase):
|
||||
|
||||
# Now finish, and make sure the return value is correct.
|
||||
threads = lldbutil.get_threads_stopped_at_breakpoint(self.process, body_bkpt)
|
||||
self.assertEquals(len(threads), 1, "Stopped at inner breakpoint.")
|
||||
self.assertEqual(len(threads), 1, "Stopped at inner breakpoint.")
|
||||
self.thread = threads[0]
|
||||
|
||||
print(
|
||||
@@ -171,12 +171,12 @@ class PythonBreakpointCommandSettingTestCase(TestBase):
|
||||
list_bkpt.GetNumLocations(), list_bkpt.GetHitCount()
|
||||
)
|
||||
)
|
||||
self.assertEquals("callback was here", side_effect.callback)
|
||||
self.assertEquals("function was here", side_effect.bktptcmd)
|
||||
self.assertEquals("I am fancy", side_effect.fancy)
|
||||
self.assertEquals("I am fancier", side_effect.fancier)
|
||||
self.assertEquals("Not so fancy", side_effect.not_so_fancy)
|
||||
self.assertEquals("I come from list input", side_effect.from_list)
|
||||
self.assertEqual("callback was here", side_effect.callback)
|
||||
self.assertEqual("function was here", side_effect.bktptcmd)
|
||||
self.assertEqual("I am fancy", side_effect.fancy)
|
||||
self.assertEqual("I am fancier", side_effect.fancier)
|
||||
self.assertEqual("Not so fancy", side_effect.not_so_fancy)
|
||||
self.assertEqual("I come from list input", side_effect.from_list)
|
||||
|
||||
def do_bad_args_to_python_command(self):
|
||||
error = lldb.SBError()
|
||||
|
||||
@@ -18,17 +18,17 @@ class BreakpointIDTestCase(TestBase):
|
||||
bpno = lldbutil.run_break_set_by_symbol(
|
||||
self, "product", num_expected_locations=-1, sym_exact=False
|
||||
)
|
||||
self.assertEquals(bpno, 1, "First breakpoint number is 1.")
|
||||
self.assertEqual(bpno, 1, "First breakpoint number is 1.")
|
||||
|
||||
bpno = lldbutil.run_break_set_by_symbol(
|
||||
self, "sum", num_expected_locations=-1, sym_exact=False
|
||||
)
|
||||
self.assertEquals(bpno, 2, "Second breakpoint number is 2.")
|
||||
self.assertEqual(bpno, 2, "Second breakpoint number is 2.")
|
||||
|
||||
bpno = lldbutil.run_break_set_by_symbol(
|
||||
self, "junk", num_expected_locations=0, sym_exact=False
|
||||
)
|
||||
self.assertEquals(bpno, 3, "Third breakpoint number is 3.")
|
||||
self.assertEqual(bpno, 3, "Third breakpoint number is 3.")
|
||||
|
||||
self.expect(
|
||||
"breakpoint disable 1.1 - 2.2 ",
|
||||
|
||||
@@ -70,7 +70,7 @@ class BreakpointLocationsTestCase(TestBase):
|
||||
bkpt_cond = "1 == 0"
|
||||
bkpt.SetCondition(bkpt_cond)
|
||||
self.assertEqual(bkpt.GetCondition(), bkpt_cond, "Successfully set condition")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
bkpt.location[0].GetCondition(),
|
||||
bkpt.GetCondition(),
|
||||
"Conditions are the same",
|
||||
|
||||
@@ -130,12 +130,12 @@ class BreakpointNames(TestBase):
|
||||
name_list = lldb.SBStringList()
|
||||
bkpt.GetNames(name_list)
|
||||
num_names = name_list.GetSize()
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
num_names, 1, "Name list has %d items, expected 1." % (num_names)
|
||||
)
|
||||
|
||||
name = name_list.GetStringAtIndex(0)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
name,
|
||||
other_bkpt_name,
|
||||
"Remaining name was: %s expected %s." % (name, other_bkpt_name),
|
||||
@@ -190,10 +190,10 @@ class BreakpointNames(TestBase):
|
||||
bkpts = lldb.SBBreakpointList(self.target)
|
||||
self.target.FindBreakpointsByName(bkpt_name, bkpts)
|
||||
|
||||
self.assertEquals(bkpts.GetSize(), 1, "One breakpoint matched.")
|
||||
self.assertEqual(bkpts.GetSize(), 1, "One breakpoint matched.")
|
||||
found_bkpt = bkpts.GetBreakpointAtIndex(0)
|
||||
self.assertEquals(bkpt.GetID(), found_bkpt.GetID(), "The right breakpoint.")
|
||||
self.assertEquals(bkpt.GetID(), bkpt_id, "With the same ID as before.")
|
||||
self.assertEqual(bkpt.GetID(), found_bkpt.GetID(), "The right breakpoint.")
|
||||
self.assertEqual(bkpt.GetID(), bkpt_id, "With the same ID as before.")
|
||||
|
||||
retval = lldb.SBCommandReturnObject()
|
||||
self.dbg.GetCommandInterpreter().HandleCommand(
|
||||
|
||||
@@ -27,7 +27,7 @@ class ConsecutiveBreakpointsTestCase(TestBase):
|
||||
|
||||
address = frame.GetPCAddress()
|
||||
instructions = self.target.ReadInstructions(address, 2)
|
||||
self.assertEquals(len(instructions), 2)
|
||||
self.assertEqual(len(instructions), 2)
|
||||
self.bkpt_address = instructions[1].GetAddress()
|
||||
self.breakpoint2 = self.target.BreakpointCreateByAddress(
|
||||
self.bkpt_address.GetLoadAddress(self.target)
|
||||
@@ -68,7 +68,7 @@ class ConsecutiveBreakpointsTestCase(TestBase):
|
||||
self.thread.StepInstruction(step_over)
|
||||
|
||||
self.assertState(self.process.GetState(), lldb.eStateStopped)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(self.target),
|
||||
self.bkpt_address.GetLoadAddress(self.target),
|
||||
)
|
||||
@@ -96,11 +96,11 @@ class ConsecutiveBreakpointsTestCase(TestBase):
|
||||
self.thread.StepInstruction(step_over)
|
||||
|
||||
self.assertState(self.process.GetState(), lldb.eStateStopped)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(self.target),
|
||||
self.bkpt_address.GetLoadAddress(self.target),
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread.GetStopReason(),
|
||||
lldb.eStopReasonPlanComplete,
|
||||
"Stop reason should be 'plan complete'",
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestCPPBreakpointLocations(TestBase):
|
||||
name = bp_dict["name"]
|
||||
names = bp_dict["loc_names"]
|
||||
bp = target.BreakpointCreateByName(name)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
bp.GetNumLocations(),
|
||||
len(names),
|
||||
"Make sure we find the right number of breakpoint locations for {}".format(
|
||||
@@ -157,7 +157,7 @@ class TestCPPBreakpointLocations(TestBase):
|
||||
bp_loc_names = {
|
||||
bp_loc.GetAddress().GetFunction().GetName() for bp_loc in bp
|
||||
}
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
bp_loc_names, loc_names, "Breakpoint set on the correct symbol"
|
||||
)
|
||||
|
||||
@@ -165,13 +165,13 @@ class TestCPPBreakpointLocations(TestBase):
|
||||
symbol_addresses = set()
|
||||
for symbol in symbols:
|
||||
sc_list = target.FindSymbols(symbol, lldb.eSymbolTypeCode)
|
||||
self.assertEquals(sc_list.GetSize(), 1, "Found symbol " + symbol)
|
||||
self.assertEqual(sc_list.GetSize(), 1, "Found symbol " + symbol)
|
||||
symbol = sc_list.GetContextAtIndex(0).GetSymbol()
|
||||
symbol_addresses.add(
|
||||
symbol.GetStartAddress().GetLoadAddress(target)
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
symbol_addresses, bp_addresses, "Breakpoint set on correct address"
|
||||
)
|
||||
finally:
|
||||
|
||||
@@ -51,7 +51,7 @@ class TestCPPExceptionBreakpoint(TestBase):
|
||||
thread_list = lldbutil.get_threads_stopped_at_breakpoint(
|
||||
process, exception_bkpt
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "One thread stopped at the exception breakpoint."
|
||||
)
|
||||
|
||||
@@ -84,6 +84,6 @@ class TestCPPExceptionBreakpoint(TestBase):
|
||||
thread_list = lldbutil.get_threads_stopped_at_breakpoint(
|
||||
process, exception_bkpt
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "One thread stopped at the exception breakpoint."
|
||||
)
|
||||
|
||||
@@ -52,7 +52,7 @@ class TestSourceRegexBreakpoints(TestBase):
|
||||
a_func_line = line_number("a.c", "Set A breakpoint here")
|
||||
line_entry = address.GetLineEntry()
|
||||
self.assertTrue(line_entry.IsValid(), "Got a valid line entry.")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
line_entry.line,
|
||||
a_func_line,
|
||||
"Our line number matches the one lldbtest found.",
|
||||
|
||||
@@ -59,7 +59,7 @@ class StepOverBreakpointsTestCase(TestBase):
|
||||
def test_step_instruction(self):
|
||||
# Count instructions between breakpoint_1 and breakpoint_4
|
||||
contextList = self.target.FindFunctions("main", lldb.eFunctionNameTypeAuto)
|
||||
self.assertEquals(contextList.GetSize(), 1)
|
||||
self.assertEqual(contextList.GetSize(), 1)
|
||||
symbolContext = contextList.GetContextAtIndex(0)
|
||||
function = symbolContext.GetFunction()
|
||||
self.assertTrue(function)
|
||||
@@ -83,7 +83,7 @@ class StepOverBreakpointsTestCase(TestBase):
|
||||
)
|
||||
if self.thread.GetStopReason() == lldb.eStopReasonBreakpoint:
|
||||
# we should not stop on breakpoint_2 and _3 because they have false condition
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread.GetFrameAtIndex(0).GetLineEntry().GetLine(), self.line4
|
||||
)
|
||||
# breakpoint_2 and _3 should not affect step count
|
||||
@@ -113,13 +113,13 @@ class StepOverBreakpointsTestCase(TestBase):
|
||||
thread1 = lldbutil.get_one_thread_stopped_at_breakpoint(
|
||||
self.process, self.breakpoint4
|
||||
)
|
||||
self.assertEquals(self.thread, thread1, "Didn't stop at breakpoint 4.")
|
||||
self.assertEqual(self.thread, thread1, "Didn't stop at breakpoint 4.")
|
||||
|
||||
# Check that stepping does not affect breakpoint's hit count
|
||||
self.assertEquals(self.breakpoint1.GetHitCount(), 1)
|
||||
self.assertEquals(self.breakpoint2.GetHitCount(), 0)
|
||||
self.assertEquals(self.breakpoint3.GetHitCount(), 0)
|
||||
self.assertEquals(self.breakpoint4.GetHitCount(), 1)
|
||||
self.assertEqual(self.breakpoint1.GetHitCount(), 1)
|
||||
self.assertEqual(self.breakpoint2.GetHitCount(), 0)
|
||||
self.assertEqual(self.breakpoint3.GetHitCount(), 0)
|
||||
self.assertEqual(self.breakpoint4.GetHitCount(), 1)
|
||||
|
||||
# Run the process until termination
|
||||
self.process.Continue()
|
||||
|
||||
@@ -43,12 +43,12 @@ class ThreadPlanUserBreakpointsTestCase(TestBase):
|
||||
thread1 = lldbutil.get_one_thread_stopped_at_breakpoint(
|
||||
self.process, self.breakpoints[breakpoint_idx]
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread, thread1, "Didn't stop at breakpoint %i." % breakpoint_idx
|
||||
)
|
||||
else:
|
||||
# Breakpoints are inactive, stop reason is plan complete
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread.GetStopReason(),
|
||||
lldb.eStopReasonPlanComplete,
|
||||
"Expected stop reason to be step into/over/out for inactive breakpoint %i line."
|
||||
|
||||
@@ -51,23 +51,23 @@ class FormatPropagationTestCase(TestBase):
|
||||
Y = parent.GetChildMemberWithName("Y")
|
||||
self.assertTrue(Y is not None and Y.IsValid(), "could not find Y")
|
||||
# check their values now
|
||||
self.assertEquals(X.GetValue(), "1", "X has an invalid value")
|
||||
self.assertEquals(Y.GetValue(), "2", "Y has an invalid value")
|
||||
self.assertEqual(X.GetValue(), "1", "X has an invalid value")
|
||||
self.assertEqual(Y.GetValue(), "2", "Y has an invalid value")
|
||||
# set the format on the parent
|
||||
parent.SetFormat(lldb.eFormatHex)
|
||||
self.assertEqual(X.GetValue(), "0x00000001", "X has not changed format")
|
||||
self.assertEqual(Y.GetValue(), "0x00000002", "Y has not changed format")
|
||||
# Step and check if the values make sense still
|
||||
self.runCmd("next")
|
||||
self.assertEquals(X.GetValue(), "0x00000004", "X has not become 4")
|
||||
self.assertEquals(Y.GetValue(), "0x00000002", "Y has not stuck as hex")
|
||||
self.assertEqual(X.GetValue(), "0x00000004", "X has not become 4")
|
||||
self.assertEqual(Y.GetValue(), "0x00000002", "Y has not stuck as hex")
|
||||
# Check that children can still make their own choices
|
||||
Y.SetFormat(lldb.eFormatDecimal)
|
||||
self.assertEquals(X.GetValue(), "0x00000004", "X is still hex")
|
||||
self.assertEquals(Y.GetValue(), "2", "Y has not been reset")
|
||||
self.assertEqual(X.GetValue(), "0x00000004", "X is still hex")
|
||||
self.assertEqual(Y.GetValue(), "2", "Y has not been reset")
|
||||
# Make a few more changes
|
||||
parent.SetFormat(lldb.eFormatDefault)
|
||||
X.SetFormat(lldb.eFormatHex)
|
||||
Y.SetFormat(lldb.eFormatDefault)
|
||||
self.assertEqual(X.GetValue(), "0x00000004", "X is not hex as it asked")
|
||||
self.assertEquals(Y.GetValue(), "2", "Y is not defaulted")
|
||||
self.assertEqual(Y.GetValue(), "2", "Y is not defaulted")
|
||||
|
||||
@@ -29,10 +29,10 @@ class TestDiagnosticReporting(TestBase):
|
||||
|
||||
event = lldbutil.fetch_next_event(self, self.listener, self.broadcaster)
|
||||
diagnostic_data = lldb.SBDebugger.GetDiagnosticFromEvent(event)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
diagnostic_data.GetValueForKey("type").GetStringValue(100), "warning"
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
diagnostic_data.GetValueForKey("message").GetStringValue(100),
|
||||
"unable to retrieve process ID from minidump file, setting process ID to 1",
|
||||
)
|
||||
|
||||
@@ -67,9 +67,9 @@ class DynamicValueChildCountTestCase(TestBase):
|
||||
self.assertState(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
|
||||
|
||||
b = self.frame().FindVariable("b").GetDynamicValue(lldb.eDynamicCanRunTarget)
|
||||
self.assertEquals(b.GetNumChildren(), 0, "b has 0 children")
|
||||
self.assertEqual(b.GetNumChildren(), 0, "b has 0 children")
|
||||
self.runCmd("continue")
|
||||
self.assertEquals(b.GetNumChildren(), 0, "b still has 0 children")
|
||||
self.assertEqual(b.GetNumChildren(), 0, "b still has 0 children")
|
||||
self.runCmd("continue")
|
||||
self.assertNotEqual(b.GetNumChildren(), 0, "b now has 1 child")
|
||||
self.runCmd("continue")
|
||||
|
||||
@@ -63,7 +63,7 @@ class TestGDBRemoteClient(GDBRemoteTestBase):
|
||||
|
||||
error = lldb.SBError()
|
||||
target.AttachToProcessWithID(lldb.SBListener(), 47, error)
|
||||
self.assertEquals(error_msg, error.GetCString())
|
||||
self.assertEqual(error_msg, error.GetCString())
|
||||
|
||||
def test_launch_fail(self):
|
||||
class MyResponder(MockGDBServerResponder):
|
||||
@@ -132,11 +132,11 @@ class TestGDBRemoteClient(GDBRemoteTestBase):
|
||||
target = self.createTarget("a.yaml")
|
||||
process = self.connect(target)
|
||||
|
||||
self.assertEquals(1, self.server.responder.packetLog.count("g"))
|
||||
self.assertEqual(1, self.server.responder.packetLog.count("g"))
|
||||
self.server.responder.packetLog = []
|
||||
self.read_registers(process)
|
||||
# Reading registers should not cause any 'p' packets to be exchanged.
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
0, len([p for p in self.server.responder.packetLog if p.startswith("p")])
|
||||
)
|
||||
|
||||
@@ -162,7 +162,7 @@ class TestGDBRemoteClient(GDBRemoteTestBase):
|
||||
process = self.connect(target)
|
||||
|
||||
self.write_registers(process)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
0, len([p for p in self.server.responder.packetLog if p.startswith("G")])
|
||||
)
|
||||
self.assertGreater(
|
||||
@@ -182,7 +182,7 @@ class TestGDBRemoteClient(GDBRemoteTestBase):
|
||||
process = self.connect(target)
|
||||
|
||||
self.write_registers(process)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
0, len([p for p in self.server.responder.packetLog if p.startswith("P")])
|
||||
)
|
||||
self.assertGreater(
|
||||
@@ -191,7 +191,7 @@ class TestGDBRemoteClient(GDBRemoteTestBase):
|
||||
|
||||
def read_registers(self, process):
|
||||
self.for_each_gpr(
|
||||
process, lambda r: self.assertEquals("0x0000000000000000", r.GetValue())
|
||||
process, lambda r: self.assertEqual("0x0000000000000000", r.GetValue())
|
||||
)
|
||||
|
||||
def write_registers(self, process):
|
||||
|
||||
@@ -150,4 +150,4 @@ class TestGdbClientModuleLoad(GDBRemoteTestBase):
|
||||
self.filecheck("image list", __file__, "-check-prefix=VDSO")
|
||||
# VDSO: [ 0] {{.*}} 0x0000000000ee0000 {{.*}}module_load
|
||||
# VDSO: [ 1] {{.*}} 0x0000000000ef0000 {{.*}}[vdso]
|
||||
self.assertEquals(self.target().GetNumModules(), 2)
|
||||
self.assertEqual(self.target().GetNumModules(), 2)
|
||||
|
||||
@@ -110,43 +110,43 @@ class TestWasm(GDBRemoteTestBase):
|
||||
)
|
||||
|
||||
num_modules = target.GetNumModules()
|
||||
self.assertEquals(1, num_modules)
|
||||
self.assertEqual(1, num_modules)
|
||||
|
||||
module = target.GetModuleAtIndex(0)
|
||||
num_sections = module.GetNumSections()
|
||||
self.assertEquals(5, num_sections)
|
||||
self.assertEqual(5, num_sections)
|
||||
|
||||
code_section = module.GetSectionAtIndex(0)
|
||||
self.assertEquals("code", code_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual("code", code_section.GetName())
|
||||
self.assertEqual(
|
||||
load_address | code_section.GetFileOffset(),
|
||||
code_section.GetLoadAddress(target),
|
||||
)
|
||||
|
||||
debug_info_section = module.GetSectionAtIndex(1)
|
||||
self.assertEquals(".debug_info", debug_info_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_info", debug_info_section.GetName())
|
||||
self.assertEqual(
|
||||
load_address | debug_info_section.GetFileOffset(),
|
||||
debug_info_section.GetLoadAddress(target),
|
||||
)
|
||||
|
||||
debug_abbrev_section = module.GetSectionAtIndex(2)
|
||||
self.assertEquals(".debug_abbrev", debug_abbrev_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_abbrev", debug_abbrev_section.GetName())
|
||||
self.assertEqual(
|
||||
load_address | debug_abbrev_section.GetFileOffset(),
|
||||
debug_abbrev_section.GetLoadAddress(target),
|
||||
)
|
||||
|
||||
debug_line_section = module.GetSectionAtIndex(3)
|
||||
self.assertEquals(".debug_line", debug_line_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_line", debug_line_section.GetName())
|
||||
self.assertEqual(
|
||||
load_address | debug_line_section.GetFileOffset(),
|
||||
debug_line_section.GetLoadAddress(target),
|
||||
)
|
||||
|
||||
debug_str_section = module.GetSectionAtIndex(4)
|
||||
self.assertEquals(".debug_str", debug_str_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_str", debug_str_section.GetName())
|
||||
self.assertEqual(
|
||||
load_address | debug_line_section.GetFileOffset(),
|
||||
debug_line_section.GetLoadAddress(target),
|
||||
)
|
||||
@@ -180,40 +180,40 @@ class TestWasm(GDBRemoteTestBase):
|
||||
)
|
||||
|
||||
num_modules = target.GetNumModules()
|
||||
self.assertEquals(1, num_modules)
|
||||
self.assertEqual(1, num_modules)
|
||||
|
||||
module = target.GetModuleAtIndex(0)
|
||||
num_sections = module.GetNumSections()
|
||||
self.assertEquals(5, num_sections)
|
||||
self.assertEqual(5, num_sections)
|
||||
|
||||
code_section = module.GetSectionAtIndex(0)
|
||||
self.assertEquals("code", code_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual("code", code_section.GetName())
|
||||
self.assertEqual(
|
||||
load_address | code_section.GetFileOffset(),
|
||||
code_section.GetLoadAddress(target),
|
||||
)
|
||||
|
||||
debug_info_section = module.GetSectionAtIndex(1)
|
||||
self.assertEquals(".debug_info", debug_info_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_info", debug_info_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_info_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
debug_abbrev_section = module.GetSectionAtIndex(2)
|
||||
self.assertEquals(".debug_abbrev", debug_abbrev_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_abbrev", debug_abbrev_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_abbrev_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
debug_line_section = module.GetSectionAtIndex(3)
|
||||
self.assertEquals(".debug_line", debug_line_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_line", debug_line_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_line_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
debug_str_section = module.GetSectionAtIndex(4)
|
||||
self.assertEquals(".debug_str", debug_str_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_str", debug_str_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_line_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
@@ -236,39 +236,39 @@ class TestWasm(GDBRemoteTestBase):
|
||||
)
|
||||
|
||||
num_modules = target.GetNumModules()
|
||||
self.assertEquals(1, num_modules)
|
||||
self.assertEqual(1, num_modules)
|
||||
|
||||
module = target.GetModuleAtIndex(0)
|
||||
num_sections = module.GetNumSections()
|
||||
self.assertEquals(5, num_sections)
|
||||
self.assertEqual(5, num_sections)
|
||||
|
||||
code_section = module.GetSectionAtIndex(0)
|
||||
self.assertEquals("code", code_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual("code", code_section.GetName())
|
||||
self.assertEqual(
|
||||
load_address | code_section.GetFileOffset(),
|
||||
code_section.GetLoadAddress(target),
|
||||
)
|
||||
|
||||
debug_info_section = module.GetSectionAtIndex(1)
|
||||
self.assertEquals(".debug_info", debug_info_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_info", debug_info_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_info_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
debug_abbrev_section = module.GetSectionAtIndex(2)
|
||||
self.assertEquals(".debug_abbrev", debug_abbrev_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_abbrev", debug_abbrev_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_abbrev_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
debug_line_section = module.GetSectionAtIndex(3)
|
||||
self.assertEquals(".debug_line", debug_line_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_line", debug_line_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_line_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
debug_str_section = module.GetSectionAtIndex(4)
|
||||
self.assertEquals(".debug_str", debug_str_section.GetName())
|
||||
self.assertEquals(
|
||||
self.assertEqual(".debug_str", debug_str_section.GetName())
|
||||
self.assertEqual(
|
||||
LLDB_INVALID_ADDRESS, debug_line_section.GetLoadAddress(target)
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ class TestqOffsets(GDBRemoteTestBase):
|
||||
self.server.responder = TestqOffsets.Responder()
|
||||
target = self.createTarget("qOffsets.yaml")
|
||||
text = target.modules[0].FindSection(".text")
|
||||
self.assertEquals(text.GetLoadAddress(target), lldb.LLDB_INVALID_ADDRESS)
|
||||
self.assertEqual(text.GetLoadAddress(target), lldb.LLDB_INVALID_ADDRESS)
|
||||
|
||||
process = self.connect(target)
|
||||
self.assertEquals(text.GetLoadAddress(target), 0x471000)
|
||||
self.assertEqual(text.GetLoadAddress(target), 0x471000)
|
||||
|
||||
@@ -19,7 +19,7 @@ class LimitDebugInfoTestCase(TestBase):
|
||||
base = type_.GetDirectBaseClassAtIndex(0).GetType()
|
||||
self.trace("base:%s" % base)
|
||||
self.assertTrue(base)
|
||||
self.assertEquals(base.GetNumberOfFields(), 0)
|
||||
self.assertEqual(base.GetNumberOfFields(), 0)
|
||||
self.assertFalse(base.IsTypeComplete())
|
||||
|
||||
def _check_debug_info_is_limited(self, target):
|
||||
|
||||
@@ -62,4 +62,4 @@ class LoadUsingLazyBind(TestBase):
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
val = frame.EvaluateExpression("f1()")
|
||||
self.assertTrue(val.IsValid())
|
||||
self.assertEquals(val.GetValueAsSigned(-1), 5)
|
||||
self.assertEqual(val.GetValueAsSigned(-1), 5)
|
||||
|
||||
@@ -47,7 +47,7 @@ class MemoryCacheTestCase(TestBase):
|
||||
|
||||
# Check the value of my_ints[0] is the same as set in main.cpp.
|
||||
line = self.res.GetOutput().splitlines()[100]
|
||||
self.assertEquals(0x00000042, int(line.split(":")[1], 0))
|
||||
self.assertEqual(0x00000042, int(line.split(":")[1], 0))
|
||||
|
||||
# Change the value of my_ints[0] in memory.
|
||||
self.runCmd("memory write -s 4 `&my_ints` AA")
|
||||
@@ -58,4 +58,4 @@ class MemoryCacheTestCase(TestBase):
|
||||
|
||||
# Check the value of my_ints[0] have been updated correctly.
|
||||
line = self.res.GetOutput().splitlines()[100]
|
||||
self.assertEquals(0x000000AA, int(line.split(":")[1], 0))
|
||||
self.assertEqual(0x000000AA, int(line.split(":")[1], 0))
|
||||
|
||||
@@ -212,7 +212,7 @@ class PluginPythonOSPlugin(TestBase):
|
||||
"main.c",
|
||||
"Make sure we stepped from line 5 to line 6 in main.c",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
line_entry.GetLine(),
|
||||
6,
|
||||
"Make sure we stepped from line 5 to line 6 in main.c",
|
||||
|
||||
@@ -68,7 +68,7 @@ class ChangeProcessGroupTestCase(TestBase):
|
||||
# release the child from its loop
|
||||
value = thread.GetSelectedFrame().EvaluateExpression("release_child_flag = 1")
|
||||
self.assertTrue(value.IsValid())
|
||||
self.assertEquals(value.GetValueAsUnsigned(0), 1)
|
||||
self.assertEqual(value.GetValueAsUnsigned(0), 1)
|
||||
process.Continue()
|
||||
|
||||
# make sure the child's process group id is different from its pid
|
||||
|
||||
@@ -79,20 +79,20 @@ class ReturnValueTestCase(TestBase):
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
fun_name = frame.GetFunctionName()
|
||||
self.assertEquals(fun_name, "outer_sint(int)")
|
||||
self.assertEqual(fun_name, "outer_sint(int)")
|
||||
|
||||
return_value = thread.GetStopReturnValue()
|
||||
self.assertTrue(return_value.IsValid())
|
||||
|
||||
ret_int = return_value.GetValueAsSigned(error)
|
||||
self.assertSuccess(error)
|
||||
self.assertEquals(in_int, ret_int)
|
||||
self.assertEqual(in_int, ret_int)
|
||||
|
||||
# Run again and we will stop in inner_sint the second time outer_sint is called.
|
||||
# Then test stepping out two frames at once:
|
||||
|
||||
thread_list = lldbutil.continue_to_breakpoint(self.process, inner_sint_bkpt)
|
||||
self.assertEquals(len(thread_list), 1)
|
||||
self.assertEqual(len(thread_list), 1)
|
||||
thread = thread_list[0]
|
||||
|
||||
# We are done with the inner_sint breakpoint:
|
||||
@@ -100,7 +100,7 @@ class ReturnValueTestCase(TestBase):
|
||||
|
||||
frame = thread.GetFrameAtIndex(1)
|
||||
fun_name = frame.GetFunctionName()
|
||||
self.assertEquals(fun_name, "outer_sint(int)")
|
||||
self.assertEqual(fun_name, "outer_sint(int)")
|
||||
in_int = frame.FindVariable("value").GetValueAsSigned(error)
|
||||
self.assertSuccess(error)
|
||||
|
||||
@@ -110,13 +110,13 @@ class ReturnValueTestCase(TestBase):
|
||||
self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
fun_name = frame.GetFunctionName()
|
||||
self.assertEquals(fun_name, "main")
|
||||
self.assertEqual(fun_name, "main")
|
||||
|
||||
ret_value = thread.GetStopReturnValue()
|
||||
self.assertTrue(return_value.IsValid())
|
||||
ret_int = ret_value.GetValueAsSigned(error)
|
||||
self.assertSuccess(error)
|
||||
self.assertEquals(2 * in_int, ret_int)
|
||||
self.assertEqual(2 * in_int, ret_int)
|
||||
|
||||
# Now try some simple returns that have different types:
|
||||
inner_float_bkpt = self.target.BreakpointCreateByName("inner_float(float)", exe)
|
||||
@@ -125,7 +125,7 @@ class ReturnValueTestCase(TestBase):
|
||||
thread_list = lldbutil.get_threads_stopped_at_breakpoint(
|
||||
self.process, inner_float_bkpt
|
||||
)
|
||||
self.assertEquals(len(thread_list), 1)
|
||||
self.assertEqual(len(thread_list), 1)
|
||||
thread = thread_list[0]
|
||||
|
||||
self.target.BreakpointDelete(inner_float_bkpt.GetID())
|
||||
@@ -140,7 +140,7 @@ class ReturnValueTestCase(TestBase):
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
fun_name = frame.GetFunctionName()
|
||||
self.assertEquals(fun_name, "outer_float(float)")
|
||||
self.assertEqual(fun_name, "outer_float(float)")
|
||||
|
||||
# return_value = thread.GetStopReturnValue()
|
||||
# self.assertTrue(return_value.IsValid())
|
||||
@@ -270,7 +270,7 @@ class ReturnValueTestCase(TestBase):
|
||||
|
||||
thread_list = lldbutil.get_threads_stopped_at_breakpoint(self.process, bkpt)
|
||||
|
||||
self.assertEquals(len(thread_list), 1)
|
||||
self.assertEqual(len(thread_list), 1)
|
||||
thread = thread_list[0]
|
||||
|
||||
self.target.BreakpointDelete(bkpt.GetID())
|
||||
@@ -296,7 +296,7 @@ class ReturnValueTestCase(TestBase):
|
||||
# if that would add something to the test.
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
fun_name = frame.GetFunctionName()
|
||||
self.assertEquals(fun_name, "main")
|
||||
self.assertEqual(fun_name, "main")
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
ret_value = thread.GetStopReturnValue()
|
||||
@@ -307,7 +307,7 @@ class ReturnValueTestCase(TestBase):
|
||||
self.assertTrue(ret_value.IsValid())
|
||||
|
||||
num_ret_children = ret_value.GetNumChildren()
|
||||
self.assertEquals(num_in_children, num_ret_children)
|
||||
self.assertEqual(num_in_children, num_ret_children)
|
||||
for idx in range(0, num_ret_children):
|
||||
in_child = in_value.GetChildAtIndex(idx)
|
||||
ret_child = ret_value.GetChildAtIndex(idx)
|
||||
|
||||
@@ -72,7 +72,7 @@ class SendSignalTestCase(TestBase):
|
||||
|
||||
# Now make sure the thread was stopped with a SIGUSR1:
|
||||
threads = lldbutil.get_stopped_threads(process, lldb.eStopReasonSignal)
|
||||
self.assertEquals(len(threads), 1, "One thread stopped for a signal.")
|
||||
self.assertEqual(len(threads), 1, "One thread stopped for a signal.")
|
||||
thread = threads[0]
|
||||
|
||||
self.assertTrue(
|
||||
@@ -96,7 +96,7 @@ class SendSignalTestCase(TestBase):
|
||||
)
|
||||
self.assertTrue(got_event, "Got an event")
|
||||
state = lldb.SBProcess.GetStateFromEvent(event)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
state,
|
||||
expected_state,
|
||||
"It was the %s state." % lldb.SBDebugger.StateAsCString(expected_state),
|
||||
|
||||
@@ -17,7 +17,7 @@ class TestTargetSourceMap(TestBase):
|
||||
|
||||
source_map_setting_path = "target.source-map"
|
||||
initial_source_map = self.dbg.GetSetting(source_map_setting_path)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
initial_source_map.GetSize(), 0, "Initial source map should be empty"
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ class TestTargetSourceMap(TestBase):
|
||||
self.runCmd('settings set %s . "%s"' % (source_map_setting_path, src_dir))
|
||||
|
||||
source_map = self.dbg.GetSetting(source_map_setting_path)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
source_map.GetSize(), 1, "source map should be have one appended entry"
|
||||
)
|
||||
|
||||
@@ -33,15 +33,15 @@ class TestTargetSourceMap(TestBase):
|
||||
source_map.GetAsJSON(stream)
|
||||
serialized_source_map = json.loads(stream.GetData())
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(serialized_source_map[0]), 2, "source map entry should have two parts"
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
serialized_source_map[0][0],
|
||||
".",
|
||||
"source map entry's first part does not match",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
serialized_source_map[0][1],
|
||||
src_dir,
|
||||
"source map entry's second part does not match",
|
||||
@@ -54,7 +54,7 @@ class TestTargetSourceMap(TestBase):
|
||||
def assertBreakpointWithSourceMap(src_path):
|
||||
# Set a breakpoint after we remap source and verify that it succeeds
|
||||
bp = target.BreakpointCreateByLocation(src_path, 2)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
bp.GetNumLocations(), 1, "make sure breakpoint was resolved with map"
|
||||
)
|
||||
|
||||
@@ -85,7 +85,7 @@ class TestTargetSourceMap(TestBase):
|
||||
|
||||
# Set a breakpoint before we remap source and verify that it fails
|
||||
bp = target.BreakpointCreateByLocation(src_path, 2)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
bp.GetNumLocations(),
|
||||
0,
|
||||
"make sure no breakpoints were resolved without map",
|
||||
|
||||
@@ -109,7 +109,7 @@ class StepAvoidsNoDebugTestCase(TestBase):
|
||||
|
||||
# Now finish, and make sure the return value is correct.
|
||||
threads = lldbutil.get_threads_stopped_at_breakpoint(self.process, inner_bkpt)
|
||||
self.assertEquals(len(threads), 1, "Stopped at inner breakpoint.")
|
||||
self.assertEqual(len(threads), 1, "Stopped at inner breakpoint.")
|
||||
self.thread = threads[0]
|
||||
|
||||
def do_step_out_past_nodebug(self):
|
||||
|
||||
@@ -18,7 +18,7 @@ void __attribute__((noinline)) sink() {
|
||||
//% last_insn = func3_insns.GetInstructionAtIndex(func3_insns.GetSize()-1)
|
||||
//% addr = last_insn.GetAddress()
|
||||
//% if "GNU" in self.name: addr.OffsetAddress(last_insn.GetByteSize())
|
||||
//% self.assertEquals(frame1.GetPCAddress(), addr)
|
||||
//% self.assertEqual(frame1.GetPCAddress(), addr)
|
||||
}
|
||||
|
||||
void __attribute__((noinline)) func3() {
|
||||
|
||||
@@ -21,7 +21,7 @@ class ThreadExitTestCase(TestBase):
|
||||
)
|
||||
|
||||
# There should be one (non-main) thread left
|
||||
self.assertEquals(self.process().GetNumThreads(), 1)
|
||||
self.assertEqual(self.process().GetNumThreads(), 1)
|
||||
|
||||
# Ensure we can evaluate_expressions in this state
|
||||
self.expect_expr("call_me()", result_value="12345")
|
||||
|
||||
@@ -67,7 +67,7 @@ class UbsanBasicTestCase(TestBase):
|
||||
backtraces = thread.GetStopReasonExtendedBacktraces(
|
||||
lldb.eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer
|
||||
)
|
||||
self.assertEquals(backtraces.GetSize(), 1)
|
||||
self.assertEqual(backtraces.GetSize(), 1)
|
||||
|
||||
self.expect(
|
||||
"thread info -s",
|
||||
|
||||
@@ -36,6 +36,6 @@ class TestNoreturnModuleEnd(TestBase):
|
||||
self.assertTrue(symbol.IsValid())
|
||||
self.assertEqual(symbol.GetName(), backtrace[i][0])
|
||||
function_start = symbol.GetStartAddress().GetLoadAddress(target)
|
||||
self.assertEquals(function_start + backtrace[i][1], frame.GetPC())
|
||||
self.assertEqual(function_start + backtrace[i][1], frame.GetPC())
|
||||
|
||||
self.dbg.DeleteTarget(target)
|
||||
|
||||
@@ -40,7 +40,7 @@ class ValueMD5CrashTestCase(TestBase):
|
||||
|
||||
v = value.GetValue()
|
||||
type_name = value.GetTypeName()
|
||||
self.assertEquals(type_name, "B *", "a is a B*")
|
||||
self.assertEqual(type_name, "B *", "a is a B*")
|
||||
|
||||
self.runCmd("next")
|
||||
self.runCmd("process kill")
|
||||
|
||||
@@ -22,7 +22,7 @@ class TestVarPath(TestBase):
|
||||
def verify_point(self, frame, var_name, var_typename, x_value, y_value):
|
||||
v = frame.GetValueForVariablePath(var_name)
|
||||
self.assertSuccess(v.GetError(), "Make sure we find '%s'" % (var_name))
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
v.GetType().GetName(),
|
||||
var_typename,
|
||||
"Make sure '%s' has type '%s'" % (var_name, var_typename),
|
||||
@@ -43,12 +43,12 @@ class TestVarPath(TestBase):
|
||||
|
||||
v = frame.GetValueForVariablePath(valid_x_path)
|
||||
self.assertSuccess(v.GetError(), "Make sure we find '%s'" % (valid_x_path))
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
v.GetValue(),
|
||||
str(x_value),
|
||||
"Make sure '%s' has a value of %i" % (valid_x_path, x_value),
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
v.GetType().GetName(),
|
||||
"int",
|
||||
"Make sure '%s' has type 'int'" % (valid_x_path),
|
||||
@@ -60,12 +60,12 @@ class TestVarPath(TestBase):
|
||||
|
||||
v = frame.GetValueForVariablePath(valid_y_path)
|
||||
self.assertSuccess(v.GetError(), "Make sure we find '%s'" % (valid_y_path))
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
v.GetValue(),
|
||||
str(y_value),
|
||||
"Make sure '%s' has a value of %i" % (valid_y_path, y_value),
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
v.GetType().GetName(),
|
||||
"int",
|
||||
"Make sure '%s' has type 'int'" % (valid_y_path),
|
||||
|
||||
@@ -26,16 +26,16 @@ class TestVTableValue(TestBase):
|
||||
# Test a shape instance to make sure we get the vtable correctly.
|
||||
shape = self.frame().FindVariable("shape")
|
||||
vtable = shape.GetVTable()
|
||||
self.assertEquals(vtable.GetName(), "vtable for Shape")
|
||||
self.assertEquals(vtable.GetTypeName(), "vtable for Shape")
|
||||
self.assertEqual(vtable.GetName(), "vtable for Shape")
|
||||
self.assertEqual(vtable.GetTypeName(), "vtable for Shape")
|
||||
# Make sure we have the right number of virtual functions in our vtable
|
||||
# for the shape class.
|
||||
self.assertEquals(vtable.GetNumChildren(), 4)
|
||||
self.assertEqual(vtable.GetNumChildren(), 4)
|
||||
|
||||
# Verify vtable address
|
||||
vtable_addr = vtable.GetValueAsUnsigned(0)
|
||||
expected_addr = self.expected_vtable_addr(shape)
|
||||
self.assertEquals(vtable_addr, expected_addr)
|
||||
self.assertEqual(vtable_addr, expected_addr)
|
||||
|
||||
for idx, vtable_entry in enumerate(vtable.children):
|
||||
self.verify_vtable_entry(vtable_entry, vtable_addr, idx)
|
||||
@@ -43,16 +43,16 @@ class TestVTableValue(TestBase):
|
||||
# Test a shape reference to make sure we get the vtable correctly.
|
||||
shape = self.frame().FindVariable("shape_ref")
|
||||
vtable = shape.GetVTable()
|
||||
self.assertEquals(vtable.GetName(), "vtable for Shape")
|
||||
self.assertEquals(vtable.GetTypeName(), "vtable for Shape")
|
||||
self.assertEqual(vtable.GetName(), "vtable for Shape")
|
||||
self.assertEqual(vtable.GetTypeName(), "vtable for Shape")
|
||||
# Make sure we have the right number of virtual functions in our vtable
|
||||
# for the shape class.
|
||||
self.assertEquals(vtable.GetNumChildren(), 4)
|
||||
self.assertEqual(vtable.GetNumChildren(), 4)
|
||||
|
||||
# Verify vtable address
|
||||
vtable_addr = vtable.GetValueAsUnsigned(0)
|
||||
expected_addr = self.expected_vtable_addr(shape)
|
||||
self.assertEquals(vtable_addr, expected_addr)
|
||||
self.assertEqual(vtable_addr, expected_addr)
|
||||
|
||||
for idx, vtable_entry in enumerate(vtable.children):
|
||||
self.verify_vtable_entry(vtable_entry, vtable_addr, idx)
|
||||
@@ -60,17 +60,17 @@ class TestVTableValue(TestBase):
|
||||
# Test we get the right vtable for the Rectangle instance.
|
||||
rect = self.frame().FindVariable("rect")
|
||||
vtable = rect.GetVTable()
|
||||
self.assertEquals(vtable.GetName(), "vtable for Rectangle")
|
||||
self.assertEquals(vtable.GetTypeName(), "vtable for Rectangle")
|
||||
self.assertEqual(vtable.GetName(), "vtable for Rectangle")
|
||||
self.assertEqual(vtable.GetTypeName(), "vtable for Rectangle")
|
||||
|
||||
# Make sure we have the right number of virtual functions in our vtable
|
||||
# with the extra virtual function added by the Rectangle class
|
||||
self.assertEquals(vtable.GetNumChildren(), 5)
|
||||
self.assertEqual(vtable.GetNumChildren(), 5)
|
||||
|
||||
# Verify vtable address
|
||||
vtable_addr = vtable.GetValueAsUnsigned()
|
||||
expected_addr = self.expected_vtable_addr(rect)
|
||||
self.assertEquals(vtable_addr, expected_addr)
|
||||
self.assertEqual(vtable_addr, expected_addr)
|
||||
|
||||
for idx, vtable_entry in enumerate(vtable.children):
|
||||
self.verify_vtable_entry(vtable_entry, vtable_addr, idx)
|
||||
@@ -88,15 +88,15 @@ class TestVTableValue(TestBase):
|
||||
|
||||
shape_ptr = self.frame().FindVariable("shape_ptr")
|
||||
shape_ptr_vtable = shape_ptr.GetVTable()
|
||||
self.assertEquals(shape_ptr_vtable.GetName(), "vtable for Rectangle")
|
||||
self.assertEquals(shape_ptr_vtable.GetNumChildren(), 5)
|
||||
self.assertEquals(shape_ptr.GetValueAsUnsigned(0), rect.GetLoadAddress())
|
||||
self.assertEqual(shape_ptr_vtable.GetName(), "vtable for Rectangle")
|
||||
self.assertEqual(shape_ptr_vtable.GetNumChildren(), 5)
|
||||
self.assertEqual(shape_ptr.GetValueAsUnsigned(0), rect.GetLoadAddress())
|
||||
lldbutil.continue_to_source_breakpoint(
|
||||
self, process, "Shape is Shape", lldb.SBFileSpec("main.cpp")
|
||||
)
|
||||
self.assertEquals(shape_ptr.GetValueAsUnsigned(0), shape.GetLoadAddress())
|
||||
self.assertEquals(shape_ptr_vtable.GetNumChildren(), 4)
|
||||
self.assertEquals(shape_ptr_vtable.GetName(), "vtable for Shape")
|
||||
self.assertEqual(shape_ptr.GetValueAsUnsigned(0), shape.GetLoadAddress())
|
||||
self.assertEqual(shape_ptr_vtable.GetNumChildren(), 4)
|
||||
self.assertEqual(shape_ptr_vtable.GetName(), "vtable for Shape")
|
||||
|
||||
@skipUnlessPlatform(["linux", "macosx"])
|
||||
def test_no_vtable(self):
|
||||
@@ -127,11 +127,11 @@ class TestVTableValue(TestBase):
|
||||
# Test a shape instance to make sure we get the vtable correctly.
|
||||
shape = self.frame().FindVariable("shape")
|
||||
vtable = shape.GetVTable()
|
||||
self.assertEquals(vtable.GetName(), "vtable for Shape")
|
||||
self.assertEquals(vtable.GetTypeName(), "vtable for Shape")
|
||||
self.assertEqual(vtable.GetName(), "vtable for Shape")
|
||||
self.assertEqual(vtable.GetTypeName(), "vtable for Shape")
|
||||
# Make sure we have the right number of virtual functions in our vtable
|
||||
# for the shape class.
|
||||
self.assertEquals(vtable.GetNumChildren(), 4)
|
||||
self.assertEqual(vtable.GetNumChildren(), 4)
|
||||
|
||||
# Overwrite the first entry in the vtable and make sure we can still
|
||||
# see the bogus value which should have no summary
|
||||
@@ -145,11 +145,11 @@ class TestVTableValue(TestBase):
|
||||
process.WriteMemory(vtable_addr, data, error)
|
||||
|
||||
scribbled_child = vtable.GetChildAtIndex(0)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
scribbled_child.GetValueAsUnsigned(0),
|
||||
0x0101010101010101 if is_64bit else 0x01010101,
|
||||
)
|
||||
self.assertEquals(scribbled_child.GetSummary(), None)
|
||||
self.assertEqual(scribbled_child.GetSummary(), None)
|
||||
|
||||
def expected_vtable_addr(self, var: lldb.SBValue) -> int:
|
||||
load_addr = var.GetLoadAddress()
|
||||
@@ -179,7 +179,7 @@ class TestVTableValue(TestBase):
|
||||
"""
|
||||
# Check function ptr
|
||||
vtable_entry_func_ptr = vtable_entry.GetValueAsUnsigned(0)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
vtable_entry_func_ptr,
|
||||
self.expected_vtable_entry_func_ptr(vtable_addr, idx),
|
||||
)
|
||||
@@ -190,8 +190,8 @@ class TestVTableValue(TestBase):
|
||||
# Make sure the type is the same as the function type
|
||||
func_type = sym_ctx.GetFunction().GetType()
|
||||
if func_type.IsValid():
|
||||
self.assertEquals(vtable_entry.GetType(), func_type.GetPointerType())
|
||||
self.assertEqual(vtable_entry.GetType(), func_type.GetPointerType())
|
||||
|
||||
# The summary should be the address description of the function pointer
|
||||
summary = vtable_entry.GetSummary()
|
||||
self.assertEquals(str(sb_addr), summary)
|
||||
self.assertEqual(str(sb_addr), summary)
|
||||
|
||||
@@ -23,7 +23,7 @@ class UnknownCommandTestCase(TestBase):
|
||||
)
|
||||
self.assertRegexpMatches(result.GetError(), "gui")
|
||||
self.assertRegexpMatches(result.GetError(), "gdb-remote")
|
||||
self.assertEquals(1, result.GetError().count("gdb-remote"))
|
||||
self.assertEqual(1, result.GetError().count("gdb-remote"))
|
||||
|
||||
@no_debug_info_test
|
||||
def test_unknown_command(self):
|
||||
@@ -33,4 +33,4 @@ class UnknownCommandTestCase(TestBase):
|
||||
|
||||
command_interpreter.HandleCommand("qbert", result)
|
||||
self.assertFalse(result.Succeeded())
|
||||
self.assertEquals(result.GetError(), "error: 'qbert' is not a valid command.\n")
|
||||
self.assertEqual(result.GetError(), "error: 'qbert' is not a valid command.\n")
|
||||
|
||||
@@ -175,7 +175,7 @@ class ArrayTypesTestCase(TestBase):
|
||||
substrs=["%s" % variable.GetName()],
|
||||
)
|
||||
self.DebugSBValue(variable)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
variable.GetNumChildren(), 4, "Variable 'strings' should have 4 children"
|
||||
)
|
||||
byte_size = variable.GetByteSize()
|
||||
@@ -183,14 +183,14 @@ class ArrayTypesTestCase(TestBase):
|
||||
|
||||
child3 = variable.GetChildAtIndex(3)
|
||||
self.DebugSBValue(child3)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
child3.GetSummary(), '"Guten Tag"', 'strings[3] == "Guten Tag"'
|
||||
)
|
||||
|
||||
# Lookup the "char_16" char array variable.
|
||||
variable = frame.FindVariable("char_16")
|
||||
self.DebugSBValue(variable)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
variable.GetNumChildren(), 16, "Variable 'char_16' should have 16 children"
|
||||
)
|
||||
|
||||
@@ -200,31 +200,31 @@ class ArrayTypesTestCase(TestBase):
|
||||
# of the string. Same applies to long().
|
||||
variable = frame.FindVariable("ushort_matrix")
|
||||
self.DebugSBValue(variable)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
variable.GetNumChildren(),
|
||||
2,
|
||||
"Variable 'ushort_matrix' should have 2 children",
|
||||
)
|
||||
child0 = variable.GetChildAtIndex(0)
|
||||
self.DebugSBValue(child0)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
child0.GetNumChildren(),
|
||||
3,
|
||||
"Variable 'ushort_matrix[0]' should have 3 children",
|
||||
)
|
||||
child0_2 = child0.GetChildAtIndex(2)
|
||||
self.DebugSBValue(child0_2)
|
||||
self.assertEquals(int(child0_2.GetValue(), 0), 3, "ushort_matrix[0][2] == 3")
|
||||
self.assertEqual(int(child0_2.GetValue(), 0), 3, "ushort_matrix[0][2] == 3")
|
||||
|
||||
# Lookup the "long_6" char array variable.
|
||||
variable = frame.FindVariable("long_6")
|
||||
self.DebugSBValue(variable)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
variable.GetNumChildren(), 6, "Variable 'long_6' should have 6 children"
|
||||
)
|
||||
child5 = variable.GetChildAtIndex(5)
|
||||
self.DebugSBValue(child5)
|
||||
self.assertEquals(int(child5.GetValue(), 0), 6, "long_6[5] == 6")
|
||||
self.assertEqual(int(child5.GetValue(), 0), 6, "long_6[5] == 6")
|
||||
|
||||
# Last, check that "long_6" has a value type of eValueTypeVariableLocal
|
||||
# and "argc" has eValueTypeVariableArgument.
|
||||
@@ -238,7 +238,7 @@ class ArrayTypesTestCase(TestBase):
|
||||
)
|
||||
argc = frame.FindVariable("argc")
|
||||
self.DebugSBValue(argc)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
argc.GetValueType(),
|
||||
lldb.eValueTypeVariableArgument,
|
||||
"Variable 'argc' should have '%s' value type."
|
||||
|
||||
@@ -62,7 +62,7 @@ class DynamicValueTestCase(TestBase):
|
||||
self.assertState(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
|
||||
|
||||
threads = lldbutil.get_threads_stopped_at_breakpoint(process, first_call_bpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
@@ -84,7 +84,7 @@ class DynamicValueTestCase(TestBase):
|
||||
# Okay now run to doSomething:
|
||||
|
||||
threads = lldbutil.continue_to_breakpoint(process, do_something_bpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
@@ -151,7 +151,7 @@ class DynamicValueTestCase(TestBase):
|
||||
)
|
||||
self.assertTrue(anotherA_m_b_value_dynamic)
|
||||
anotherA_m_b_val = int(anotherA_m_b_value_dynamic.GetValue(), 10)
|
||||
self.assertEquals(anotherA_m_b_val, 300)
|
||||
self.assertEqual(anotherA_m_b_val, 300)
|
||||
|
||||
anotherA_m_b_value_static = anotherA_static.GetChildMemberWithName(
|
||||
"m_b_value", True
|
||||
@@ -162,7 +162,7 @@ class DynamicValueTestCase(TestBase):
|
||||
# main
|
||||
|
||||
threads = lldbutil.continue_to_breakpoint(process, second_call_bpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
@@ -174,15 +174,15 @@ class DynamicValueTestCase(TestBase):
|
||||
# which this time around is just an "A".
|
||||
|
||||
threads = lldbutil.continue_to_breakpoint(process, do_something_bpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
anotherA_value = frame.FindVariable("anotherA", True)
|
||||
self.assertTrue(anotherA_value)
|
||||
anotherA_loc = int(anotherA_value.GetValue(), 16)
|
||||
self.assertEquals(anotherA_loc, reallyA_loc)
|
||||
self.assertEquals(anotherA_value.GetTypeName().find("B"), -1)
|
||||
self.assertEqual(anotherA_loc, reallyA_loc)
|
||||
self.assertEqual(anotherA_value.GetTypeName().find("B"), -1)
|
||||
|
||||
def examine_value_object_of_this_ptr(
|
||||
self, this_static, this_dynamic, dynamic_location
|
||||
@@ -200,7 +200,7 @@ class DynamicValueTestCase(TestBase):
|
||||
|
||||
# Make sure we got the right address for "this"
|
||||
|
||||
self.assertEquals(this_dynamic_loc, dynamic_location)
|
||||
self.assertEqual(this_dynamic_loc, dynamic_location)
|
||||
|
||||
# And that the static address is greater than the dynamic one
|
||||
|
||||
@@ -217,7 +217,7 @@ class DynamicValueTestCase(TestBase):
|
||||
self.assertTrue(this_dynamic_m_b_value)
|
||||
|
||||
m_b_value = int(this_dynamic_m_b_value.GetValue(), 0)
|
||||
self.assertEquals(m_b_value, 10)
|
||||
self.assertEqual(m_b_value, 10)
|
||||
|
||||
# Make sure it is not in the static version
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class CPPBreakpointTestCase(TestBase):
|
||||
|
||||
while frame_functions.count("throws_exception_on_even(int)") == 1:
|
||||
stopped_threads = lldbutil.continue_to_breakpoint(process, exception_bkpt)
|
||||
self.assertEquals(len(stopped_threads), 1)
|
||||
self.assertEqual(len(stopped_threads), 1)
|
||||
|
||||
thread = stopped_threads[0]
|
||||
frame_functions = lldbutil.get_function_names(thread)
|
||||
|
||||
@@ -19,7 +19,7 @@ class TestCppIncompleteTypeMembers(TestBase):
|
||||
|
||||
# Sanity check that we really have to debug info for this type.
|
||||
this = self.expect_var_path("this", type="A *")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
this.GetType().GetPointeeType().GetNumberOfFields(), 0, str(this)
|
||||
)
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ class TemplateSpecializationTypeTestCase(TestBase):
|
||||
)
|
||||
|
||||
v = self.frame().EvaluateExpression("t")
|
||||
self.assertEquals(2, v.GetNumChildren())
|
||||
self.assertEquals("42", v.GetChildAtIndex(0).GetValue())
|
||||
self.assertEquals("21", v.GetChildAtIndex(1).GetValue())
|
||||
self.assertEqual(2, v.GetNumChildren())
|
||||
self.assertEqual("42", v.GetChildAtIndex(0).GetValue())
|
||||
self.assertEqual("21", v.GetChildAtIndex(1).GetValue())
|
||||
|
||||
# Test a value of the TemplateSpecialization type. We turn
|
||||
# RecordType into TemplateSpecializationType by casting and
|
||||
# dereferencing a pointer to a record.
|
||||
v = self.frame().EvaluateExpression("*((TestObj<int>*)&t)")
|
||||
self.assertEquals(2, v.GetNumChildren())
|
||||
self.assertEquals("42", v.GetChildAtIndex(0).GetValue())
|
||||
self.assertEquals("21", v.GetChildAtIndex(1).GetValue())
|
||||
self.assertEqual(2, v.GetNumChildren())
|
||||
self.assertEqual("42", v.GetChildAtIndex(0).GetValue())
|
||||
self.assertEqual("21", v.GetChildAtIndex(1).GetValue())
|
||||
|
||||
@@ -50,14 +50,14 @@ class TemplateArgsTestCase(TestBase):
|
||||
self.assertTrue(
|
||||
testpos.IsValid(), 'make sure we find a local variabble named "testpos"'
|
||||
)
|
||||
self.assertEquals(testpos.GetType().GetName(), "TestObj<1>")
|
||||
self.assertEqual(testpos.GetType().GetName(), "TestObj<1>")
|
||||
|
||||
expr_result = frame.EvaluateExpression("testpos.getArg()")
|
||||
self.assertTrue(
|
||||
expr_result.IsValid(),
|
||||
'got a valid expression result from expression "testpos.getArg()"',
|
||||
)
|
||||
self.assertEquals(expr_result.GetValue(), "1", "testpos.getArg() == 1")
|
||||
self.assertEqual(expr_result.GetValue(), "1", "testpos.getArg() == 1")
|
||||
self.assertEqual(
|
||||
expr_result.GetType().GetName(),
|
||||
"int",
|
||||
@@ -68,7 +68,7 @@ class TemplateArgsTestCase(TestBase):
|
||||
self.assertTrue(
|
||||
testneg.IsValid(), 'make sure we find a local variabble named "testneg"'
|
||||
)
|
||||
self.assertEquals(testneg.GetType().GetName(), "TestObj<-1>")
|
||||
self.assertEqual(testneg.GetType().GetName(), "TestObj<-1>")
|
||||
|
||||
expr_result = frame.EvaluateExpression("testneg.getArg()")
|
||||
self.assertTrue(
|
||||
@@ -88,39 +88,39 @@ class TemplateArgsTestCase(TestBase):
|
||||
|
||||
c1 = frame.FindVariable("c1")
|
||||
self.assertTrue(c1.IsValid(), 'make sure we find a local variabble named "c1"')
|
||||
self.assertEquals(c1.GetType().GetName(), "C<float, T1>")
|
||||
self.assertEqual(c1.GetType().GetName(), "C<float, T1>")
|
||||
f1 = (
|
||||
c1.GetChildMemberWithName("V")
|
||||
.GetChildAtIndex(0)
|
||||
.GetChildMemberWithName("f")
|
||||
)
|
||||
self.assertEquals(f1.GetType().GetName(), "float")
|
||||
self.assertEquals(f1.GetValue(), "1.5")
|
||||
self.assertEqual(f1.GetType().GetName(), "float")
|
||||
self.assertEqual(f1.GetValue(), "1.5")
|
||||
|
||||
c2 = frame.FindVariable("c2")
|
||||
self.assertTrue(c2.IsValid(), 'make sure we find a local variabble named "c2"')
|
||||
self.assertEquals(c2.GetType().GetName(), "C<double, T1, T2>")
|
||||
self.assertEqual(c2.GetType().GetName(), "C<double, T1, T2>")
|
||||
f2 = (
|
||||
c2.GetChildMemberWithName("V")
|
||||
.GetChildAtIndex(0)
|
||||
.GetChildMemberWithName("f")
|
||||
)
|
||||
self.assertEquals(f2.GetType().GetName(), "double")
|
||||
self.assertEquals(f2.GetValue(), "1.5")
|
||||
self.assertEqual(f2.GetType().GetName(), "double")
|
||||
self.assertEqual(f2.GetValue(), "1.5")
|
||||
f3 = (
|
||||
c2.GetChildMemberWithName("V")
|
||||
.GetChildAtIndex(1)
|
||||
.GetChildMemberWithName("f")
|
||||
)
|
||||
self.assertEquals(f3.GetType().GetName(), "double")
|
||||
self.assertEquals(f3.GetValue(), "2.5")
|
||||
self.assertEqual(f3.GetType().GetName(), "double")
|
||||
self.assertEqual(f3.GetValue(), "2.5")
|
||||
f4 = (
|
||||
c2.GetChildMemberWithName("V")
|
||||
.GetChildAtIndex(1)
|
||||
.GetChildMemberWithName("i")
|
||||
)
|
||||
self.assertEquals(f4.GetType().GetName(), "int")
|
||||
self.assertEquals(f4.GetValue(), "42")
|
||||
self.assertEqual(f4.GetType().GetName(), "int")
|
||||
self.assertEqual(f4.GetValue(), "42")
|
||||
|
||||
# Gcc does not generate the necessary DWARF attribute for enum template
|
||||
# parameters.
|
||||
|
||||
@@ -46,4 +46,4 @@ class TestObjCGlobalVar(TestBase):
|
||||
|
||||
dyn_value = g_obj_ptr.GetDynamicValue(lldb.eDynamicCanRunTarget)
|
||||
self.assertTrue(dyn_value.GetError().Success(), "Dynamic value is valid")
|
||||
self.assertEquals(dyn_value.GetObjectDescription(), "Some NSString")
|
||||
self.assertEqual(dyn_value.GetObjectDescription(), "Some NSString")
|
||||
|
||||
@@ -57,7 +57,7 @@ class ObjCDynamicValueTestCase(TestBase):
|
||||
"Foo * has a valid base class",
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
var_ptr_type.GetDirectBaseClassAtIndex(0).GetName(),
|
||||
var_pte_type.GetDirectBaseClassAtIndex(0).GetName(),
|
||||
"Foo and its pointer type don't agree on their base class",
|
||||
|
||||
@@ -71,7 +71,7 @@ class ObjCDynamicValueTestCase(TestBase):
|
||||
threads = lldbutil.get_threads_stopped_at_breakpoint(
|
||||
process, main_before_setProperty_bkpt
|
||||
)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
|
||||
#
|
||||
@@ -133,7 +133,7 @@ class ObjCDynamicValueTestCase(TestBase):
|
||||
thread.StepInto()
|
||||
|
||||
threads = lldbutil.get_stopped_threads(process, lldb.eStopReasonPlanComplete)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
line_entry = threads[0].GetFrameAtIndex(0).GetLineEntry()
|
||||
|
||||
self.assertEqual(line_entry.GetLine(), self.set_property_line)
|
||||
@@ -143,7 +143,7 @@ class ObjCDynamicValueTestCase(TestBase):
|
||||
# and make sure we get the correct dynamic value.
|
||||
|
||||
threads = lldbutil.continue_to_breakpoint(process, handle_SourceBase_bkpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
@@ -184,7 +184,7 @@ class ObjCDynamicValueTestCase(TestBase):
|
||||
# whatever...
|
||||
|
||||
threads = lldbutil.continue_to_breakpoint(process, handle_SourceBase_bkpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
@@ -205,4 +205,4 @@ class ObjCDynamicValueTestCase(TestBase):
|
||||
self.assertNotEqual(object.GetTypeName().find("SourceDerived"), -1)
|
||||
derivedValue = object.GetChildMemberWithName("_derivedValue")
|
||||
self.assertTrue(derivedValue)
|
||||
self.assertEquals(int(derivedValue.GetValue(), 0), 30)
|
||||
self.assertEqual(int(derivedValue.GetValue(), 0), 30)
|
||||
|
||||
@@ -32,7 +32,7 @@ class TestObjCIvarOffsets(TestBase):
|
||||
self.assertEqual(process.GetState(), lldb.eStateStopped, "Stopped it too.")
|
||||
|
||||
thread_list = lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint)
|
||||
self.assertEquals(len(thread_list), 1)
|
||||
self.assertEqual(len(thread_list), 1)
|
||||
thread = thread_list[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
@@ -49,7 +49,7 @@ class TestObjCIvarOffsets(TestBase):
|
||||
self.assertTrue(mine_backed_int, "Found mine->backed_int local variable.")
|
||||
backed_value = mine_backed_int.GetValueAsSigned(error)
|
||||
self.assertSuccess(error)
|
||||
self.assertEquals(backed_value, 1111)
|
||||
self.assertEqual(backed_value, 1111)
|
||||
|
||||
# Test the value object value for DerivedClass->_derived_backed_int
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestObjCIvarOffsets(TestBase):
|
||||
)
|
||||
derived_backed_value = mine_derived_backed_int.GetValueAsSigned(error)
|
||||
self.assertSuccess(error)
|
||||
self.assertEquals(derived_backed_value, 3333)
|
||||
self.assertEqual(derived_backed_value, 3333)
|
||||
|
||||
# Make sure we also get bit-field offsets correct:
|
||||
|
||||
@@ -67,4 +67,4 @@ class TestObjCIvarOffsets(TestBase):
|
||||
self.assertTrue(mine_flag2, "Found mine->flag2 local variable.")
|
||||
flag2_value = mine_flag2.GetValueAsUnsigned(error)
|
||||
self.assertSuccess(error)
|
||||
self.assertEquals(flag2_value, 7)
|
||||
self.assertEqual(flag2_value, 7)
|
||||
|
||||
@@ -40,7 +40,7 @@ class TestObjCIvarStripped(TestBase):
|
||||
self.assertEqual(process.GetState(), lldb.eStateStopped, "Stopped it too.")
|
||||
|
||||
thread_list = lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint)
|
||||
self.assertEquals(len(thread_list), 1)
|
||||
self.assertEqual(len(thread_list), 1)
|
||||
thread = thread_list[0]
|
||||
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
@@ -54,4 +54,4 @@ class TestObjCIvarStripped(TestBase):
|
||||
self.assertTrue(ivar, "Got result for mc->_foo")
|
||||
ivar_value = ivar.GetValueAsSigned(error)
|
||||
self.assertSuccess(error)
|
||||
self.assertEquals(ivar_value, 3)
|
||||
self.assertEqual(ivar_value, 3)
|
||||
|
||||
@@ -46,7 +46,7 @@ class ObjCPropertyTestCase(TestBase):
|
||||
self.assertState(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
|
||||
|
||||
threads = lldbutil.get_threads_stopped_at_breakpoint(process, main_bkpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
|
||||
@@ -66,13 +66,13 @@ class ObjCPropertyTestCase(TestBase):
|
||||
nonexistant_error = nonexistant_value.GetError()
|
||||
self.assertSuccess(nonexistant_error)
|
||||
nonexistant_int = nonexistant_value.GetValueAsUnsigned(123456)
|
||||
self.assertEquals(nonexistant_int, 6)
|
||||
self.assertEqual(nonexistant_int, 6)
|
||||
|
||||
# Calling the getter function would up the access count, so make sure
|
||||
# that happened.
|
||||
|
||||
new_access_count = access_count.GetValueAsUnsigned(123456)
|
||||
self.assertEquals(new_access_count - start_access_count, 1)
|
||||
self.assertEqual(new_access_count - start_access_count, 1)
|
||||
start_access_count = new_access_count
|
||||
|
||||
#
|
||||
@@ -85,7 +85,7 @@ class ObjCPropertyTestCase(TestBase):
|
||||
# that happened.
|
||||
|
||||
new_access_count = access_count.GetValueAsUnsigned(123456)
|
||||
self.assertEquals(new_access_count - start_access_count, 1)
|
||||
self.assertEqual(new_access_count - start_access_count, 1)
|
||||
start_access_count = new_access_count
|
||||
|
||||
#
|
||||
@@ -117,12 +117,12 @@ class ObjCPropertyTestCase(TestBase):
|
||||
idWithProtocol_value = frame.EvaluateExpression("mine.idWithProtocol", False)
|
||||
idWithProtocol_error = idWithProtocol_value.GetError()
|
||||
self.assertSuccess(idWithProtocol_error)
|
||||
self.assertEquals(idWithProtocol_value.GetTypeName(), "id")
|
||||
self.assertEqual(idWithProtocol_value.GetTypeName(), "id")
|
||||
|
||||
# Make sure that class property getter works as expected
|
||||
value = frame.EvaluateExpression("BaseClass.classInt", False)
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsUnsigned(11111), 123)
|
||||
self.assertEqual(value.GetValueAsUnsigned(11111), 123)
|
||||
|
||||
# Make sure that class property setter works as expected
|
||||
value = frame.EvaluateExpression("BaseClass.classInt = 234", False)
|
||||
@@ -131,7 +131,7 @@ class ObjCPropertyTestCase(TestBase):
|
||||
# Verify that setter above actually worked
|
||||
value = frame.EvaluateExpression("BaseClass.classInt", False)
|
||||
self.assertSuccess(value.GetError())
|
||||
self.assertEquals(value.GetValueAsUnsigned(11111), 234)
|
||||
self.assertEqual(value.GetValueAsUnsigned(11111), 234)
|
||||
|
||||
# Test that accessing two distinct class and instance properties that
|
||||
# share the same name works.
|
||||
|
||||
@@ -44,7 +44,7 @@ class TestObjCStaticMethodStripped(TestBase):
|
||||
|
||||
# Make sure we stopped at the first breakpoint.
|
||||
self.assertNotEqual(len(thread_list), 0, "No thread stopped at our breakpoint.")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "More than one thread stopped at our breakpoint."
|
||||
)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestObjCStaticMethod(TestBase):
|
||||
|
||||
# Make sure we stopped at the first breakpoint.
|
||||
self.assertNotEqual(len(thread_list), 0, "No thread stopped at our breakpoint.")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "More than one thread stopped at our breakpoint."
|
||||
)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class TestObjCStructArgument(TestBase):
|
||||
|
||||
# Make sure we stopped at the first breakpoint.
|
||||
self.assertTrue(len(thread_list) != 0, "No thread stopped at our breakpoint.")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "More than one thread stopped at our breakpoint."
|
||||
)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class TestObjCClassMethod(TestBase):
|
||||
|
||||
# Make sure we stopped at the first breakpoint.
|
||||
self.assertTrue(len(thread_list) != 0, "No thread stopped at our breakpoint.")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "More than one thread stopped at our breakpoint."
|
||||
)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class TestObjCSuperMethod(TestBase):
|
||||
|
||||
# Make sure we stopped at the first breakpoint.
|
||||
self.assertTrue(len(thread_list) != 0, "No thread stopped at our breakpoint.")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "More than one thread stopped at our breakpoint."
|
||||
)
|
||||
|
||||
@@ -48,8 +48,8 @@ class TestObjCSuperMethod(TestBase):
|
||||
|
||||
cmd_value = frame.EvaluateExpression("[self get]")
|
||||
self.assertTrue(cmd_value.IsValid())
|
||||
self.assertEquals(cmd_value.GetValueAsUnsigned(), 2)
|
||||
self.assertEqual(cmd_value.GetValueAsUnsigned(), 2)
|
||||
|
||||
cmd_value = frame.EvaluateExpression("[super get]")
|
||||
self.assertTrue(cmd_value.IsValid())
|
||||
self.assertEquals(cmd_value.GetValueAsUnsigned(), 1)
|
||||
self.assertEqual(cmd_value.GetValueAsUnsigned(), 1)
|
||||
|
||||
@@ -36,7 +36,7 @@ class TestObjCBuiltinTypes(TestBase):
|
||||
|
||||
# Make sure we stopped at the first breakpoint.
|
||||
self.assertTrue(len(thread_list) != 0, "No thread stopped at our breakpoint.")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(thread_list), 1, "More than one thread stopped at our breakpoint."
|
||||
)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ function _T:TestTargetDelete()
|
||||
assertTrue(breakpoint:IsValid() and breakpoint:GetNumLocations() == 1)
|
||||
local location = breakpoint:GetLocationAtIndex(0)
|
||||
assertTrue(location:IsValid())
|
||||
assertEquals(target, breakpoint:GetTarget())
|
||||
assertEqual(target, breakpoint:GetTarget())
|
||||
assertTrue(self.debugger:DeleteTarget(target))
|
||||
assertFalse(breakpoint:IsValid())
|
||||
assertFalse(location:IsValid())
|
||||
@@ -29,7 +29,7 @@ function _T:TestBreakpointHitCount()
|
||||
assertTrue(breakpoint:IsValid() and breakpoint:GetNumLocations() == 1)
|
||||
breakpoint:SetAutoContinue(true)
|
||||
target:LaunchSimple(nil, nil, nil)
|
||||
assertEquals(breakpoint:GetHitCount(), 100)
|
||||
assertEqual(breakpoint:GetHitCount(), 100)
|
||||
end
|
||||
|
||||
function _T:TestBreakpointFrame()
|
||||
@@ -46,7 +46,7 @@ function _T:TestBreakpointFrame()
|
||||
local var_argc = frame:FindVariable('argc')
|
||||
local var_argc_value = var_argc:GetValueAsSigned(error, 0)
|
||||
assertTrue(error:Success())
|
||||
assertEquals(var_argc_value, 3)
|
||||
assertEqual(var_argc_value, 3)
|
||||
end
|
||||
|
||||
os.exit(_T:run())
|
||||
|
||||
@@ -43,7 +43,7 @@ function _T:Test3_BreakpointFindVariables()
|
||||
assertTrue(var_argc:IsValid())
|
||||
local var_argc_value = var_argc:GetValueAsSigned(error, 0)
|
||||
assertTrue(error:Success())
|
||||
assertEquals(var_argc_value, 2)
|
||||
assertEqual(var_argc_value, 2)
|
||||
|
||||
-- checking "inited" value
|
||||
local continue = self.process:Continue()
|
||||
@@ -59,7 +59,7 @@ function _T:Test3_BreakpointFindVariables()
|
||||
self.var_inited = var_inited
|
||||
local var_inited_value = var_inited:GetValueAsUnsigned(error, 0)
|
||||
assertTrue(error:Success())
|
||||
assertEquals(var_inited_value, 0xDEADBEEF)
|
||||
assertEqual(var_inited_value, 0xDEADBEEF)
|
||||
end
|
||||
|
||||
function _T:Test3_RawData()
|
||||
@@ -84,7 +84,7 @@ end
|
||||
|
||||
function _T:Test5_FileOutput()
|
||||
local f = io.open(self.output, 'r')
|
||||
assertEquals(
|
||||
assertEqual(
|
||||
read_file_non_empty_lines(f),
|
||||
{
|
||||
self.exe,
|
||||
|
||||
@@ -9,7 +9,7 @@ function _T:TestLegacyFileOutScript()
|
||||
f:close()
|
||||
|
||||
f = io.open(self.output, 'r')
|
||||
assertEquals(read_file_non_empty_lines(f), {'2', 'FOO'})
|
||||
assertEqual(read_file_non_empty_lines(f), {'2', 'FOO'})
|
||||
f:close()
|
||||
end
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ function _T:TestProcessLaunchSimple()
|
||||
)
|
||||
assertTrue(process:IsValid())
|
||||
local stdout = process:GetSTDOUT(1000)
|
||||
assertEquals(split_lines(stdout), {self.exe, table.unpack(args)})
|
||||
assertEqual(split_lines(stdout), {self.exe, table.unpack(args)})
|
||||
end
|
||||
|
||||
function _T:TestProcessLaunch()
|
||||
@@ -52,7 +52,7 @@ function _T:TestProcessLaunch()
|
||||
local continue = process:Continue()
|
||||
assertTrue(continue:Success())
|
||||
local f = io.open(self.output, 'r')
|
||||
assertEquals(read_file_non_empty_lines(f), {self.exe, table.unpack(args)})
|
||||
assertEqual(read_file_non_empty_lines(f), {self.exe, table.unpack(args)})
|
||||
f:close()
|
||||
end
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@ function assertNotNil(x)
|
||||
if x == nil then error('assertNotNil failure') end
|
||||
end
|
||||
|
||||
function assertEquals(x, y)
|
||||
function assertEqual(x, y)
|
||||
if type(x) == 'table' and type(y) == 'table' then
|
||||
for k, _ in pairs(x) do
|
||||
assertEquals(x[k], y[k])
|
||||
assertEqual(x[k], y[k])
|
||||
end
|
||||
elseif type(x) ~= type(y) then
|
||||
error('assertEquals failure')
|
||||
error('assertEqual failure')
|
||||
elseif x ~= y then
|
||||
error('assertEquals failure')
|
||||
error('assertEqual failure')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class BundleWithDotInFilenameTestCase(TestBase):
|
||||
)
|
||||
|
||||
setup_complete = target.FindFirstGlobalVariable("setup_is_complete")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
setup_complete.GetValueAsUnsigned(),
|
||||
1,
|
||||
"Check that inferior process has completed setup",
|
||||
|
||||
@@ -62,7 +62,7 @@ class DeepBundleTestCase(TestBase):
|
||||
)
|
||||
|
||||
setup_complete = target.FindFirstGlobalVariable("setup_is_complete")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
setup_complete.GetValueAsUnsigned(),
|
||||
1,
|
||||
"Check that inferior process has completed setup",
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestMacCatalyst(TestBase):
|
||||
"""scan the debugserver packet log"""
|
||||
process_info = lldbutil.packetlog_get_process_info(log)
|
||||
self.assertIn("ostype", process_info)
|
||||
self.assertEquals(process_info["ostype"], "maccatalyst")
|
||||
self.assertEqual(process_info["ostype"], "maccatalyst")
|
||||
|
||||
aout_info = None
|
||||
dylib_info = lldbutil.packetlog_get_dylib_info(log)
|
||||
@@ -35,4 +35,4 @@ class TestMacCatalyst(TestBase):
|
||||
if image["pathname"].endswith("a.out"):
|
||||
aout_info = image
|
||||
self.assertTrue(aout_info)
|
||||
self.assertEquals(aout_info["min_version_os_name"], "maccatalyst")
|
||||
self.assertEqual(aout_info["min_version_os_name"], "maccatalyst")
|
||||
|
||||
@@ -33,7 +33,7 @@ class TestMacCatalystAppWithMacOSFramework(TestBase):
|
||||
"""scan the debugserver packet log"""
|
||||
process_info = lldbutil.packetlog_get_process_info(log)
|
||||
self.assertIn("ostype", process_info)
|
||||
self.assertEquals(process_info["ostype"], "maccatalyst")
|
||||
self.assertEqual(process_info["ostype"], "maccatalyst")
|
||||
|
||||
aout_info = None
|
||||
libfoo_info = None
|
||||
@@ -45,5 +45,5 @@ class TestMacCatalystAppWithMacOSFramework(TestBase):
|
||||
libfoo_info = image
|
||||
self.assertTrue(aout_info)
|
||||
self.assertTrue(libfoo_info)
|
||||
self.assertEquals(aout_info["min_version_os_name"], "maccatalyst")
|
||||
self.assertEquals(libfoo_info["min_version_os_name"], "macosx")
|
||||
self.assertEqual(aout_info["min_version_os_name"], "maccatalyst")
|
||||
self.assertEqual(libfoo_info["min_version_os_name"], "macosx")
|
||||
|
||||
@@ -17,7 +17,7 @@ class TestSimulatorPlatformLaunching(TestBase):
|
||||
for line in load_cmds.split("\n"):
|
||||
if expected_load_command in line:
|
||||
found += 1
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
found,
|
||||
1,
|
||||
"wrong number of load commands for {}".format(expected_load_command),
|
||||
@@ -27,7 +27,7 @@ class TestSimulatorPlatformLaunching(TestBase):
|
||||
"""scan the debugserver packet log"""
|
||||
process_info = lldbutil.packetlog_get_process_info(log)
|
||||
self.assertIn("ostype", process_info)
|
||||
self.assertEquals(process_info["ostype"], expected_platform)
|
||||
self.assertEqual(process_info["ostype"], expected_platform)
|
||||
dylib_info = lldbutil.packetlog_get_dylib_info(log)
|
||||
self.assertTrue(dylib_info)
|
||||
aout_info = None
|
||||
@@ -35,9 +35,9 @@ class TestSimulatorPlatformLaunching(TestBase):
|
||||
if image["pathname"].endswith("a.out"):
|
||||
aout_info = image
|
||||
self.assertTrue(aout_info)
|
||||
self.assertEquals(aout_info["min_version_os_name"], expected_platform)
|
||||
self.assertEqual(aout_info["min_version_os_name"], expected_platform)
|
||||
if expected_version:
|
||||
self.assertEquals(aout_info["min_version_os_sdk"], expected_version)
|
||||
self.assertEqual(aout_info["min_version_os_sdk"], expected_version)
|
||||
|
||||
@skipIf(bugnumber="rdar://76995109")
|
||||
def run_with(self, arch, os, vers, env, expected_load_command):
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestInterruptThreadNames(TestBase):
|
||||
|
||||
# Check that the program was able to create its threads within the allotted time
|
||||
self.assertTrue(inferior_set_up.IsValid())
|
||||
self.assertEquals(inferior_set_up.GetValueAsSigned(), 1)
|
||||
self.assertEqual(inferior_set_up.GetValueAsSigned(), 1)
|
||||
|
||||
self.check_number_of_threads(process)
|
||||
|
||||
|
||||
@@ -165,6 +165,6 @@ class UniversalTestCase(TestBase):
|
||||
# backtracing failed.
|
||||
|
||||
threads = lldbutil.continue_to_breakpoint(process, bkpt)
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
thread = threads[0]
|
||||
self.assertTrue(thread.GetNumFrames() > 1, "We were able to backtrace.")
|
||||
|
||||
@@ -52,10 +52,10 @@ class SBTypeMemberFunctionsTest(TestBase):
|
||||
Derived = variable.GetType()
|
||||
Base = Derived.GetDirectBaseClassAtIndex(0).GetType()
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
2, Derived.GetNumberOfMemberFunctions(), "Derived declares two methods"
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"int",
|
||||
Derived.GetMemberFunctionAtIndex(0)
|
||||
.GetType()
|
||||
@@ -64,10 +64,10 @@ class SBTypeMemberFunctionsTest(TestBase):
|
||||
"Derived::dImpl returns int",
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
4, Base.GetNumberOfMemberFunctions(), "Base declares three methods"
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
3,
|
||||
Base.GetMemberFunctionAtIndex(3)
|
||||
.GetType()
|
||||
@@ -75,15 +75,15 @@ class SBTypeMemberFunctionsTest(TestBase):
|
||||
.GetSize(),
|
||||
"Base::sfunc takes three arguments",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"sfunc", Base.GetMemberFunctionAtIndex(3).GetName(), "Base::sfunc not found"
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
lldb.eMemberFunctionKindStaticMethod,
|
||||
Base.GetMemberFunctionAtIndex(3).GetKind(),
|
||||
"Base::sfunc is a static",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
0,
|
||||
Base.GetMemberFunctionAtIndex(2)
|
||||
.GetType()
|
||||
@@ -91,7 +91,7 @@ class SBTypeMemberFunctionsTest(TestBase):
|
||||
.GetSize(),
|
||||
"Base::dat takes no arguments",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"char",
|
||||
Base.GetMemberFunctionAtIndex(1)
|
||||
.GetType()
|
||||
@@ -100,69 +100,69 @@ class SBTypeMemberFunctionsTest(TestBase):
|
||||
.GetName(),
|
||||
"Base::bar takes a second 'char' argument",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"bar", Base.GetMemberFunctionAtIndex(1).GetName(), "Base::bar not found"
|
||||
)
|
||||
|
||||
variable = frame0.FindVariable("thingy")
|
||||
Thingy = variable.GetType()
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
2, Thingy.GetNumberOfMemberFunctions(), "Thingy declares two methods"
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"id",
|
||||
Thingy.GetMemberFunctionAtIndex(0).GetReturnType().GetName(),
|
||||
"Thingy::init returns an id",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
2,
|
||||
Thingy.GetMemberFunctionAtIndex(1).GetNumberOfArguments(),
|
||||
"Thingy::foo takes two arguments",
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"int",
|
||||
Thingy.GetMemberFunctionAtIndex(1).GetArgumentTypeAtIndex(0).GetName(),
|
||||
"Thingy::foo takes an int",
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"Derived::dImpl()", Derived.GetMemberFunctionAtIndex(0).GetDemangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"Derived::baz(float)",
|
||||
Derived.GetMemberFunctionAtIndex(1).GetDemangledName(),
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"Base::foo(int, int)", Base.GetMemberFunctionAtIndex(0).GetDemangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"Base::bar(int, char)", Base.GetMemberFunctionAtIndex(1).GetDemangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"Base::dat()", Base.GetMemberFunctionAtIndex(2).GetDemangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"Base::sfunc(char, int, float)",
|
||||
Base.GetMemberFunctionAtIndex(3).GetDemangledName(),
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"_ZN7Derived5dImplEv", Derived.GetMemberFunctionAtIndex(0).GetMangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"_ZN7Derived3bazEf", Derived.GetMemberFunctionAtIndex(1).GetMangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"_ZN4Base3fooEii", Base.GetMemberFunctionAtIndex(0).GetMangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"_ZN4Base3barEic", Base.GetMemberFunctionAtIndex(1).GetMangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"_ZN4Base3datEv", Base.GetMemberFunctionAtIndex(2).GetMangledName()
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
"_ZN4Base5sfuncEcif", Base.GetMemberFunctionAtIndex(3).GetMangledName()
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ class DebuggerAPITestCase(TestBase):
|
||||
self.dbg.SetCurrentPlatformSDKRoot(None)
|
||||
|
||||
fresh_dbg = lldb.SBDebugger()
|
||||
self.assertEquals(len(fresh_dbg), 0)
|
||||
self.assertEqual(len(fresh_dbg), 0)
|
||||
|
||||
def test_debugger_delete_invalid_target(self):
|
||||
"""SBDebugger.DeleteTarget() should not crash LLDB given and invalid target."""
|
||||
|
||||
@@ -35,7 +35,7 @@ class SBFrameFindValueTestCase(TestBase):
|
||||
# Frame #0 should be at our breakpoint.
|
||||
threads = lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint)
|
||||
|
||||
self.assertEquals(len(threads), 1)
|
||||
self.assertEqual(len(threads), 1)
|
||||
self.thread = threads[0]
|
||||
self.frame = self.thread.frames[0]
|
||||
self.assertTrue(self.frame, "Frame 0 is valid.")
|
||||
|
||||
@@ -82,6 +82,6 @@ class CommandInterpreterAPICase(TestBase):
|
||||
ci.HandleCommand("settings set use-color false", res)
|
||||
self.assertTrue(res.Succeeded())
|
||||
self.assertIsNotNone(res.GetOutput())
|
||||
self.assertEquals(res.GetOutput(), "")
|
||||
self.assertEqual(res.GetOutput(), "")
|
||||
self.assertIsNotNone(res.GetError())
|
||||
self.assertEquals(res.GetError(), "")
|
||||
self.assertEqual(res.GetError(), "")
|
||||
|
||||
@@ -53,7 +53,7 @@ class TestNameLookup(TestBase):
|
||||
self.assertGreaterEqual(len(mangled_to_symbol), 6)
|
||||
for mangled in mangled_to_symbol.keys():
|
||||
symbol_contexts = target.FindFunctions(mangled, lldb.eFunctionNameTypeFull)
|
||||
self.assertEquals(symbol_contexts.GetSize(), 1)
|
||||
self.assertEqual(symbol_contexts.GetSize(), 1)
|
||||
for symbol_context in symbol_contexts:
|
||||
self.assertTrue(symbol_context.GetFunction().IsValid())
|
||||
self.assertTrue(symbol_context.GetSymbol().IsValid())
|
||||
|
||||
@@ -52,9 +52,9 @@ class ObjCSBTypeTestCase(TestBase):
|
||||
aFooType = aBarType.GetDirectBaseClassAtIndex(0)
|
||||
|
||||
self.assertTrue(aFooType.IsValid(), "Foo should be a valid data type")
|
||||
self.assertEquals(aFooType.GetName(), "Foo", "Foo has the right name")
|
||||
self.assertEqual(aFooType.GetName(), "Foo", "Foo has the right name")
|
||||
|
||||
self.assertEquals(aBarType.GetNumberOfFields(), 1, "Bar has a field")
|
||||
self.assertEqual(aBarType.GetNumberOfFields(), 1, "Bar has a field")
|
||||
aBarField = aBarType.GetFieldAtIndex(0)
|
||||
|
||||
self.assertEqual(aBarField.GetName(), "_iVar", "The field has the right name")
|
||||
|
||||
@@ -21,8 +21,8 @@ class TestSBLaunchInfo(TestBase):
|
||||
def test_environment_getset(self):
|
||||
info = lldb.SBLaunchInfo(None)
|
||||
info.SetEnvironmentEntries(["FOO=BAR"], False)
|
||||
self.assertEquals(1, info.GetNumEnvironmentEntries())
|
||||
self.assertEqual(1, info.GetNumEnvironmentEntries())
|
||||
info.SetEnvironmentEntries(["BAR=BAZ"], True)
|
||||
self.assertEquals(2, info.GetNumEnvironmentEntries())
|
||||
self.assertEquals("BAR", lookup(info, "FOO"))
|
||||
self.assertEquals("BAZ", lookup(info, "BAR"))
|
||||
self.assertEqual(2, info.GetNumEnvironmentEntries())
|
||||
self.assertEqual("BAR", lookup(info, "FOO"))
|
||||
self.assertEqual("BAZ", lookup(info, "BAR"))
|
||||
|
||||
@@ -57,7 +57,7 @@ class SBValuePersistTestCase(TestBase):
|
||||
|
||||
self.assertEqual(fooPersist.GetValueAsUnsigned(0), 10, "fooPersist != 10")
|
||||
self.assertEqual(barPersist.GetPointeeData().sint32[0], 4, "barPersist != 4")
|
||||
self.assertEquals(bazPersist.GetSummary(), '"85"', "bazPersist != 85")
|
||||
self.assertEqual(bazPersist.GetSummary(), '"85"', "bazPersist != 85")
|
||||
|
||||
self.runCmd("continue")
|
||||
|
||||
@@ -67,6 +67,6 @@ class SBValuePersistTestCase(TestBase):
|
||||
|
||||
self.assertEqual(fooPersist.GetValueAsUnsigned(0), 10, "fooPersist != 10")
|
||||
self.assertEqual(barPersist.GetPointeeData().sint32[0], 4, "barPersist != 4")
|
||||
self.assertEquals(bazPersist.GetSummary(), '"85"', "bazPersist != 85")
|
||||
self.assertEqual(bazPersist.GetSummary(), '"85"', "bazPersist != 85")
|
||||
|
||||
self.expect("expr *(%s)" % (barPersist.GetName()), substrs=["= 4"])
|
||||
|
||||
@@ -209,7 +209,7 @@ class TypeAndTypeListTestCase(TestBase):
|
||||
int_scoped_enum_type = scoped_enum_type.GetEnumerationIntegerType()
|
||||
self.assertTrue(int_scoped_enum_type)
|
||||
self.DebugSBType(int_scoped_enum_type)
|
||||
self.assertEquals(int_scoped_enum_type.GetName(), "int")
|
||||
self.assertEqual(int_scoped_enum_type.GetName(), "int")
|
||||
|
||||
enum_uchar = target.FindFirstType("EnumUChar")
|
||||
self.assertTrue(enum_uchar)
|
||||
@@ -217,4 +217,4 @@ class TypeAndTypeListTestCase(TestBase):
|
||||
int_enum_uchar = enum_uchar.GetEnumerationIntegerType()
|
||||
self.assertTrue(int_enum_uchar)
|
||||
self.DebugSBType(int_enum_uchar)
|
||||
self.assertEquals(int_enum_uchar.GetName(), "unsigned char")
|
||||
self.assertEqual(int_enum_uchar.GetName(), "unsigned char")
|
||||
|
||||
@@ -66,7 +66,7 @@ class ChangeValueAPITestCase(TestBase):
|
||||
self.assertTrue(val_value.IsValid(), "Got the SBValue for val")
|
||||
actual_value = val_value.GetValueAsSigned(error, 0)
|
||||
self.assertSuccess(error, "Got a value from val")
|
||||
self.assertEquals(actual_value, 100, "Got the right value from val")
|
||||
self.assertEqual(actual_value, 100, "Got the right value from val")
|
||||
|
||||
result = val_value.SetValueFromCString("12345")
|
||||
self.assertTrue(result, "Setting val returned True.")
|
||||
@@ -83,13 +83,13 @@ class ChangeValueAPITestCase(TestBase):
|
||||
self.assertTrue(mine_second_value.IsValid(), "Got second_val from mine")
|
||||
actual_value = mine_second_value.GetValueAsUnsigned(error, 0)
|
||||
self.assertTrue(error.Success(), "Got an unsigned value for second_val")
|
||||
self.assertEquals(actual_value, 5555)
|
||||
self.assertEqual(actual_value, 5555)
|
||||
|
||||
result = mine_second_value.SetValueFromCString("98765")
|
||||
self.assertTrue(result, "Success setting mine.second_value.")
|
||||
actual_value = mine_second_value.GetValueAsSigned(error, 0)
|
||||
self.assertTrue(error.Success(), "Got a changed value from mine.second_val")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
actual_value, 98765, "Got the right changed value from mine.second_val"
|
||||
)
|
||||
|
||||
@@ -101,13 +101,13 @@ class ChangeValueAPITestCase(TestBase):
|
||||
self.assertTrue(ptr_second_value.IsValid(), "Got second_val from ptr")
|
||||
actual_value = ptr_second_value.GetValueAsUnsigned(error, 0)
|
||||
self.assertTrue(error.Success(), "Got an unsigned value for ptr->second_val")
|
||||
self.assertEquals(actual_value, 6666)
|
||||
self.assertEqual(actual_value, 6666)
|
||||
|
||||
result = ptr_second_value.SetValueFromCString("98765")
|
||||
self.assertTrue(result, "Success setting ptr->second_value.")
|
||||
actual_value = ptr_second_value.GetValueAsSigned(error, 0)
|
||||
self.assertTrue(error.Success(), "Got a changed value from ptr->second_val")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
actual_value, 98765, "Got the right changed value from ptr->second_val"
|
||||
)
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ class TestDAP_attach(lldbdap_testcase.DAPTestCaseBase):
|
||||
|
||||
functions = ["main"]
|
||||
breakpoint_ids = self.set_function_breakpoints(functions)
|
||||
self.assertEquals(len(breakpoint_ids), len(functions), "expect one breakpoint")
|
||||
self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint")
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
output = self.get_console(timeout=1.0)
|
||||
self.verify_commands("stopCommands", output, stopCommands)
|
||||
|
||||
@@ -34,7 +34,7 @@ class TestDAP_logpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
before_loop_breakpoint_ids = self.set_source_breakpoints(
|
||||
self.main_path, [before_loop_line]
|
||||
)
|
||||
self.assertEquals(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
self.assertEqual(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
|
||||
self.dap_server.request_continue()
|
||||
|
||||
@@ -97,7 +97,7 @@ class TestDAP_logpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
before_loop_breakpoint_ids = self.set_source_breakpoints(
|
||||
self.main_path, [before_loop_line]
|
||||
)
|
||||
self.assertEquals(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
self.assertEqual(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
|
||||
self.dap_server.request_continue()
|
||||
|
||||
@@ -160,7 +160,7 @@ class TestDAP_logpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
before_loop_breakpoint_ids = self.set_source_breakpoints(
|
||||
self.main_path, [before_loop_line]
|
||||
)
|
||||
self.assertEquals(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
self.assertEqual(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
|
||||
self.dap_server.request_continue()
|
||||
|
||||
@@ -225,7 +225,7 @@ class TestDAP_logpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
before_loop_breakpoint_ids = self.set_source_breakpoints(
|
||||
self.main_path, [before_loop_line]
|
||||
)
|
||||
self.assertEquals(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
self.assertEqual(len(before_loop_breakpoint_ids), 1, "expect one breakpoint")
|
||||
|
||||
self.dap_server.request_continue()
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
# breakpoint in main.cpp
|
||||
response = self.dap_server.request_setBreakpoints(new_main_path, [main_line])
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(len(breakpoints), 1)
|
||||
self.assertEqual(len(breakpoints), 1)
|
||||
breakpoint = breakpoints[0]
|
||||
self.assertEqual(breakpoint["line"], main_line)
|
||||
self.assertTrue(breakpoint["verified"])
|
||||
@@ -129,7 +129,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
line_to_id = {}
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(lines),
|
||||
"expect %u source breakpoints" % (len(lines)),
|
||||
@@ -155,7 +155,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setBreakpoints(self.main_path, lines)
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(lines),
|
||||
"expect %u source breakpoints" % (len(lines)),
|
||||
@@ -165,7 +165,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
self.assertTrue(line, lines[index])
|
||||
# Verify the same breakpoints are still set within LLDB by
|
||||
# making sure the breakpoint ID didn't change
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
line_to_id[line],
|
||||
breakpoint["id"],
|
||||
"verify previous breakpoints stayed the same",
|
||||
@@ -182,7 +182,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_testGetTargetBreakpoints()
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(lines),
|
||||
"expect %u source breakpoints" % (len(lines)),
|
||||
@@ -191,7 +191,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
line = breakpoint["line"]
|
||||
# Verify the same breakpoints are still set within LLDB by
|
||||
# making sure the breakpoint ID didn't change
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
line_to_id[line],
|
||||
breakpoint["id"],
|
||||
"verify previous breakpoints stayed the same",
|
||||
@@ -207,7 +207,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setBreakpoints(self.main_path, lines)
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(lines),
|
||||
"expect %u source breakpoints" % (len(lines)),
|
||||
@@ -217,7 +217,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_testGetTargetBreakpoints()
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(lines),
|
||||
"expect %u source breakpoints" % (len(lines)),
|
||||
@@ -229,7 +229,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setBreakpoints(self.main_path, lines)
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(lines),
|
||||
"expect %u source breakpoints" % (len(lines)),
|
||||
@@ -248,7 +248,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_testGetTargetBreakpoints()
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(lines),
|
||||
"expect %u source breakpoints" % (len(lines)),
|
||||
@@ -281,7 +281,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setBreakpoints(self.main_path, lines)
|
||||
line_to_id = {}
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))
|
||||
)
|
||||
for breakpoint, index in zip(breakpoints, range(len(lines))):
|
||||
@@ -297,12 +297,12 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
lines = None
|
||||
response = self.dap_server.request_setBreakpoints(self.main_path, lines)
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(len(breakpoints), 0, "expect no source breakpoints")
|
||||
self.assertEqual(len(breakpoints), 0, "expect no source breakpoints")
|
||||
|
||||
# Verify with the target that all breakpoints have been cleared.
|
||||
response = self.dap_server.request_testGetTargetBreakpoints()
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(len(breakpoints), 0, "expect no source breakpoints")
|
||||
self.assertEqual(len(breakpoints), 0, "expect no source breakpoints")
|
||||
|
||||
@skipIfWindows
|
||||
@skipIfRemote
|
||||
@@ -316,7 +316,7 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
# Set a breakpoint at the loop line with no condition and no
|
||||
# hitCondition
|
||||
breakpoint_ids = self.set_source_breakpoints(self.main_path, [loop_line])
|
||||
self.assertEquals(len(breakpoint_ids), 1, "expect one breakpoint")
|
||||
self.assertEqual(len(breakpoint_ids), 1, "expect one breakpoint")
|
||||
self.dap_server.request_continue()
|
||||
|
||||
# Verify we hit the breakpoint we just set
|
||||
@@ -324,13 +324,13 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
|
||||
# Make sure i is zero at first breakpoint
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 0, "i != 0 after hitting breakpoint")
|
||||
self.assertEqual(i, 0, "i != 0 after hitting breakpoint")
|
||||
|
||||
# Update the condition on our breakpoint
|
||||
new_breakpoint_ids = self.set_source_breakpoints(
|
||||
self.main_path, [loop_line], [{"condition": "i==4"}]
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
breakpoint_ids,
|
||||
new_breakpoint_ids,
|
||||
"existing breakpoint should have its condition " "updated",
|
||||
@@ -338,13 +338,13 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 4, "i != 4 showing conditional works")
|
||||
self.assertEqual(i, 4, "i != 4 showing conditional works")
|
||||
|
||||
new_breakpoint_ids = self.set_source_breakpoints(
|
||||
self.main_path, [loop_line], [{"hitCondition": "2"}]
|
||||
)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
breakpoint_ids,
|
||||
new_breakpoint_ids,
|
||||
"existing breakpoint should have its condition " "updated",
|
||||
@@ -353,10 +353,10 @@ class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
# Continue with a hitCondition of 2 and expect it to skip 1 value
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 6, "i != 6 showing hitCondition works")
|
||||
self.assertEqual(i, 6, "i != 6 showing hitCondition works")
|
||||
|
||||
# continue after hitting our hitCondition and make sure it only goes
|
||||
# up by 1
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 7, "i != 7 showing post hitCondition hits every time")
|
||||
self.assertEqual(i, 7, "i != 7 showing post hitCondition hits every time")
|
||||
|
||||
@@ -37,7 +37,7 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setFunctionBreakpoints(functions)
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(functions),
|
||||
"expect %u source breakpoints" % (len(functions)),
|
||||
@@ -51,7 +51,7 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setFunctionBreakpoints(functions)
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(functions),
|
||||
"expect %u source breakpoints" % (len(functions)),
|
||||
@@ -65,14 +65,14 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setFunctionBreakpoints(functions)
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(functions),
|
||||
"expect %u source breakpoints" % (len(functions)),
|
||||
)
|
||||
for breakpoint in breakpoints:
|
||||
bp_id = breakpoint["id"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
bp_id, bp_id_12, 'verify "twelve" breakpoint ID is same'
|
||||
)
|
||||
self.assertTrue(
|
||||
@@ -86,14 +86,14 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_testGetTargetBreakpoints()
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(functions),
|
||||
"expect %u source breakpoints" % (len(functions)),
|
||||
)
|
||||
for breakpoint in breakpoints:
|
||||
bp_id = breakpoint["id"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
bp_id, bp_id_12, 'verify "twelve" breakpoint ID is same'
|
||||
)
|
||||
self.assertTrue(
|
||||
@@ -106,7 +106,7 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_setFunctionBreakpoints(functions)
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(functions),
|
||||
"expect %u source breakpoints" % (len(functions)),
|
||||
@@ -116,7 +116,7 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
response = self.dap_server.request_testGetTargetBreakpoints()
|
||||
if response:
|
||||
breakpoints = response["body"]["breakpoints"]
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoints),
|
||||
len(functions),
|
||||
"expect %u source breakpoints" % (len(functions)),
|
||||
@@ -134,18 +134,18 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
functions = ["twelve"]
|
||||
breakpoint_ids = self.set_function_breakpoints(functions)
|
||||
|
||||
self.assertEquals(len(breakpoint_ids), len(functions), "expect one breakpoint")
|
||||
self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint")
|
||||
|
||||
# Verify we hit the breakpoint we just set
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
|
||||
# Make sure i is zero at first breakpoint
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 0, "i != 0 after hitting breakpoint")
|
||||
self.assertEqual(i, 0, "i != 0 after hitting breakpoint")
|
||||
|
||||
# Update the condition on our breakpoint
|
||||
new_breakpoint_ids = self.set_function_breakpoints(functions, condition="i==4")
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
breakpoint_ids,
|
||||
new_breakpoint_ids,
|
||||
"existing breakpoint should have its condition " "updated",
|
||||
@@ -153,10 +153,10 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 4, "i != 4 showing conditional works")
|
||||
self.assertEqual(i, 4, "i != 4 showing conditional works")
|
||||
new_breakpoint_ids = self.set_function_breakpoints(functions, hitCondition="2")
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
breakpoint_ids,
|
||||
new_breakpoint_ids,
|
||||
"existing breakpoint should have its condition " "updated",
|
||||
@@ -165,10 +165,10 @@ class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
|
||||
# Continue with a hitCondition of 2 and expect it to skip 1 value
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 6, "i != 6 showing hitCondition works")
|
||||
self.assertEqual(i, 6, "i != 6 showing hitCondition works")
|
||||
|
||||
# continue after hitting our hitCondition and make sure it only goes
|
||||
# up by 1
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
i = int(self.dap_server.get_local_variable_value("i"))
|
||||
self.assertEquals(i, 7, "i != 7 showing post hitCondition hits every time")
|
||||
self.assertEqual(i, 7, "i != 7 showing post hitCondition hits every time")
|
||||
|
||||
@@ -47,14 +47,14 @@ class TestDAP_coreFile(lldbdap_testcase.DAPTestCaseBase):
|
||||
},
|
||||
]
|
||||
|
||||
self.assertEquals(self.get_stackFrames(), expected_frames)
|
||||
self.assertEqual(self.get_stackFrames(), expected_frames)
|
||||
|
||||
# Resuming should have no effect and keep the process stopped
|
||||
self.continue_to_next_stop()
|
||||
self.assertEquals(self.get_stackFrames(), expected_frames)
|
||||
self.assertEqual(self.get_stackFrames(), expected_frames)
|
||||
|
||||
self.dap_server.request_next(threadId=32259)
|
||||
self.assertEquals(self.get_stackFrames(), expected_frames)
|
||||
self.assertEqual(self.get_stackFrames(), expected_frames)
|
||||
|
||||
@skipIfWindows
|
||||
@skipIfRemote
|
||||
|
||||
@@ -118,7 +118,7 @@ class TestDAP_launch(lldbdap_testcase.DAPTestCaseBase):
|
||||
for line in lines:
|
||||
if line.startswith(prefix):
|
||||
found = True
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
program_parent_dir,
|
||||
line[len(prefix) :],
|
||||
"lldb-dap working dir '%s' == '%s'"
|
||||
@@ -145,7 +145,7 @@ class TestDAP_launch(lldbdap_testcase.DAPTestCaseBase):
|
||||
if line.startswith(prefix):
|
||||
found = True
|
||||
quoted_path = '"%s"' % (program_dir)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
quoted_path,
|
||||
line[len(prefix) :],
|
||||
"lldb-dap working dir %s == %s" % (quoted_path, line[6:]),
|
||||
@@ -164,7 +164,7 @@ class TestDAP_launch(lldbdap_testcase.DAPTestCaseBase):
|
||||
self.continue_to_exit()
|
||||
# Now get the STDOUT and verify our program argument is correct
|
||||
output = self.get_stdout()
|
||||
self.assertEquals(output, None, "expect no program output")
|
||||
self.assertEqual(output, None, "expect no program output")
|
||||
|
||||
@skipIfWindows
|
||||
@skipIfLinux # shell argument expansion doesn't seem to work on Linux
|
||||
@@ -327,7 +327,7 @@ class TestDAP_launch(lldbdap_testcase.DAPTestCaseBase):
|
||||
# Set 2 breakpoints so we can verify that "stopCommands" get run as the
|
||||
# breakpoints get hit
|
||||
breakpoint_ids = self.set_source_breakpoints(source, lines)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
len(breakpoint_ids), len(lines), "expect correct number of breakpoints"
|
||||
)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class TestDAP_module(lldbdap_testcase.DAPTestCaseBase):
|
||||
self.build_and_launch(program)
|
||||
functions = ["foo"]
|
||||
breakpoint_ids = self.set_function_breakpoints(functions)
|
||||
self.assertEquals(len(breakpoint_ids), len(functions), "expect one breakpoint")
|
||||
self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint")
|
||||
self.continue_to_breakpoints(breakpoint_ids)
|
||||
active_modules = self.dap_server.get_modules()
|
||||
program_module = active_modules[program_basename]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user