[Lldb-commits] [PATCH] D74475: [lldb] Replace assertTrue(a == b, "msg") with assertEquals(a, b, "msg") in the test suite

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 12 03:10:23 PST 2020


teemperor created this revision.
teemperor added reviewers: labath, JDevlieghere.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.

The error message from the construct `assertTrue(a == b, "msg") ` are nearly always completely useless for actually debugging the issue.
This patch is just replacing this construct (and similar ones like `assertTrue(a != b, ...)` with the proper call to assertEqual or assertNotEquals.

This patch was mostly written by a shell script with some manual verification afterwards so another set of eyes would be helpful.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D74475

Files:
  lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py
  lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py
  lldb/test/API/commands/expression/call-throws/TestCallThatThrows.py
  lldb/test/API/commands/expression/fixits/TestFixIts.py
  lldb/test/API/commands/expression/issue_11588/Test11588.py
  lldb/test/API/commands/expression/save_jit_objects/TestSaveJITObjects.py
  lldb/test/API/commands/expression/test/TestExprs.py
  lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py
  lldb/test/API/commands/frame/language/TestGuessLanguage.py
  lldb/test/API/commands/frame/var/TestFrameVar.py
  lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
  lldb/test/API/commands/register/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
  lldb/test/API/commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py
  lldb/test/API/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py
  lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
  lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
  lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
  lldb/test/API/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
  lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
  lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
  lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
  lldb/test/API/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
  lldb/test/API/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
  lldb/test/API/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
  lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
  lldb/test/API/functionalities/memory/cache/TestMemoryCache.py
  lldb/test/API/functionalities/memory/read/TestMemoryRead.py
  lldb/test/API/functionalities/mtc/simple/TestMTCSimple.py
  lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
  lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
  lldb/test/API/functionalities/return-value/TestReturnValue.py
  lldb/test/API/functionalities/signal/TestSendSignal.py
  lldb/test/API/functionalities/source-map/TestTargetSourceMap.py
  lldb/test/API/functionalities/step-avoids-no-debug/TestStepNoDebug.py
  lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
  lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py
  lldb/test/API/functionalities/value_md5_crash/TestValueMD5Crash.py
  lldb/test/API/functionalities/var_path/TestVarPath.py
  lldb/test/API/lang/c/array_types/TestArrayTypes.py
  lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
  lldb/test/API/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
  lldb/test/API/lang/cpp/global_variables/TestCPPGlobalVariables.py
  lldb/test/API/lang/cpp/gmodules/TestWithModuleDebugging.py
  lldb/test/API/lang/cpp/stl/TestSTL.py
  lldb/test/API/lang/cpp/template/TestTemplateArgs.py
  lldb/test/API/lang/objc/global_ptrs/TestGlobalObjects.py
  lldb/test/API/lang/objc/ivar-IMP/TestObjCiVarIMP.py
  lldb/test/API/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
  lldb/test/API/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
  lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
  lldb/test/API/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
  lldb/test/API/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
  lldb/test/API/lang/objc/objc-property/TestObjCProperty.py
  lldb/test/API/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
  lldb/test/API/lang/objc/objc-static-method/TestObjCStaticMethod.py
  lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py
  lldb/test/API/lang/objc/objc-struct-return/TestObjCStructReturn.py
  lldb/test/API/lang/objc/objc-super/TestObjCSuper.py
  lldb/test/API/linux/add-symbols/TestTargetSymbolsAddCommand.py
  lldb/test/API/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
  lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
  lldb/test/API/macosx/find-app-in-bundle/TestFindAppInBundle.py
  lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
  lldb/test/API/macosx/find-dsym/deep-bundle/TestDeepBundle.py
  lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
  lldb/test/API/macosx/universal/TestUniversal.py
  lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
  lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py
  lldb/test/API/python_api/name_lookup/TestNameLookup.py
  lldb/test/API/python_api/objc_type/TestObjCType.py
  lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py
  lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
  lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
  lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
  lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py
  lldb/test/API/tools/lldb-vscode/attach/TestVSCode_attach.py
  lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
  lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setFunctionBreakpoints.py
  lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
  lldb/test/API/tools/lldb-vscode/stackTrace/TestVSCode_stackTrace.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74475.244115.patch
Type: text/x-patch
Size: 111811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200212/be646a92/attachment-0001.bin>


More information about the lldb-commits mailing list