Index: lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py =================================================================== --- lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py +++ lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py @@ -53,8 +53,8 @@ "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should be 1. - self.assertTrue(breakpoint.GetHitCount() == 1) + self.assertEquals(breakpoint.GetHitCount(), 1) frame = threads[0].GetFrameAtIndex(0) disassembly = frame.Disassemble() - self.assertTrue(len(disassembly) != 0, "Disassembly was empty.") + self.assertNotEqual(len(disassembly), 0, "Disassembly was empty.") Index: lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py =================================================================== --- lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py +++ lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py @@ -85,7 +85,7 @@ (num_sigchld), options) self.assertTrue(value.IsValid()) self.assertTrue(value.GetError().Success()) - self.assertTrue(value.GetValueAsSigned(-1) == num_sigchld) + self.assertEquals(value.GetValueAsSigned(-1), num_sigchld) self.check_after_call(num_sigchld) @@ -102,7 +102,7 @@ (num_sigchld), options) self.assertTrue(value.IsValid() and value.GetError().Success()) - self.assertTrue(value.GetValueAsSigned(-1) == num_sigchld) + self.assertEquals(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 @@ -118,7 +118,7 @@ (num_sigchld), options) self.assertTrue(value.IsValid() and value.GetError().Success()) - self.assertTrue(value.GetValueAsSigned(-1) == num_sigchld) + self.assertEquals(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 @@ -129,7 +129,7 @@ (num_sigchld), options) self.assertTrue(value.IsValid() and value.GetError().Success()) - self.assertTrue(value.GetValueAsSigned(-1) == num_sigchld) + self.assertEquals(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 Index: lldb/test/API/commands/expression/call-throws/TestCallThatThrows.py =================================================================== --- lldb/test/API/commands/expression/call-throws/TestCallThatThrows.py +++ lldb/test/API/commands/expression/call-throws/TestCallThatThrows.py @@ -49,7 +49,7 @@ value = frame.EvaluateExpression("[my_class callMeIThrow]", options) self.assertTrue(value.IsValid()) - self.assertTrue(value.GetError().Success() == False) + self.assertEquals(value.GetError().Success(), False) self.check_after_call() @@ -89,7 +89,7 @@ value = frame.EvaluateExpression("[my_class iCatchMyself]", options) self.assertTrue(value.IsValid()) self.assertTrue(value.GetError().Success()) - self.assertTrue(value.GetValueAsUnsigned() == 57) + self.assertEquals(value.GetValueAsUnsigned(), 57) self.check_after_call() options.SetTrapExceptions(True) Index: lldb/test/API/commands/expression/fixits/TestFixIts.py =================================================================== --- lldb/test/API/commands/expression/fixits/TestFixIts.py +++ lldb/test/API/commands/expression/fixits/TestFixIts.py @@ -48,14 +48,14 @@ value = frame.EvaluateExpression("my_pointer.first", options) self.assertTrue(value.IsValid()) self.assertTrue(value.GetError().Success()) - self.assertTrue(value.GetValueAsUnsigned() == 10) + self.assertEquals(value.GetValueAsUnsigned(), 10) # Try with two errors: two_error_expression = "my_pointer.second->a" value = frame.EvaluateExpression(two_error_expression, options) self.assertTrue(value.IsValid()) self.assertTrue(value.GetError().Success()) - self.assertTrue(value.GetValueAsUnsigned() == 20) + self.assertEquals(value.GetValueAsUnsigned(), 20) # Now turn off the fixits, and the expression should fail: options.SetAutoApplyFixIts(False) Index: lldb/test/API/commands/expression/issue_11588/Test11588.py =================================================================== --- lldb/test/API/commands/expression/issue_11588/Test11588.py +++ lldb/test/API/commands/expression/issue_11588/Test11588.py @@ -50,7 +50,7 @@ frame = process.GetSelectedThread().GetSelectedFrame() pointer = frame.FindVariable("r14") addr = pointer.GetValueAsUnsigned(0) - self.assertTrue(addr != 0, "could not read pointer to StgClosure") + self.assertNotEqual(addr, 0, "could not read pointer to StgClosure") addr = addr - 1 self.runCmd("register write r14 %d" % addr) self.expect( Index: lldb/test/API/commands/expression/save_jit_objects/TestSaveJITObjects.py =================================================================== --- lldb/test/API/commands/expression/save_jit_objects/TestSaveJITObjects.py +++ lldb/test/API/commands/expression/save_jit_objects/TestSaveJITObjects.py @@ -38,14 +38,14 @@ self.cleanJITFiles() frame.EvaluateExpression("(void*)malloc(0x1)") - self.assertTrue(self.countJITFiles() == 0, + self.assertEquals(self.countJITFiles(), 0, "No files emitted with save-jit-objects=false") self.runCmd("settings set target.save-jit-objects true") frame.EvaluateExpression("(void*)malloc(0x1)") jit_files_count = self.countJITFiles() self.cleanJITFiles() - self.assertTrue(jit_files_count != 0, + self.assertNotEqual(jit_files_count, 0, "At least one file emitted with save-jit-objects=true") process.Kill() Index: lldb/test/API/commands/expression/test/TestExprs.py =================================================================== --- lldb/test/API/commands/expression/test/TestExprs.py +++ lldb/test/API/commands/expression/test/TestExprs.py @@ -123,7 +123,7 @@ startstr="main") # We should be stopped on the breakpoint with a hit count of 1. - self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE) + self.assertEquals(breakpoint.GetHitCount(), 1, BREAKPOINT_HIT_ONCE) # # Use Python API to evaluate expressions while stopped in a stack frame. @@ -164,15 +164,15 @@ # Make sure ignoring breakpoints works from the command line: self.expect("expression -i true -- a_function_to_call()", substrs=['(int) $', ' 1']) - self.assertTrue(callee_break.GetHitCount() == 1) + self.assertEquals(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.assertTrue(value.GetValueAsSigned(0) == 2) - self.assertTrue(callee_break.GetHitCount() == 2) + self.assertEquals(value.GetValueAsSigned(0), 2) + self.assertEquals(callee_break.GetHitCount(), 2) # rdar://problem/8686536 # CommandInterpreter::HandleCommand is stripping \'s from input for Index: lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py =================================================================== --- lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py +++ lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py @@ -51,7 +51,7 @@ result = lldb.SBCommandReturnObject() return_value = interp.HandleCommand( "expr -t 100 -u true -- wait_a_while(1000000)", result) - self.assertTrue(return_value == lldb.eReturnStatusFailed) + self.assertEquals(return_value, lldb.eReturnStatusFailed) # Okay, now do it again with long enough time outs: @@ -67,7 +67,7 @@ result = lldb.SBCommandReturnObject() return_value = interp.HandleCommand( "expr -t 1000000 -u true -- wait_a_while(1000)", result) - self.assertTrue(return_value == lldb.eReturnStatusSuccessFinishResult) + self.assertEquals(return_value, lldb.eReturnStatusSuccessFinishResult) # Finally set the one thread timeout and make sure that doesn't change # things much: Index: lldb/test/API/commands/frame/language/TestGuessLanguage.py =================================================================== --- lldb/test/API/commands/frame/language/TestGuessLanguage.py +++ lldb/test/API/commands/frame/language/TestGuessLanguage.py @@ -65,7 +65,7 @@ "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should be 1. - self.assertTrue(breakpoint.GetHitCount() == 1) + self.assertEquals(breakpoint.GetHitCount(), 1) thread = threads[0] Index: lldb/test/API/commands/frame/var/TestFrameVar.py =================================================================== --- lldb/test/API/commands/frame/var/TestFrameVar.py +++ lldb/test/API/commands/frame/var/TestFrameVar.py @@ -54,7 +54,7 @@ "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should be 1. - self.assertTrue(breakpoint.GetHitCount() == 1) + self.assertEquals(breakpoint.GetHitCount(), 1) frame = threads[0].GetFrameAtIndex(0) command_result = lldb.SBCommandReturnObject() Index: lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py =================================================================== --- lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py +++ lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py @@ -46,7 +46,7 @@ process = self.process() - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT) thread = process.GetThreadAtIndex(0) @@ -84,7 +84,7 @@ process = self.process() - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT) thread = process.GetThreadAtIndex(0) @@ -107,7 +107,7 @@ process = self.process() - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT) thread = process.GetThreadAtIndex(0) Index: lldb/test/API/commands/register/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py =================================================================== --- lldb/test/API/commands/register/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py +++ lldb/test/API/commands/register/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py @@ -48,5 +48,5 @@ 'fault address:', 'lower bound:', 'upper bound:']) self.runCmd("continue") - self.assertTrue(process.GetState() == lldb.eStateExited, + self.assertEquals(process.GetState(), lldb.eStateExited, PROCESS_EXITED) Index: lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py =================================================================== --- lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py +++ lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py @@ -36,7 +36,7 @@ process = target.LaunchSimple(None, None, self.get_process_working_directory()) self.assertTrue(process.IsValid(), PROCESS_IS_VALID) - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) thread = lldbutil.get_stopped_thread(process, @@ -60,14 +60,14 @@ self.assertTrue(read_watchpoint, "Failed to set read watchpoint.") thread.StepOver() - self.assertTrue(thread.GetStopReason() == lldb.eStopReasonWatchpoint, + self.assertEquals(thread.GetStopReason(), lldb.eStopReasonWatchpoint, STOPPED_DUE_TO_WATCHPOINT) - self.assertTrue(thread.GetStopDescription(20) == 'watchpoint 1') + self.assertEquals(thread.GetStopDescription(20), 'watchpoint 1') process.Continue() - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) - self.assertTrue(thread.GetStopDescription(20) == 'step over') + self.assertEquals(thread.GetStopDescription(20), 'step over') self.step_inst_for_watchpoint(1) @@ -89,14 +89,14 @@ error.GetCString()) thread.StepOver() - self.assertTrue(thread.GetStopReason() == lldb.eStopReasonWatchpoint, + self.assertEquals(thread.GetStopReason(), lldb.eStopReasonWatchpoint, STOPPED_DUE_TO_WATCHPOINT) - self.assertTrue(thread.GetStopDescription(20) == 'watchpoint 2') + self.assertEquals(thread.GetStopDescription(20), 'watchpoint 2') process.Continue() - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) - self.assertTrue(thread.GetStopDescription(20) == 'step over') + self.assertEquals(thread.GetStopDescription(20), 'step over') self.step_inst_for_watchpoint(2) @@ -110,10 +110,10 @@ self.assertFalse(watchpoint_hit, "Watchpoint already hit.") expected_stop_desc = "watchpoint %d" % wp_id actual_stop_desc = self.thread().GetStopDescription(20) - self.assertTrue(actual_stop_desc == expected_stop_desc, + self.assertEquals(actual_stop_desc, expected_stop_desc, "Watchpoint ID didn't match.") watchpoint_hit = True else: - self.assertTrue(stop_reason == lldb.eStopReasonPlanComplete, + self.assertEquals(stop_reason, lldb.eStopReasonPlanComplete, STOPPED_DUE_TO_STEP_IN) self.assertTrue(watchpoint_hit, "Watchpoint never hit.") Index: lldb/test/API/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py =================================================================== --- lldb/test/API/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py +++ lldb/test/API/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py @@ -51,7 +51,7 @@ wp = self.target.FindWatchpointByID(1) self.assertTrue(wp.IsValid(), "Didn't make a valid watchpoint.") - self.assertTrue(wp.GetWatchAddress() != lldb.LLDB_INVALID_ADDRESS, "Watch address is invalid") + self.assertNotEqual(wp.GetWatchAddress(), lldb.LLDB_INVALID_ADDRESS, "Watch address is invalid") wp.SetEnabled(False) self.assertTrue(not wp.IsEnabled(), "The watchpoint thinks it is still enabled") Index: lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py =================================================================== --- lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py +++ lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py @@ -71,7 +71,7 @@ "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should be 1. - self.assertTrue(breakpoint.GetHitCount() == 1) + self.assertEquals(breakpoint.GetHitCount(), 1) process.Kill() @@ -88,4 +88,4 @@ "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should now be 2. - self.assertTrue(breakpoint.GetHitCount() == 2) + self.assertEquals(breakpoint.GetHitCount(), 2) Index: lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py =================================================================== --- lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py +++ lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py @@ -36,7 +36,7 @@ if not error.Success(): bkpt = target.BreakpointCreateByAddress(0x0) for bp_loc in bkpt: - self.assertTrue(bp_loc.IsResolved() == False) + self.assertEquals(bp_loc.IsResolved(), False) else: self.fail( "Could not find an illegal address at which to set a bad breakpoint.") Index: lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py =================================================================== --- lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py +++ lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py @@ -41,7 +41,7 @@ "There should be a thread stopped due to breakpoint") frame0 = thread.GetFrameAtIndex(0) - self.assertTrue(frame0.GetFunctionName() == "a(int)" or frame0.GetFunctionName() == "int a(int)"); + self.assertEquals(frame0.GetFunctionName(), "a(int)" or frame0.GetFunctionName() == "int a(int)"); process.Continue() self.assertEqual(process.GetState(), lldb.eStateExited) Index: lldb/test/API/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py =================================================================== --- lldb/test/API/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py +++ lldb/test/API/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py @@ -22,15 +22,15 @@ bpno = lldbutil.run_break_set_by_symbol( self, 'product', num_expected_locations=-1, sym_exact=False) - self.assertTrue(bpno == 1, "First breakpoint number is 1.") + self.assertEquals(bpno, 1, "First breakpoint number is 1.") bpno = lldbutil.run_break_set_by_symbol( self, 'sum', num_expected_locations=-1, sym_exact=False) - self.assertTrue(bpno == 2, "Second breakpoint number is 2.") + self.assertEquals(bpno, 2, "Second breakpoint number is 2.") bpno = lldbutil.run_break_set_by_symbol( self, 'junk', num_expected_locations=0, sym_exact=False) - self.assertTrue(bpno == 3, "Third breakpoint number is 3.") + self.assertEquals(bpno, 3, "Third breakpoint number is 3.") self.expect( "breakpoint disable 1.1 - 2.2 ", Index: lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py =================================================================== --- lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py +++ lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py @@ -71,7 +71,7 @@ bkpt_cond = "1 == 0" bkpt.SetCondition(bkpt_cond) self.assertEqual(bkpt.GetCondition(), bkpt_cond,"Successfully set condition") - self.assertTrue(bkpt.location[0].GetCondition() == bkpt.GetCondition(), "Conditions are the same") + self.assertEquals(bkpt.location[0].GetCondition(), bkpt.GetCondition(), "Conditions are the same") # Now set a condition on the locations, make sure that this doesn't effect the bkpt: bkpt_loc_1_cond = "1 == 1" Index: lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py =================================================================== --- lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py +++ lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py @@ -128,10 +128,10 @@ name_list = lldb.SBStringList() bkpt.GetNames(name_list) num_names = name_list.GetSize() - self.assertTrue(num_names == 1, "Name list has %d items, expected 1."%(num_names)) + self.assertEquals(num_names, 1, "Name list has %d items, expected 1."%(num_names)) name = name_list.GetStringAtIndex(0) - self.assertTrue(name == other_bkpt_name, "Remaining name was: %s expected %s."%(name, other_bkpt_name)) + self.assertEquals(name, other_bkpt_name, "Remaining name was: %s expected %s."%(name, other_bkpt_name)) def do_check_illegal_names(self): """Use Python APIs to check that we reject illegal names.""" @@ -170,10 +170,10 @@ bkpts = lldb.SBBreakpointList(self.target) self.target.FindBreakpointsByName(bkpt_name, bkpts) - self.assertTrue(bkpts.GetSize() == 1, "One breakpoint matched.") + self.assertEquals(bkpts.GetSize(), 1, "One breakpoint matched.") found_bkpt = bkpts.GetBreakpointAtIndex(0) - self.assertTrue(bkpt.GetID() == found_bkpt.GetID(),"The right breakpoint.") - self.assertTrue(bkpt.GetID() == bkpt_id,"With the same ID as before.") + self.assertEquals(bkpt.GetID(), found_bkpt.GetID(),"The right breakpoint.") + self.assertEquals(bkpt.GetID(), bkpt_id,"With the same ID as before.") retval = lldb.SBCommandReturnObject() self.dbg.GetCommandInterpreter().HandleCommand("break disable %s"%(bkpt_name), retval) Index: lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py =================================================================== --- lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py +++ lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py @@ -26,7 +26,7 @@ address = frame.GetPCAddress() instructions = self.target.ReadInstructions(address, 2) - self.assertTrue(len(instructions) == 2) + self.assertEquals(len(instructions), 2) self.bkpt_address = instructions[1].GetAddress() self.breakpoint2 = self.target.BreakpointCreateByAddress( self.bkpt_address.GetLoadAddress(self.target)) Index: lldb/test/API/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py =================================================================== --- lldb/test/API/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py +++ lldb/test/API/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py @@ -55,7 +55,7 @@ thread_list = lldbutil.get_threads_stopped_at_breakpoint( process, exception_bkpt) - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "One thread stopped at the exception breakpoint.") def do_dummy_target_cpp_exception_bkpt(self): @@ -82,5 +82,5 @@ thread_list = lldbutil.get_threads_stopped_at_breakpoint( process, exception_bkpt) - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "One thread stopped at the exception breakpoint.") Index: lldb/test/API/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py =================================================================== --- lldb/test/API/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py +++ lldb/test/API/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py @@ -55,7 +55,7 @@ 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.assertTrue(line_entry.line == a_func_line, + self.assertEquals(line_entry.line, a_func_line, "Our line number matches the one lldbtest found.") def source_regex_restrictions(self): Index: lldb/test/API/functionalities/data-formatter/format-propagation/TestFormatPropagation.py =================================================================== --- lldb/test/API/functionalities/data-formatter/format-propagation/TestFormatPropagation.py +++ lldb/test/API/functionalities/data-formatter/format-propagation/TestFormatPropagation.py @@ -54,8 +54,8 @@ Y = parent.GetChildMemberWithName("Y") self.assertTrue(Y is not None and Y.IsValid(), "could not find Y") # check their values now - self.assertTrue(X.GetValue() == "1", "X has an invalid value") - self.assertTrue(Y.GetValue() == "2", "Y has an invalid value") + self.assertEquals(X.GetValue(), "1", "X has an invalid value") + self.assertEquals(Y.GetValue(), "2", "Y has an invalid value") # set the format on the parent parent.SetFormat(lldb.eFormatHex) self.assertTrue( @@ -66,12 +66,12 @@ "Y has not changed format") # Step and check if the values make sense still self.runCmd("next") - self.assertTrue(X.GetValue() == "0x00000004", "X has not become 4") - self.assertTrue(Y.GetValue() == "0x00000002", "Y has not stuck as hex") + self.assertEquals(X.GetValue(), "0x00000004", "X has not become 4") + self.assertEquals(Y.GetValue(), "0x00000002", "Y has not stuck as hex") # Check that children can still make their own choices Y.SetFormat(lldb.eFormatDecimal) - self.assertTrue(X.GetValue() == "0x00000004", "X is still hex") - self.assertTrue(Y.GetValue() == "2", "Y has not been reset") + self.assertEquals(X.GetValue(), "0x00000004", "X is still hex") + self.assertEquals(Y.GetValue(), "2", "Y has not been reset") # Make a few more changes parent.SetFormat(lldb.eFormatDefault) X.SetFormat(lldb.eFormatHex) @@ -79,4 +79,4 @@ self.assertTrue( X.GetValue() == "0x00000004", "X is not hex as it asked") - self.assertTrue(Y.GetValue() == "2", "Y is not defaulted") + self.assertEquals(Y.GetValue(), "2", "Y is not defaulted") Index: lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py =================================================================== --- lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py +++ lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py @@ -65,15 +65,15 @@ process = target.LaunchSimple( None, None, self.get_process_working_directory()) - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) b = self.frame().FindVariable("b").GetDynamicValue(lldb.eDynamicCanRunTarget) - self.assertTrue(b.GetNumChildren() == 0, "b has 0 children") + self.assertEquals(b.GetNumChildren(), 0, "b has 0 children") self.runCmd("continue") - self.assertTrue(b.GetNumChildren() == 0, "b still has 0 children") + self.assertEquals(b.GetNumChildren(), 0, "b still has 0 children") self.runCmd("continue") - self.assertTrue(b.GetNumChildren() != 0, "b now has 1 child") + self.assertNotEqual(b.GetNumChildren(), 0, "b now has 1 child") self.runCmd("continue") self.assertTrue( b.GetNumChildren() == 0, Index: lldb/test/API/functionalities/memory/cache/TestMemoryCache.py =================================================================== --- lldb/test/API/functionalities/memory/cache/TestMemoryCache.py +++ lldb/test/API/functionalities/memory/cache/TestMemoryCache.py @@ -48,7 +48,7 @@ # Check the value of my_ints[0] is the same as set in main.cpp. line = self.res.GetOutput().splitlines()[100] - self.assertTrue(0x00000042 == int(line.split(':')[1], 0)) + self.assertEquals(0x00000042, int(line.split(':')[1], 0)) # Change the value of my_ints[0] in memory. self.runCmd("memory write -s 4 `&my_ints` AA") @@ -59,4 +59,4 @@ # Check the value of my_ints[0] have been updated correctly. line = self.res.GetOutput().splitlines()[100] - self.assertTrue(0x000000AA == int(line.split(':')[1], 0)) + self.assertEquals(0x000000AA, int(line.split(':')[1], 0)) Index: lldb/test/API/functionalities/memory/read/TestMemoryRead.py =================================================================== --- lldb/test/API/functionalities/memory/read/TestMemoryRead.py +++ lldb/test/API/functionalities/memory/read/TestMemoryRead.py @@ -52,7 +52,8 @@ items = line.split(':') address = int(items[0], 0) argc = int(items[1], 0) - self.assertTrue(address > 0 and argc == 1) + self.assertGreater(address, 0) + self.assertEquals(argc, 1) # (lldb) memory read --format uint32_t[] --size 4 --count 4 `&argc` # 0x7fff5fbff9a0: {0x00000001} @@ -70,7 +71,7 @@ lines[i].split(':')[1].strip(' {}'), 0)) addr = int(lines[i].split(':')[0], 0) # Verify that the printout for addr is incremented correctly. - self.assertTrue(addr == (address + i * 4)) + self.assertEquals(addr, (address + i * 4)) # (lldb) memory read --format char[] --size 7 --count 1 `&my_string` # 0x7fff5fbff990: {abcdefg} @@ -130,4 +131,4 @@ # Check that we got back 4 0x0000 etc bytes for o in objects_read: self.assertTrue (len(o) == expected_object_length) - self.assertTrue(len(objects_read) == 4) + self.assertEquals(len(objects_read), 4) Index: lldb/test/API/functionalities/mtc/simple/TestMTCSimple.py =================================================================== --- lldb/test/API/functionalities/mtc/simple/TestMTCSimple.py +++ lldb/test/API/functionalities/mtc/simple/TestMTCSimple.py @@ -25,7 +25,7 @@ @skipIf(archs=['i386']) def mtc_tests(self): - self.assertTrue(self.mtc_dylib_path != "") + self.assertNotEqual(self.mtc_dylib_path, "") # Load the test exe = self.getBuildArtifact("a.out") Index: lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py =================================================================== --- lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py +++ lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py @@ -191,5 +191,5 @@ self.assertTrue( line_entry.GetFileSpec().GetFilename() == 'main.c', "Make sure we stepped from line 5 to line 6 in main.c") - self.assertTrue(line_entry.GetLine() == 6, + self.assertEquals(line_entry.GetLine(), 6, "Make sure we stepped from line 5 to line 6 in main.c") Index: lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py =================================================================== --- lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py +++ lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py @@ -67,7 +67,8 @@ # release the child from its loop value = thread.GetSelectedFrame().EvaluateExpression("release_child_flag = 1") - self.assertTrue(value.IsValid() and value.GetValueAsUnsigned(0) == 1) + self.assertTrue(value.IsValid()) + self.assertEquals(value.GetValueAsUnsigned(0), 1) process.Continue() # make sure the child's process group id is different from its pid Index: lldb/test/API/functionalities/return-value/TestReturnValue.py =================================================================== --- lldb/test/API/functionalities/return-value/TestReturnValue.py +++ lldb/test/API/functionalities/return-value/TestReturnValue.py @@ -51,25 +51,25 @@ thread.StepOut() - self.assertTrue(self.process.GetState() == lldb.eStateStopped) - self.assertTrue(thread.GetStopReason() == lldb.eStopReasonPlanComplete) + self.assertEquals(self.process.GetState(), lldb.eStateStopped) + self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete) frame = thread.GetFrameAtIndex(0) fun_name = frame.GetFunctionName() - self.assertTrue(fun_name == "outer_sint(int)") + self.assertEquals(fun_name, "outer_sint(int)") return_value = thread.GetStopReturnValue() self.assertTrue(return_value.IsValid()) ret_int = return_value.GetValueAsSigned(error) self.assertTrue(error.Success()) - self.assertTrue(in_int == ret_int) + self.assertEquals(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.assertTrue(len(thread_list) == 1) + self.assertEquals(len(thread_list), 1) thread = thread_list[0] # We are done with the inner_sint breakpoint: @@ -77,23 +77,23 @@ frame = thread.GetFrameAtIndex(1) fun_name = frame.GetFunctionName() - self.assertTrue(fun_name == "outer_sint(int)") + self.assertEquals(fun_name, "outer_sint(int)") in_int = frame.FindVariable("value").GetValueAsSigned(error) self.assertTrue(error.Success()) thread.StepOutOfFrame(frame) - self.assertTrue(self.process.GetState() == lldb.eStateStopped) - self.assertTrue(thread.GetStopReason() == lldb.eStopReasonPlanComplete) + self.assertEquals(self.process.GetState(), lldb.eStateStopped) + self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete) frame = thread.GetFrameAtIndex(0) fun_name = frame.GetFunctionName() - self.assertTrue(fun_name == "main") + self.assertEquals(fun_name, "main") ret_value = thread.GetStopReturnValue() self.assertTrue(return_value.IsValid()) ret_int = ret_value.GetValueAsSigned(error) self.assertTrue(error.Success()) - self.assertTrue(2 * in_int == ret_int) + self.assertEquals(2 * in_int, ret_int) # Now try some simple returns that have different types: inner_float_bkpt = self.target.BreakpointCreateByName( @@ -102,7 +102,7 @@ self.process.Continue() thread_list = lldbutil.get_threads_stopped_at_breakpoint( self.process, inner_float_bkpt) - self.assertTrue(len(thread_list) == 1) + self.assertEquals(len(thread_list), 1) thread = thread_list[0] self.target.BreakpointDelete(inner_float_bkpt.GetID()) @@ -112,12 +112,12 @@ in_float = float(in_value.GetValue()) thread.StepOut() - self.assertTrue(self.process.GetState() == lldb.eStateStopped) - self.assertTrue(thread.GetStopReason() == lldb.eStopReasonPlanComplete) + self.assertEquals(self.process.GetState(), lldb.eStateStopped) + self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete) frame = thread.GetFrameAtIndex(0) fun_name = frame.GetFunctionName() - self.assertTrue(fun_name == "outer_float(float)") + self.assertEquals(fun_name, "outer_float(float)") #return_value = thread.GetStopReturnValue() #self.assertTrue(return_value.IsValid()) @@ -235,7 +235,7 @@ thread_list = lldbutil.get_threads_stopped_at_breakpoint( self.process, bkpt) - self.assertTrue(len(thread_list) == 1) + self.assertEquals(len(thread_list), 1) thread = thread_list[0] self.target.BreakpointDelete(bkpt.GetID()) @@ -254,14 +254,14 @@ thread.StepOut() - self.assertTrue(self.process.GetState() == lldb.eStateStopped) - self.assertTrue(thread.GetStopReason() == lldb.eStopReasonPlanComplete) + self.assertEquals(self.process.GetState(), lldb.eStateStopped) + self.assertEquals(thread.GetStopReason(), lldb.eStopReasonPlanComplete) # Assuming all these functions step out to main. Could figure out the caller dynamically # if that would add something to the test. frame = thread.GetFrameAtIndex(0) fun_name = frame.GetFunctionName() - self.assertTrue(fun_name == "main") + self.assertEquals(fun_name, "main") frame = thread.GetFrameAtIndex(0) ret_value = thread.GetStopReturnValue() @@ -269,7 +269,7 @@ self.assertTrue(ret_value.IsValid()) num_ret_children = ret_value.GetNumChildren() - self.assertTrue(num_in_children == num_ret_children) + self.assertEquals(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) Index: lldb/test/API/functionalities/signal/TestSendSignal.py =================================================================== --- lldb/test/API/functionalities/signal/TestSendSignal.py +++ lldb/test/API/functionalities/signal/TestSendSignal.py @@ -88,7 +88,7 @@ # Now make sure the thread was stopped with a SIGUSR1: threads = lldbutil.get_stopped_threads(process, lldb.eStopReasonSignal) - self.assertTrue(len(threads) == 1, "One thread stopped for a signal.") + self.assertEquals(len(threads), 1, "One thread stopped for a signal.") thread = threads[0] self.assertTrue( @@ -107,6 +107,6 @@ num_seconds, broadcaster, event_type_mask, event) self.assertTrue(got_event, "Got an event") state = lldb.SBProcess.GetStateFromEvent(event) - self.assertTrue(state == expected_state, + self.assertEquals(state, expected_state, "It was the %s state." % lldb.SBDebugger_StateAsCString(expected_state)) Index: lldb/test/API/functionalities/source-map/TestTargetSourceMap.py =================================================================== --- lldb/test/API/functionalities/source-map/TestTargetSourceMap.py +++ lldb/test/API/functionalities/source-map/TestTargetSourceMap.py @@ -23,14 +23,14 @@ # Set a breakpoint before we remap source and verify that it fails bp = target.BreakpointCreateByLocation(src_path, 2) - self.assertTrue(bp.GetNumLocations() == 0, + self.assertEquals(bp.GetNumLocations(), 0, "make sure no breakpoints were resolved without map") src_map_cmd = 'settings set target.source-map . "%s"' % (src_dir) self.dbg.HandleCommand(src_map_cmd) # Set a breakpoint after we remap source and verify that it succeeds bp = target.BreakpointCreateByLocation(src_path, 2) - self.assertTrue(bp.GetNumLocations() == 1, + self.assertEquals(bp.GetNumLocations(), 1, "make sure breakpoint was resolved with map") # Now make sure that we can actually FIND the source file using this @@ -38,6 +38,6 @@ retval = lldb.SBCommandReturnObject() self.dbg.GetCommandInterpreter().HandleCommand("source list -f main.c -l 2", retval) self.assertTrue(retval.Succeeded(), "source list didn't succeed.") - self.assertTrue(retval.GetOutput() != None, "We got no ouput from source list") + self.assertNotEqual(retval.GetOutput(), None, "We got no ouput from source list") self.assertTrue("return" in retval.GetOutput(), "We didn't find the source file...") Index: lldb/test/API/functionalities/step-avoids-no-debug/TestStepNoDebug.py =================================================================== --- lldb/test/API/functionalities/step-avoids-no-debug/TestStepNoDebug.py +++ lldb/test/API/functionalities/step-avoids-no-debug/TestStepNoDebug.py @@ -109,7 +109,7 @@ # Now finish, and make sure the return value is correct. threads = lldbutil.get_threads_stopped_at_breakpoint( self.process, inner_bkpt) - self.assertTrue(len(threads) == 1, "Stopped at inner breakpoint.") + self.assertEquals(len(threads), 1, "Stopped at inner breakpoint.") self.thread = threads[0] def do_step_out_past_nodebug(self): Index: lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py =================================================================== --- lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py +++ lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py @@ -67,7 +67,7 @@ self.assertEqual(data["mops"][0]["thread_id"], report_thread_id) other_thread_id = data["mops"][1]["thread_id"] - self.assertTrue(other_thread_id != report_thread_id) + self.assertNotEqual(other_thread_id, report_thread_id) other_thread = self.dbg.GetSelectedTarget( ).process.GetThreadByIndexID(other_thread_id) self.assertTrue(other_thread.IsValid()) Index: lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py =================================================================== --- lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py +++ lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py @@ -64,7 +64,7 @@ backtraces = thread.GetStopReasonExtendedBacktraces( lldb.eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer) - self.assertTrue(backtraces.GetSize() == 1) + self.assertEquals(backtraces.GetSize(), 1) self.expect( "thread info -s", Index: lldb/test/API/functionalities/value_md5_crash/TestValueMD5Crash.py =================================================================== --- lldb/test/API/functionalities/value_md5_crash/TestValueMD5Crash.py +++ lldb/test/API/functionalities/value_md5_crash/TestValueMD5Crash.py @@ -41,7 +41,7 @@ v = value.GetValue() type_name = value.GetTypeName() - self.assertTrue(type_name == "B *", "a is a B*") + self.assertEquals(type_name, "B *", "a is a B*") self.runCmd("next") self.runCmd("process kill") Index: lldb/test/API/functionalities/var_path/TestVarPath.py =================================================================== --- lldb/test/API/functionalities/var_path/TestVarPath.py +++ lldb/test/API/functionalities/var_path/TestVarPath.py @@ -25,7 +25,7 @@ def verify_point(self, frame, var_name, var_typename, x_value, y_value): v = frame.GetValueForVariablePath(var_name) self.assertTrue(v.GetError().Success(), "Make sure we find '%s'" % (var_name)) - self.assertTrue(v.GetType().GetName() == var_typename, + self.assertEquals(v.GetType().GetName(), var_typename, "Make sure '%s' has type '%s'" % (var_name, var_typename)) if '*' in var_typename: @@ -43,15 +43,15 @@ v = frame.GetValueForVariablePath(valid_x_path) self.assertTrue(v.GetError().Success(), "Make sure we find '%s'" % (valid_x_path)) - self.assertTrue(v.GetValue() == str(x_value), "Make sure '%s' has a value of %i" % (valid_x_path, x_value)) - self.assertTrue(v.GetType().GetName() == "int", "Make sure '%s' has type 'int'" % (valid_x_path)) + self.assertEquals(v.GetValue(), str(x_value), "Make sure '%s' has a value of %i" % (valid_x_path, x_value)) + self.assertEquals(v.GetType().GetName(), "int", "Make sure '%s' has type 'int'" % (valid_x_path)) v = frame.GetValueForVariablePath(invalid_x_path) self.assertTrue(v.GetError().Fail(), "Make sure we don't find '%s'" % (invalid_x_path)) v = frame.GetValueForVariablePath(valid_y_path) self.assertTrue(v.GetError().Success(), "Make sure we find '%s'" % (valid_y_path)) - self.assertTrue(v.GetValue() == str(y_value), "Make sure '%s' has a value of %i" % (valid_y_path, y_value)) - self.assertTrue(v.GetType().GetName() == "int", "Make sure '%s' has type 'int'" % (valid_y_path)) + self.assertEquals(v.GetValue(), str(y_value), "Make sure '%s' has a value of %i" % (valid_y_path, y_value)) + self.assertEquals(v.GetType().GetName(), "int", "Make sure '%s' has type 'int'" % (valid_y_path)) v = frame.GetValueForVariablePath(invalid_y_path) self.assertTrue(v.GetError().Fail(), "Make sure we don't find '%s'" % (invalid_y_path)) Index: lldb/test/API/lang/c/array_types/TestArrayTypes.py =================================================================== --- lldb/test/API/lang/c/array_types/TestArrayTypes.py +++ lldb/test/API/lang/c/array_types/TestArrayTypes.py @@ -170,20 +170,20 @@ "%s" % variable.GetName()]) self.DebugSBValue(variable) - self.assertTrue(variable.GetNumChildren() == 4, + self.assertEquals(variable.GetNumChildren(), 4, "Variable 'strings' should have 4 children") byte_size = variable.GetByteSize() self.assertTrue(byte_size >= 4*4 and byte_size <= 1024) child3 = variable.GetChildAtIndex(3) self.DebugSBValue(child3) - self.assertTrue(child3.GetSummary() == '"Guten Tag"', + self.assertEquals(child3.GetSummary(), '"Guten Tag"', 'strings[3] == "Guten Tag"') # Lookup the "char_16" char array variable. variable = frame.FindVariable("char_16") self.DebugSBValue(variable) - self.assertTrue(variable.GetNumChildren() == 16, + self.assertEquals(variable.GetNumChildren(), 16, "Variable 'char_16' should have 16 children") # Lookup the "ushort_matrix" ushort[] array variable. @@ -192,25 +192,25 @@ # of the string. Same applies to long(). variable = frame.FindVariable("ushort_matrix") self.DebugSBValue(variable) - self.assertTrue(variable.GetNumChildren() == 2, + self.assertEquals(variable.GetNumChildren(), 2, "Variable 'ushort_matrix' should have 2 children") child0 = variable.GetChildAtIndex(0) self.DebugSBValue(child0) - self.assertTrue(child0.GetNumChildren() == 3, + self.assertEquals(child0.GetNumChildren(), 3, "Variable 'ushort_matrix[0]' should have 3 children") child0_2 = child0.GetChildAtIndex(2) self.DebugSBValue(child0_2) - self.assertTrue(int(child0_2.GetValue(), 0) == 3, + self.assertEquals(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.assertTrue(variable.GetNumChildren() == 6, + self.assertEquals(variable.GetNumChildren(), 6, "Variable 'long_6' should have 6 children") child5 = variable.GetChildAtIndex(5) self.DebugSBValue(child5) - self.assertTrue(int(child5.GetValue(), 0) == 6, + self.assertEquals(int(child5.GetValue(), 0), 6, "long_6[5] == 6") # Last, check that "long_6" has a value type of eValueTypeVariableLocal @@ -223,6 +223,6 @@ lldb.eValueTypeVariableLocal)) argc = frame.FindVariable("argc") self.DebugSBValue(argc) - self.assertTrue(argc.GetValueType() == lldb.eValueTypeVariableArgument, + self.assertEquals(argc.GetValueType(), lldb.eValueTypeVariableArgument, "Variable 'argc' should have '%s' value type." % value_type_to_str(lldb.eValueTypeVariableArgument)) Index: lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py =================================================================== --- lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py +++ lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py @@ -61,12 +61,12 @@ process = target.LaunchSimple( None, None, self.get_process_working_directory()) - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) threads = lldbutil.get_threads_stopped_at_breakpoint( process, first_call_bpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] frame = thread.GetFrameAtIndex(0) @@ -88,7 +88,7 @@ # Okay now run to doSomething: threads = lldbutil.continue_to_breakpoint(process, do_something_bpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] frame = thread.GetFrameAtIndex(0) @@ -144,7 +144,7 @@ self.assertTrue(anotherA_dynamic) anotherA_dynamic_addr = int(anotherA_dynamic.GetValue(), 16) anotherA_dynamic_typename = anotherA_dynamic.GetTypeName() - self.assertTrue(anotherA_dynamic_typename.find('B') != -1) + self.assertNotEqual(anotherA_dynamic_typename.find('B'), -1) self.assertTrue(anotherA_dynamic_addr < anotherA_static_addr) @@ -152,7 +152,7 @@ 'm_b_value', True) self.assertTrue(anotherA_m_b_value_dynamic) anotherA_m_b_val = int(anotherA_m_b_value_dynamic.GetValue(), 10) - self.assertTrue(anotherA_m_b_val == 300) + self.assertEquals(anotherA_m_b_val, 300) anotherA_m_b_value_static = anotherA_static.GetChildMemberWithName( 'm_b_value', True) @@ -162,7 +162,7 @@ # main threads = lldbutil.continue_to_breakpoint(process, second_call_bpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] frame = thread.GetFrameAtIndex(0) @@ -174,15 +174,15 @@ # which this time around is just an "A". threads = lldbutil.continue_to_breakpoint(process, do_something_bpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(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.assertTrue(anotherA_loc == reallyA_loc) - self.assertTrue(anotherA_value.GetTypeName().find('B') == -1) + self.assertEquals(anotherA_loc, reallyA_loc) + self.assertEquals(anotherA_value.GetTypeName().find('B'), -1) def examine_value_object_of_this_ptr( self, this_static, this_dynamic, dynamic_location): @@ -194,12 +194,12 @@ self.assertTrue(this_dynamic) this_dynamic_typename = this_dynamic.GetTypeName() - self.assertTrue(this_dynamic_typename.find('B') != -1) + self.assertNotEqual(this_dynamic_typename.find('B'), -1) this_dynamic_loc = int(this_dynamic.GetValue(), 16) # Make sure we got the right address for "this" - self.assertTrue(this_dynamic_loc == dynamic_location) + self.assertEquals(this_dynamic_loc, dynamic_location) # And that the static address is greater than the dynamic one @@ -215,7 +215,7 @@ self.assertTrue(this_dynamic_m_b_value) m_b_value = int(this_dynamic_m_b_value.GetValue(), 0) - self.assertTrue(m_b_value == 10) + self.assertEquals(m_b_value, 10) # Make sure it is not in the static version Index: lldb/test/API/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py =================================================================== --- lldb/test/API/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py +++ lldb/test/API/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py @@ -66,7 +66,7 @@ while frame_functions.count("throws_exception_on_even(int)") == 1: stopped_threads = lldbutil.continue_to_breakpoint( process, exception_bkpt) - self.assertTrue(len(stopped_threads) == 1) + self.assertEquals(len(stopped_threads), 1) thread = stopped_threads[0] frame_functions = lldbutil.get_function_names(thread) Index: lldb/test/API/lang/cpp/global_variables/TestCPPGlobalVariables.py =================================================================== --- lldb/test/API/lang/cpp/global_variables/TestCPPGlobalVariables.py +++ lldb/test/API/lang/cpp/global_variables/TestCPPGlobalVariables.py @@ -31,9 +31,9 @@ # Check that we can access g_file_global_int by its mangled name addr = target.EvaluateExpression("&abc::g_file_global_int").GetValueAsUnsigned() - self.assertTrue(addr != 0) + self.assertNotEqual(addr, 0) mangled = lldb.SBAddress(addr, target).GetSymbol().GetMangledName() - self.assertTrue(mangled != None) + self.assertNotEqual(mangled, None) gv = target.FindFirstGlobalVariable(mangled) self.assertTrue(gv.IsValid()) self.assertEqual(gv.GetName(), "abc::g_file_global_int") Index: lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py =================================================================== --- lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py +++ lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py @@ -38,7 +38,7 @@ self.assertTrue(process.IsValid(), PROCESS_IS_VALID) # Get the thread of the process - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( Index: lldb/test/API/lang/cpp/stl/TestSTL.py =================================================================== --- lldb/test/API/lang/cpp/stl/TestSTL.py +++ lldb/test/API/lang/cpp/stl/TestSTL.py @@ -87,7 +87,7 @@ self.assertTrue(process, PROCESS_IS_VALID) # Get Frame #0. - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( Index: lldb/test/API/lang/cpp/template/TestTemplateArgs.py =================================================================== --- lldb/test/API/lang/cpp/template/TestTemplateArgs.py +++ lldb/test/API/lang/cpp/template/TestTemplateArgs.py @@ -54,13 +54,13 @@ self.assertTrue( testpos.IsValid(), 'make sure we find a local variabble named "testpos"') - self.assertTrue(testpos.GetType().GetName() == 'TestObj<1>') + self.assertEquals(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.assertTrue(expr_result.GetValue() == "1", "testpos.getArg() == 1") + self.assertEquals(expr_result.GetValue(), "1", "testpos.getArg() == 1") self.assertTrue( expr_result.GetType().GetName() == "int", 'expr_result.GetType().GetName() == "int"') @@ -69,7 +69,7 @@ self.assertTrue( testneg.IsValid(), 'make sure we find a local variabble named "testneg"') - self.assertTrue(testneg.GetType().GetName() == 'TestObj<-1>') + self.assertEquals(testneg.GetType().GetName(), 'TestObj<-1>') expr_result = frame.EvaluateExpression("testneg.getArg()") self.assertTrue( @@ -90,25 +90,25 @@ self.assertTrue( c1.IsValid(), 'make sure we find a local variabble named "c1"') - self.assertTrue(c1.GetType().GetName() == 'C') + self.assertEquals(c1.GetType().GetName(), 'C') f1 = c1.GetChildMemberWithName("V").GetChildAtIndex(0).GetChildMemberWithName("f") - self.assertTrue(f1.GetType().GetName() == 'float') - self.assertTrue(f1.GetValue() == '1.5') + self.assertEquals(f1.GetType().GetName(), 'float') + self.assertEquals(f1.GetValue(), '1.5') c2 = frame.FindVariable('c2') self.assertTrue( c2.IsValid(), 'make sure we find a local variabble named "c2"') - self.assertTrue(c2.GetType().GetName() == 'C') + self.assertEquals(c2.GetType().GetName(), 'C') f2 = c2.GetChildMemberWithName("V").GetChildAtIndex(0).GetChildMemberWithName("f") - self.assertTrue(f2.GetType().GetName() == 'double') - self.assertTrue(f2.GetValue() == '1.5') + self.assertEquals(f2.GetType().GetName(), 'double') + self.assertEquals(f2.GetValue(), '1.5') f3 = c2.GetChildMemberWithName("V").GetChildAtIndex(1).GetChildMemberWithName("f") - self.assertTrue(f3.GetType().GetName() == 'double') - self.assertTrue(f3.GetValue() == '2.5') + self.assertEquals(f3.GetType().GetName(), 'double') + self.assertEquals(f3.GetValue(), '2.5') f4 = c2.GetChildMemberWithName("V").GetChildAtIndex(1).GetChildMemberWithName("i") - self.assertTrue(f4.GetType().GetName() == 'int') - self.assertTrue(f4.GetValue() == '42') + self.assertEquals(f4.GetType().GetName(), 'int') + self.assertEquals(f4.GetValue(), '42') # Gcc does not generate the necessary DWARF attribute for enum template # parameters. Index: lldb/test/API/lang/objc/global_ptrs/TestGlobalObjects.py =================================================================== --- lldb/test/API/lang/objc/global_ptrs/TestGlobalObjects.py +++ lldb/test/API/lang/objc/global_ptrs/TestGlobalObjects.py @@ -54,4 +54,4 @@ self.assertTrue( dyn_value.GetError().Success(), "Dynamic value is valid") - self.assertTrue(dyn_value.GetObjectDescription() == "Some NSString") + self.assertEquals(dyn_value.GetObjectDescription(), "Some NSString") Index: lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py =================================================================== --- lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py +++ lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py @@ -35,7 +35,7 @@ process = target.LaunchSimple( None, None, self.get_process_working_directory()) - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) self.expect( Index: lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py =================================================================== --- lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py +++ lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py @@ -42,7 +42,7 @@ process = target.LaunchSimple( None, None, self.get_process_working_directory()) - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) var = self.frame().FindVariable("foo") @@ -60,5 +60,5 @@ self.assertTrue(var_pte_type.GetDirectBaseClassAtIndex( 0).IsValid(), "Foo * has a valid base class") - self.assertTrue(var_ptr_type.GetDirectBaseClassAtIndex(0).GetName() == var_pte_type.GetDirectBaseClassAtIndex( + self.assertEquals(var_ptr_type.GetDirectBaseClassAtIndex(0).GetName(), var_pte_type.GetDirectBaseClassAtIndex( 0).GetName(), "Foo and its pointer type don't agree on their base class") Index: lldb/test/API/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py =================================================================== --- lldb/test/API/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py +++ lldb/test/API/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py @@ -48,7 +48,7 @@ self.assertTrue( len(thread_list) != 0, "No thread stopped at our breakpoint.") - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "More than one thread stopped at our breakpoint.") # Now make sure we can call a function in the class method we've Index: lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py =================================================================== --- lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py +++ lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py @@ -64,12 +64,12 @@ process = target.LaunchSimple( None, None, self.get_process_working_directory()) - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) threads = lldbutil.get_threads_stopped_at_breakpoint( process, main_before_setProperty_bkpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] # @@ -130,7 +130,7 @@ threads = lldbutil.get_stopped_threads( process, lldb.eStopReasonPlanComplete) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) line_entry = threads[0].GetFrameAtIndex(0).GetLineEntry() self.assertEqual(line_entry.GetLine(), self.set_property_line) @@ -143,7 +143,7 @@ threads = lldbutil.continue_to_breakpoint( process, handle_SourceBase_bkpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] frame = thread.GetFrameAtIndex(0) @@ -183,7 +183,7 @@ threads = lldbutil.continue_to_breakpoint( process, handle_SourceBase_bkpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] frame = thread.GetFrameAtIndex(0) @@ -201,7 +201,7 @@ def examine_SourceDerived_ptr(self, object): self.assertTrue(object) - self.assertTrue(object.GetTypeName().find('SourceDerived') != -1) + self.assertNotEqual(object.GetTypeName().find('SourceDerived'), -1) derivedValue = object.GetChildMemberWithName('_derivedValue') self.assertTrue(derivedValue) - self.assertTrue(int(derivedValue.GetValue(), 0) == 30) + self.assertEquals(int(derivedValue.GetValue(), 0), 30) Index: lldb/test/API/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py =================================================================== --- lldb/test/API/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py +++ lldb/test/API/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py @@ -43,7 +43,7 @@ thread_list = lldbutil.get_threads_stopped_at_breakpoint( process, breakpoint) - self.assertTrue(len(thread_list) == 1) + self.assertEquals(len(thread_list), 1) thread = thread_list[0] frame = thread.GetFrameAtIndex(0) @@ -62,7 +62,7 @@ "Found mine->backed_int local variable.") backed_value = mine_backed_int.GetValueAsSigned(error) self.assertTrue(error.Success()) - self.assertTrue(backed_value == 1111) + self.assertEquals(backed_value, 1111) # Test the value object value for DerivedClass->_derived_backed_int @@ -72,7 +72,7 @@ "Found mine->derived_backed_int local variable.") derived_backed_value = mine_derived_backed_int.GetValueAsSigned(error) self.assertTrue(error.Success()) - self.assertTrue(derived_backed_value == 3333) + self.assertEquals(derived_backed_value, 3333) # Make sure we also get bit-field offsets correct: @@ -80,4 +80,4 @@ self.assertTrue(mine_flag2, "Found mine->flag2 local variable.") flag2_value = mine_flag2.GetValueAsUnsigned(error) self.assertTrue(error.Success()) - self.assertTrue(flag2_value == 7) + self.assertEquals(flag2_value, 7) Index: lldb/test/API/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py =================================================================== --- lldb/test/API/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py +++ lldb/test/API/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py @@ -50,7 +50,7 @@ thread_list = lldbutil.get_threads_stopped_at_breakpoint( process, breakpoint) - self.assertTrue(len(thread_list) == 1) + self.assertEquals(len(thread_list), 1) thread = thread_list[0] frame = thread.GetFrameAtIndex(0) @@ -64,4 +64,4 @@ self.assertTrue(ivar, "Got result for mc->_foo") ivar_value = ivar.GetValueAsSigned(error) self.assertTrue(error.Success()) - self.assertTrue(ivar_value == 3) + self.assertEquals(ivar_value, 3) Index: lldb/test/API/lang/objc/objc-property/TestObjCProperty.py =================================================================== --- lldb/test/API/lang/objc/objc-property/TestObjCProperty.py +++ lldb/test/API/lang/objc/objc-property/TestObjCProperty.py @@ -48,12 +48,12 @@ process = target.LaunchSimple( None, None, self.get_process_working_directory()) - self.assertTrue(process.GetState() == lldb.eStateStopped, + self.assertEquals(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) threads = lldbutil.get_threads_stopped_at_breakpoint( process, main_bkpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] frame = thread.GetFrameAtIndex(0) @@ -62,7 +62,7 @@ access_count = mine.GetChildMemberWithName("_access_count") self.assertTrue(access_count.IsValid()) start_access_count = access_count.GetValueAsUnsigned(123456) - self.assertTrue(start_access_count != 123456) + self.assertNotEqual(start_access_count, 123456) # # The first set of tests test calling the getter & setter of @@ -74,13 +74,13 @@ nonexistant_error = nonexistant_value.GetError() self.assertTrue(nonexistant_error.Success()) nonexistant_int = nonexistant_value.GetValueAsUnsigned(123456) - self.assertTrue(nonexistant_int == 6) + self.assertEquals(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.assertTrue(new_access_count - start_access_count == 1) + self.assertEquals(new_access_count - start_access_count, 1) start_access_count = new_access_count # @@ -94,7 +94,7 @@ # that happened. new_access_count = access_count.GetValueAsUnsigned(123456) - self.assertTrue(new_access_count - start_access_count == 1) + self.assertEquals(new_access_count - start_access_count, 1) start_access_count = new_access_count # @@ -123,12 +123,12 @@ "mine.idWithProtocol", False) idWithProtocol_error = idWithProtocol_value.GetError() self.assertTrue(idWithProtocol_error.Success()) - self.assertTrue(idWithProtocol_value.GetTypeName() == "id") + self.assertEquals(idWithProtocol_value.GetTypeName(), "id") # Make sure that class property getter works as expected value = frame.EvaluateExpression("BaseClass.classInt", False) self.assertTrue(value.GetError().Success()) - self.assertTrue(value.GetValueAsUnsigned(11111) == 123) + self.assertEquals(value.GetValueAsUnsigned(11111), 123) # Make sure that class property setter works as expected value = frame.EvaluateExpression("BaseClass.classInt = 234", False) @@ -137,4 +137,4 @@ # Verify that setter above actually worked value = frame.EvaluateExpression("BaseClass.classInt", False) self.assertTrue(value.GetError().Success()) - self.assertTrue(value.GetValueAsUnsigned(11111) == 234) + self.assertEquals(value.GetValueAsUnsigned(11111), 234) Index: lldb/test/API/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py =================================================================== --- lldb/test/API/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py +++ lldb/test/API/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py @@ -53,7 +53,7 @@ self.assertTrue( len(thread_list) != 0, "No thread stopped at our breakpoint.") - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "More than one thread stopped at our breakpoint.") # Now make sure we can call a function in the static method we've Index: lldb/test/API/lang/objc/objc-static-method/TestObjCStaticMethod.py =================================================================== --- lldb/test/API/lang/objc/objc-static-method/TestObjCStaticMethod.py +++ lldb/test/API/lang/objc/objc-static-method/TestObjCStaticMethod.py @@ -48,7 +48,7 @@ self.assertTrue( len(thread_list) != 0, "No thread stopped at our breakpoint.") - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "More than one thread stopped at our breakpoint.") # Now make sure we can call a function in the static method we've Index: lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py =================================================================== --- lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py +++ lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py @@ -48,7 +48,7 @@ self.assertTrue( len(thread_list) != 0, "No thread stopped at our breakpoint.") - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "More than one thread stopped at our breakpoint.") frame = thread_list[0].GetFrameAtIndex(0) Index: lldb/test/API/lang/objc/objc-struct-return/TestObjCStructReturn.py =================================================================== --- lldb/test/API/lang/objc/objc-struct-return/TestObjCStructReturn.py +++ lldb/test/API/lang/objc/objc-struct-return/TestObjCStructReturn.py @@ -47,7 +47,7 @@ self.assertTrue( len(thread_list) != 0, "No thread stopped at our breakpoint.") - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "More than one thread stopped at our breakpoint.") frame = thread_list[0].GetFrameAtIndex(0) Index: lldb/test/API/lang/objc/objc-super/TestObjCSuper.py =================================================================== --- lldb/test/API/lang/objc/objc-super/TestObjCSuper.py +++ lldb/test/API/lang/objc/objc-super/TestObjCSuper.py @@ -47,7 +47,7 @@ self.assertTrue( len(thread_list) != 0, "No thread stopped at our breakpoint.") - self.assertTrue(len(thread_list) == 1, + self.assertEquals(len(thread_list), 1, "More than one thread stopped at our breakpoint.") # Now make sure we can call a function in the class method we've @@ -57,8 +57,8 @@ cmd_value = frame.EvaluateExpression("[self get]") self.assertTrue(cmd_value.IsValid()) - self.assertTrue(cmd_value.GetValueAsUnsigned() == 2) + self.assertEquals(cmd_value.GetValueAsUnsigned(), 2) cmd_value = frame.EvaluateExpression("[super get]") self.assertTrue(cmd_value.IsValid()) - self.assertTrue(cmd_value.GetValueAsUnsigned() == 1) + self.assertEquals(cmd_value.GetValueAsUnsigned(), 1) Index: lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py =================================================================== --- lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py +++ lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py @@ -33,7 +33,7 @@ self.assertTrue(self.process, PROCESS_IS_VALID) # The stop reason of the thread should be breakpoint. - self.assertTrue(self.process.GetState() == lldb.eStateStopped, + self.assertEquals(self.process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT) exe_module = self.target.GetModuleAtIndex(0) Index: lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py =================================================================== --- lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py +++ lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py @@ -30,7 +30,7 @@ self.assertTrue(self.process, PROCESS_IS_VALID) # The stop reason of the thread should be breakpoint. - self.assertTrue(self.process.GetState() == lldb.eStateStopped, + self.assertEquals(self.process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT) frame = self.process.GetThreadAtIndex(0).GetFrameAtIndex(0) Index: lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py =================================================================== --- lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py +++ lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py @@ -36,7 +36,7 @@ self.assertTrue(self.process, PROCESS_IS_VALID) # The stop reason of the thread should be breakpoint. - self.assertTrue(self.process.GetState() == lldb.eStateStopped, + self.assertEquals(self.process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT) self.runCmd("add-dsym " + Index: lldb/test/API/macosx/find-app-in-bundle/TestFindAppInBundle.py =================================================================== --- lldb/test/API/macosx/find-app-in-bundle/TestFindAppInBundle.py +++ lldb/test/API/macosx/find-app-in-bundle/TestFindAppInBundle.py @@ -39,7 +39,7 @@ self.assertTrue(exe_module_spec.GetFilename(), "TestApp") bkpt = target.BreakpointCreateBySourceRegex("Set a breakpoint here", self.main_source_file) - self.assertTrue(bkpt.GetNumLocations() == 1, "Couldn't set a breakpoint in the main app") + self.assertEquals(bkpt.GetNumLocations(), 1, "Couldn't set a breakpoint in the main app") if lldbplatformutil.getPlatform() == "macosx": launch_info = lldb.SBLaunchInfo(None) @@ -53,6 +53,6 @@ # Frame #0 should be at our breakpoint. threads = lldbutil.get_threads_stopped_at_breakpoint(process, bkpt) - self.assertTrue(len(threads) == 1, "Expected 1 thread to stop at breakpoint, %d did."%(len(threads))) + self.assertEquals(len(threads), 1, "Expected 1 thread to stop at breakpoint, %d did."%(len(threads))) Index: lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py =================================================================== --- lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py +++ lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py @@ -56,7 +56,7 @@ self.assertTrue(target.IsValid(), 'Should have a valid Target after attaching to process') setup_complete = target.FindFirstGlobalVariable("setup_is_complete") - self.assertTrue(setup_complete.GetValueAsUnsigned() == 1, 'Check that inferior process has completed setup') + self.assertEquals(setup_complete.GetValueAsUnsigned(), 1, 'Check that inferior process has completed setup') # Find the bundle module, see if we found the dSYM too (they're both in "hide.app") i = 0 Index: lldb/test/API/macosx/find-dsym/deep-bundle/TestDeepBundle.py =================================================================== --- lldb/test/API/macosx/find-dsym/deep-bundle/TestDeepBundle.py +++ lldb/test/API/macosx/find-dsym/deep-bundle/TestDeepBundle.py @@ -53,7 +53,7 @@ self.assertTrue(target.IsValid(), 'Should have a valid Target after attaching to process') setup_complete = target.FindFirstGlobalVariable("setup_is_complete") - self.assertTrue(setup_complete.GetValueAsUnsigned() == 1, 'Check that inferior process has completed setup') + self.assertEquals(setup_complete.GetValueAsUnsigned(), 1, 'Check that inferior process has completed setup') # Find the bundle module, see if we found the dSYM too (they're both in "hide.app") i = 0 Index: lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py =================================================================== --- lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py +++ lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py @@ -31,12 +31,14 @@ listener = self.dbg.GetListener() broadcaster = process.GetBroadcaster() rc = broadcaster.AddListener(listener, lldb.SBProcess.eBroadcastBitStateChanged) - self.assertTrue(rc != 0, "Unable to add listener to process") + self.assertNotEqual(rc, 0, "Unable to add listener to process") self.assertTrue(self.wait_for_running(process, listener), "Check that process is up and running") inferior_set_up = self.wait_until_program_setup_complete(process, listener) - self.assertTrue(inferior_set_up.IsValid() and inferior_set_up.GetValueAsSigned() == 1, "Check that the program was able to create its threads within the allotted time") + # 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.check_number_of_threads(process) Index: lldb/test/API/macosx/universal/TestUniversal.py =================================================================== --- lldb/test/API/macosx/universal/TestUniversal.py +++ lldb/test/API/macosx/universal/TestUniversal.py @@ -155,7 +155,7 @@ # backtracing failed. threads = lldbutil.continue_to_breakpoint(process, bkpt) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) thread = threads[0] self.assertTrue( thread.GetNumFrames() > 1, Index: lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py =================================================================== --- lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py +++ lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py @@ -46,7 +46,7 @@ self.assertTrue(process, PROCESS_IS_VALID) # Get Frame #0. - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( Index: lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py =================================================================== --- lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py +++ lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py @@ -40,7 +40,7 @@ threads = lldbutil.get_threads_stopped_at_breakpoint( process, breakpoint) - self.assertTrue(len(threads) == 1) + self.assertEquals(len(threads), 1) self.thread = threads[0] self.frame = self.thread.frames[0] self.assertTrue(self.frame, "Frame 0 is valid.") Index: lldb/test/API/python_api/name_lookup/TestNameLookup.py =================================================================== --- lldb/test/API/python_api/name_lookup/TestNameLookup.py +++ lldb/test/API/python_api/name_lookup/TestNameLookup.py @@ -55,7 +55,7 @@ self.assertGreaterEqual(len(mangled_to_symbol), 6) for mangled in mangled_to_symbol.keys(): symbol_contexts = target.FindFunctions(mangled, lldb.eFunctionNameTypeFull) - self.assertTrue(symbol_contexts.GetSize() == 1) + self.assertEquals(symbol_contexts.GetSize(), 1) for symbol_context in symbol_contexts: self.assertTrue(symbol_context.GetFunction().IsValid()) self.assertTrue(symbol_context.GetSymbol().IsValid()) Index: lldb/test/API/python_api/objc_type/TestObjCType.py =================================================================== --- lldb/test/API/python_api/objc_type/TestObjCType.py +++ lldb/test/API/python_api/objc_type/TestObjCType.py @@ -40,7 +40,7 @@ self.assertTrue(process, PROCESS_IS_VALID) # Get Frame #0. - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( @@ -60,9 +60,9 @@ aFooType = aBarType.GetDirectBaseClassAtIndex(0) self.assertTrue(aFooType.IsValid(), "Foo should be a valid data type") - self.assertTrue(aFooType.GetName() == "Foo", "Foo has the right name") + self.assertEquals(aFooType.GetName(), "Foo", "Foo has the right name") - self.assertTrue(aBarType.GetNumberOfFields() == 1, "Bar has a field") + self.assertEquals(aBarType.GetNumberOfFields(), 1, "Bar has a field") aBarField = aBarType.GetFieldAtIndex(0) self.assertTrue( Index: lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py =================================================================== --- lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py +++ lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py @@ -63,7 +63,7 @@ self.assertTrue( barPersist.GetPointeeData().sint32[0] == 4, "barPersist != 4") - self.assertTrue(bazPersist.GetSummary() == '"85"', "bazPersist != 85") + self.assertEquals(bazPersist.GetSummary(), '"85"', "bazPersist != 85") self.runCmd("continue") @@ -77,6 +77,6 @@ self.assertTrue( barPersist.GetPointeeData().sint32[0] == 4, "barPersist != 4") - self.assertTrue(bazPersist.GetSummary() == '"85"', "bazPersist != 85") + self.assertEquals(bazPersist.GetSummary(), '"85"', "bazPersist != 85") self.expect("expr *(%s)" % (barPersist.GetName()), substrs=['= 4']) Index: lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py =================================================================== --- lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py +++ lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py @@ -60,7 +60,7 @@ self.assertTrue(process, PROCESS_IS_VALID) # Get Frame #0. - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( @@ -76,7 +76,7 @@ self.assertTrue(val_value.IsValid(), "Got the SBValue for val") actual_value = val_value.GetValueAsSigned(error, 0) self.assertTrue(error.Success(), "Got a value from val") - self.assertTrue(actual_value == 100, "Got the right value from val") + self.assertEquals(actual_value, 100, "Got the right value from val") result = val_value.SetValueFromCString("12345") self.assertTrue(result, "Setting val returned True.") @@ -99,7 +99,7 @@ self.assertTrue( error.Success(), "Got an unsigned value for second_val") - self.assertTrue(actual_value == 5555) + self.assertEquals(actual_value, 5555) result = mine_second_value.SetValueFromCString("98765") self.assertTrue(result, "Success setting mine.second_value.") @@ -107,7 +107,7 @@ self.assertTrue( error.Success(), "Got a changed value from mine.second_val") - self.assertTrue(actual_value == 98765, + self.assertEquals(actual_value, 98765, "Got the right changed value from mine.second_val") # Next do the same thing with the pointer version. @@ -120,7 +120,7 @@ self.assertTrue( error.Success(), "Got an unsigned value for ptr->second_val") - self.assertTrue(actual_value == 6666) + self.assertEquals(actual_value, 6666) result = ptr_second_value.SetValueFromCString("98765") self.assertTrue(result, "Success setting ptr->second_value.") @@ -128,7 +128,7 @@ self.assertTrue( error.Success(), "Got a changed value from ptr->second_val") - self.assertTrue(actual_value == 98765, + self.assertEquals(actual_value, 98765, "Got the right changed value from ptr->second_val") # gcc may set multiple locations for breakpoint @@ -138,7 +138,7 @@ # values as well... process.Continue() - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( @@ -171,7 +171,7 @@ process.Continue() - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( Index: lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py =================================================================== --- lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py +++ lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py @@ -28,7 +28,7 @@ self.assertTrue(process, PROCESS_IS_VALID) # Get Frame #0. - self.assertTrue(process.GetState() == lldb.eStateStopped) + self.assertEquals(process.GetState(), lldb.eStateStopped) thread = lldbutil.get_stopped_thread( process, lldb.eStopReasonBreakpoint) self.assertTrue( Index: lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py =================================================================== --- lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py +++ lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py @@ -112,7 +112,7 @@ pcs_text = results["thread-pcs"] thread_ids = threads_text.split(",") pcs = pcs_text.split(",") - self.assertTrue(len(thread_ids) == len(pcs)) + self.assertEquals(len(thread_ids), len(pcs)) thread_pcs = dict() for i in range(0, len(pcs)): Index: lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py =================================================================== --- lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py +++ lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py @@ -40,7 +40,7 @@ self.connect_to_debug_monitor() context = self.expect_gdbremote_sequence() register_bank = context.get("register_bank") - self.assertTrue(register_bank[0] != 'E') + self.assertNotEqual(register_bank[0], 'E') self.test_sequence.add_log_lines( ["read packet: $G" + register_bank + "#00", @@ -48,7 +48,7 @@ "capture": {1: "G_reply"}}], True) context = self.expect_gdbremote_sequence() - self.assertTrue(context.get("G_reply")[0] != 'E') + self.assertNotEqual(context.get("G_reply")[0], 'E') @skipIfOutOfTreeDebugserver @debugserver_test @@ -105,7 +105,7 @@ context = self.expect_gdbremote_sequence() self.assertIsNotNone(context) reg_bank = context.get("register_bank") - self.assertTrue(reg_bank[0] != 'E') + self.assertNotEqual(reg_bank[0], 'E') byte_order = self.get_target_byte_order() get_reg_value = lambda reg_name : _extract_register_value( Index: lldb/test/API/tools/lldb-vscode/attach/TestVSCode_attach.py =================================================================== --- lldb/test/API/tools/lldb-vscode/attach/TestVSCode_attach.py +++ lldb/test/API/tools/lldb-vscode/attach/TestVSCode_attach.py @@ -165,7 +165,7 @@ functions = ['main'] breakpoint_ids = self.set_function_breakpoints(functions) - self.assertTrue(len(breakpoint_ids) == len(functions), + self.assertEquals(len(breakpoint_ids), len(functions), "expect one breakpoint") self.continue_to_breakpoints(breakpoint_ids) output = self.get_console(timeout=1.0) Index: lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py =================================================================== --- lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py +++ lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py @@ -48,7 +48,7 @@ line_to_id = {} if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(lines), + self.assertEquals(len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))) for breakpoint in breakpoints: line = breakpoint['line'] @@ -71,13 +71,13 @@ response = self.vscode.request_setBreakpoints(source_path, lines) if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(lines), + self.assertEquals(len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))) for breakpoint in breakpoints: line = breakpoint['line'] # Verify the same breakpoints are still set within LLDB by # making sure the breakpoint ID didn't change - self.assertTrue(line_to_id[line] == breakpoint['id'], + self.assertEquals(line_to_id[line], breakpoint['id'], "verify previous breakpoints stayed the same") self.assertTrue(line in lines, "line expected in lines array") self.assertTrue(breakpoint['verified'], @@ -90,13 +90,13 @@ response = self.vscode.request_testGetTargetBreakpoints() if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(lines), + self.assertEquals(len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))) for breakpoint in breakpoints: line = breakpoint['line'] # Verify the same breakpoints are still set within LLDB by # making sure the breakpoint ID didn't change - self.assertTrue(line_to_id[line] == breakpoint['id'], + self.assertEquals(line_to_id[line], breakpoint['id'], "verify previous breakpoints stayed the same") self.assertTrue(line in lines, "line expected in lines array") self.assertTrue(breakpoint['verified'], @@ -108,14 +108,14 @@ response = self.vscode.request_setBreakpoints(source_path, lines) if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(lines), + self.assertEquals(len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))) # Verify with the target that all breakpoints have been cleared response = self.vscode.request_testGetTargetBreakpoints() if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(lines), + self.assertEquals(len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))) # Now set a breakpoint again in the same source file and verify it @@ -124,7 +124,7 @@ response = self.vscode.request_setBreakpoints(source_path, lines) if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(lines), + self.assertEquals(len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))) for breakpoint in breakpoints: line = breakpoint['line'] @@ -139,7 +139,7 @@ response = self.vscode.request_testGetTargetBreakpoints() if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(lines), + self.assertEquals(len(breakpoints), len(lines), "expect %u source breakpoints" % (len(lines))) for breakpoint in breakpoints: line = breakpoint['line'] @@ -160,7 +160,7 @@ # Set a breakpoint at the loop line with no condition and no # hitCondition breakpoint_ids = self.set_source_breakpoints(source_path, [loop_line]) - self.assertTrue(len(breakpoint_ids) == 1, "expect one breakpoint") + self.assertEquals(len(breakpoint_ids), 1, "expect one breakpoint") self.vscode.request_continue() # Verify we hit the breakpoint we just set @@ -168,38 +168,38 @@ # Make sure i is zero at first breakpoint i = int(self.vscode.get_local_variable_value('i')) - self.assertTrue(i == 0, 'i != 0 after hitting breakpoint') + self.assertEquals(i, 0, 'i != 0 after hitting breakpoint') # Update the condition on our breakpoint new_breakpoint_ids = self.set_source_breakpoints(source_path, [loop_line], condition="i==4") - self.assertTrue(breakpoint_ids == new_breakpoint_ids, + self.assertEquals(breakpoint_ids, new_breakpoint_ids, "existing breakpoint should have its condition " "updated") self.continue_to_breakpoints(breakpoint_ids) i = int(self.vscode.get_local_variable_value('i')) - self.assertTrue(i == 4, + self.assertEquals(i, 4, 'i != 4 showing conditional works') new_breakpoint_ids = self.set_source_breakpoints(source_path, [loop_line], hitCondition="2") - self.assertTrue(breakpoint_ids == new_breakpoint_ids, + self.assertEquals(breakpoint_ids, new_breakpoint_ids, "existing breakpoint should have its condition " "updated") # Continue with a hitContidtion of 2 and expect it to skip 1 value self.continue_to_breakpoints(breakpoint_ids) i = int(self.vscode.get_local_variable_value('i')) - self.assertTrue(i == 6, + self.assertEquals(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.vscode.get_local_variable_value('i')) - self.assertTrue(i == 7, + self.assertEquals(i, 7, 'i != 7 showing post hitCondition hits every time') Index: lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setFunctionBreakpoints.py =================================================================== --- lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setFunctionBreakpoints.py +++ lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setFunctionBreakpoints.py @@ -41,7 +41,7 @@ response = self.vscode.request_setFunctionBreakpoints(functions) if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(functions), + self.assertEquals(len(breakpoints), len(functions), "expect %u source breakpoints" % (len(functions))) for breakpoint in breakpoints: bp_id_12 = breakpoint['id'] @@ -53,7 +53,7 @@ response = self.vscode.request_setFunctionBreakpoints(functions) if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(functions), + self.assertEquals(len(breakpoints), len(functions), "expect %u source breakpoints" % (len(functions))) for breakpoint in breakpoints: self.assertTrue(breakpoint['verified'], @@ -65,11 +65,11 @@ response = self.vscode.request_setFunctionBreakpoints(functions) if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(functions), + self.assertEquals(len(breakpoints), len(functions), "expect %u source breakpoints" % (len(functions))) for breakpoint in breakpoints: bp_id = breakpoint['id'] - self.assertTrue(bp_id == bp_id_12, + self.assertEquals(bp_id, bp_id_12, 'verify "twelve" breakpoint ID is same') self.assertTrue(breakpoint['verified'], "expect breakpoint still verified") @@ -81,11 +81,11 @@ response = self.vscode.request_testGetTargetBreakpoints() if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(functions), + self.assertEquals(len(breakpoints), len(functions), "expect %u source breakpoints" % (len(functions))) for breakpoint in breakpoints: bp_id = breakpoint['id'] - self.assertTrue(bp_id == bp_id_12, + self.assertEquals(bp_id, bp_id_12, 'verify "twelve" breakpoint ID is same') self.assertTrue(breakpoint['verified'], "expect breakpoint still verified") @@ -96,14 +96,14 @@ response = self.vscode.request_setFunctionBreakpoints(functions) if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(functions), + self.assertEquals(len(breakpoints), len(functions), "expect %u source breakpoints" % (len(functions))) # Verify with the target that all breakpoints have been cleared response = self.vscode.request_testGetTargetBreakpoints() if response: breakpoints = response['body']['breakpoints'] - self.assertTrue(len(breakpoints) == len(functions), + self.assertEquals(len(breakpoints), len(functions), "expect %u source breakpoints" % (len(functions))) @skipIfWindows @@ -117,7 +117,7 @@ functions = ['twelve'] breakpoint_ids = self.set_function_breakpoints(functions) - self.assertTrue(len(breakpoint_ids) == len(functions), + self.assertEquals(len(breakpoint_ids), len(functions), "expect one breakpoint") # Verify we hit the breakpoint we just set @@ -125,35 +125,35 @@ # Make sure i is zero at first breakpoint i = int(self.vscode.get_local_variable_value('i')) - self.assertTrue(i == 0, 'i != 0 after hitting breakpoint') + self.assertEquals(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.assertTrue(breakpoint_ids == new_breakpoint_ids, + self.assertEquals(breakpoint_ids, new_breakpoint_ids, "existing breakpoint should have its condition " "updated") self.continue_to_breakpoints(breakpoint_ids) i = int(self.vscode.get_local_variable_value('i')) - self.assertTrue(i == 4, + self.assertEquals(i, 4, 'i != 4 showing conditional works') new_breakpoint_ids = self.set_function_breakpoints(functions, hitCondition="2") - self.assertTrue(breakpoint_ids == new_breakpoint_ids, + self.assertEquals(breakpoint_ids, new_breakpoint_ids, "existing breakpoint should have its condition " "updated") # Continue with a hitContidtion of 2 and expect it to skip 1 value self.continue_to_breakpoints(breakpoint_ids) i = int(self.vscode.get_local_variable_value('i')) - self.assertTrue(i == 6, + self.assertEquals(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.vscode.get_local_variable_value('i')) - self.assertTrue(i == 7, + self.assertEquals(i, 7, 'i != 7 showing post hitCondition hits every time') Index: lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py =================================================================== --- lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py +++ lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py @@ -102,7 +102,7 @@ for line in lines: if line.startswith(prefix): found = True - self.assertTrue(program_parent_dir == line[len(prefix):], + self.assertEquals(program_parent_dir, line[len(prefix):], "lldb-vscode working dir '%s' == '%s'" % ( program_parent_dir, line[6:])) self.assertTrue(found, "verified lldb-vscode working directory") @@ -127,7 +127,7 @@ if line.startswith(prefix): found = True quoted_path = '"%s"' % (program_dir) - self.assertTrue(quoted_path == line[len(prefix):], + self.assertEquals(quoted_path, line[len(prefix):], "lldb-vscode working dir %s == %s" % ( quoted_path, line[6:])) self.assertTrue(found, 'found "sourcePath" in console output') @@ -144,7 +144,7 @@ self.continue_to_exit() # Now get the STDOUT and verify our program argument is correct output = self.get_stdout() - self.assertTrue(output is None or len(output) == 0, + self.assertEquals(output, None, "expect no program output") @skipIfWindows @@ -296,7 +296,7 @@ # Set 2 breakoints so we can verify that "stopCommands" get run as the # breakpoints get hit breakpoint_ids = self.set_source_breakpoints(source, lines) - self.assertTrue(len(breakpoint_ids) == len(lines), + self.assertEquals(len(breakpoint_ids), len(lines), "expect correct number of breakpoints") # Continue after launch and hit the first breakpoint. Index: lldb/test/API/tools/lldb-vscode/stackTrace/TestVSCode_stackTrace.py =================================================================== --- lldb/test/API/tools/lldb-vscode/stackTrace/TestVSCode_stackTrace.py +++ lldb/test/API/tools/lldb-vscode/stackTrace/TestVSCode_stackTrace.py @@ -41,13 +41,13 @@ else: expected_line = self.recurse_invocation expected_name = 'main' - self.assertTrue(frame_name == expected_name, + self.assertEquals(frame_name, expected_name, 'frame #%i name "%s" == "%s"' % ( frame_idx, frame_name, expected_name)) - self.assertTrue(frame_source == self.source_path, + self.assertEquals(frame_source, self.source_path, 'frame #%i source "%s" == "%s"' % ( frame_idx, frame_source, self.source_path)) - self.assertTrue(frame_line == expected_line, + self.assertEquals(frame_line, expected_line, 'frame #%i line %i == %i' % (frame_idx, frame_line, expected_line)) @@ -68,7 +68,7 @@ # Set breakoint at a point of deepest recuusion breakpoint_ids = self.set_source_breakpoints(source, lines) - self.assertTrue(len(breakpoint_ids) == len(lines), + self.assertEquals(len(breakpoint_ids), len(lines), "expect correct number of breakpoints") self.continue_to_breakpoints(breakpoint_ids) @@ -78,14 +78,14 @@ frameCount = len(stackFrames) self.assertTrue(frameCount >= 20, 'verify we get at least 20 frames for all frames') - self.assertTrue(totalFrames == frameCount, + self.assertEquals(totalFrames, frameCount, 'verify we get correct value for totalFrames count') self.verify_stackFrames(startFrame, stackFrames) # Verify all stack frames by specifying startFrame = 0 and levels not # specified stackFrames = self.get_stackFrames(startFrame=startFrame) - self.assertTrue(frameCount == len(stackFrames), + self.assertEquals(frameCount, len(stackFrames), ('verify same number of frames with startFrame=%i') % ( startFrame)) self.verify_stackFrames(startFrame, stackFrames) @@ -94,7 +94,7 @@ levels = 0 stackFrames = self.get_stackFrames(startFrame=startFrame, levels=levels) - self.assertTrue(frameCount == len(stackFrames), + self.assertEquals(frameCount, len(stackFrames), ('verify same number of frames with startFrame=%i and' ' levels=%i') % (startFrame, levels)) self.verify_stackFrames(startFrame, stackFrames) @@ -104,7 +104,7 @@ levels = 1 stackFrames = self.get_stackFrames(startFrame=startFrame, levels=levels) - self.assertTrue(levels == len(stackFrames), + self.assertEquals(levels, len(stackFrames), ('verify one frame with startFrame=%i and' ' levels=%i') % (startFrame, levels)) self.verify_stackFrames(startFrame, stackFrames) @@ -114,7 +114,7 @@ levels = 3 stackFrames = self.get_stackFrames(startFrame=startFrame, levels=levels) - self.assertTrue(levels == len(stackFrames), + self.assertEquals(levels, len(stackFrames), ('verify %i frames with startFrame=%i and' ' levels=%i') % (levels, startFrame, levels)) self.verify_stackFrames(startFrame, stackFrames) @@ -125,7 +125,7 @@ levels = 16 stackFrames = self.get_stackFrames(startFrame=startFrame, levels=levels) - self.assertTrue(levels == len(stackFrames), + self.assertEquals(levels, len(stackFrames), ('verify %i frames with startFrame=%i and' ' levels=%i') % (levels, startFrame, levels)) self.verify_stackFrames(startFrame, stackFrames) @@ -136,10 +136,10 @@ (stackFrames, totalFrames) = self.get_stackFrames_and_totalFramesCount( startFrame=startFrame, levels=levels) - self.assertTrue(len(stackFrames) == frameCount - startFrame, + self.assertEquals(len(stackFrames), frameCount - startFrame, ('verify less than 1000 frames with startFrame=%i and' ' levels=%i') % (startFrame, levels)) - self.assertTrue(totalFrames == frameCount, + self.assertEquals(totalFrames, frameCount, 'verify we get correct value for totalFrames count ' 'when requested frames not from 0 index') self.verify_stackFrames(startFrame, stackFrames) @@ -149,7 +149,7 @@ levels = 0 stackFrames = self.get_stackFrames(startFrame=startFrame, levels=levels) - self.assertTrue(len(stackFrames) == frameCount - startFrame, + self.assertEquals(len(stackFrames), frameCount - startFrame, ('verify less than 1000 frames with startFrame=%i and' ' levels=%i') % (startFrame, levels)) self.verify_stackFrames(startFrame, stackFrames) @@ -159,5 +159,5 @@ levels = 1 stackFrames = self.get_stackFrames(startFrame=startFrame, levels=levels) - self.assertTrue(0 == len(stackFrames), + self.assertEquals(0, len(stackFrames), 'verify zero frames with startFrame out of bounds')