This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Convert assertTrue(a == b) to assertEqual(a, b)
ClosedPublic

Authored by kastiglione on Feb 1 2021, 12:24 PM.

Details

Summary

Convert assertTrue(a == b) to assertEqual(a, b) to produce better failure messages.

These were mostly done via regex search & replace, with some manual fixes.

Diff Detail

Event Timeline

kastiglione requested review of this revision.Feb 1 2021, 12:24 PM
kastiglione created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2021, 12:24 PM

I haven't run tests yet.

JDevlieghere accepted this revision.Feb 1 2021, 3:50 PM

Cool, I was under the impression @teemperor had already done something similar, but I must be misremembering.

lldb/test/API/python_api/frame/TestFrames.py
96–97

Very odd/confusing formatting.

lldb/test/API/python_api/lldbutil/iter/TestLLDBIterator.py
53

😁

This revision is now accepted and ready to land.Feb 1 2021, 3:50 PM
kastiglione added inline comments.Feb 1 2021, 4:02 PM
lldb/test/API/python_api/frame/TestFrames.py
96–97

I noticed this too in the diff, I'll fix it up.

Cool, I was under the impression @teemperor had already done something similar, but I must be misremembering.

I ran one big regex that got most of the Equal/Less/Bigger than, but I think the multi-line calls I didn't transform (because of laziness).

teemperor accepted this revision.Feb 2 2021, 11:58 AM

Don't see any change that looks wrong from scrolling over this, so LGTM

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
59–60

10/10

assertNotEqual & formatting

This revision was landed with ongoing or failed builds.Feb 2 2021, 12:39 PM
This revision was automatically updated to reflect the committed changes.