This patch adds an optional argument to DexExpectWatchBase, float_range, which defines a +- acceptance range for expected floating point values. If passed, this assumes every expected value to be a floating point value, and an exception will be thrown if this is not the case.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectWatchBase.py | ||
---|---|---|
183 | It's been a little while since I've looked in this code, am I reading this right - expected_value is the value returned by the debugger? | |
cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/float_range_watch/float_range_zero.cpp | ||
2–3 ↗ | (On Diff #425449) | I'm not sure about this feature. What's the benefit of overriding 0.0 rather than just letting it mean zero? |
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectWatchBase.py | ||
---|---|---|
183 | Correct, I think the etymology is that it refers to the field of the watch value that we're expecting, i.e. the "value that we have an expectation for". (I do think it's confusing.) |
Just to confirm, does this comment:
Remove unused "zero range" test.
mean that the feature I was worried about here:
I'm not sure about this feature. What's the benefit of overriding 0.0 rather than just letting it mean zero?
doesn't exist, and the test was not correct for this iteration of the patch?
Please can you add a test for when the float range is set to 0.0 (easy / common edge case). LGTM with that plus inline comments addressed.
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectWatchBase.py | ||
---|---|---|
156 | Should this be <=? Otherwise an exact match with float_range of zero fails, right? | |
183 | Thanks for clarifying. It would be great if we're able to improve that name at some point in the future. | |
cross-project-tests/debuginfo-tests/dexter/dex/utils/Exceptions.py | ||
59 | nit: IF -> if and it's -> its |
cross-project-tests/debuginfo-tests/dexter/dex/utils/Exceptions.py | ||
---|---|---|
59 | If* and while you're there, removing "instruction" from that sentence works better IMO. |
Make some changes to correctly handle the float_range=0.0 case, add tests to cover it, and change comment as requested.
LGTM, with a request for a doc comment
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectWatchBase.py | ||
---|---|---|
145 | IMHO: this wants a docustring explaining what it's doing, which as I understand it, is replacing expected_value with a nearby float value, if it's within the float_range, to ensure that it passes an equality comparision. (Writing this down will ease the future readers task). |
cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectWatchBase.py | ||
---|---|---|
36 | New name + docstring here, since the new revision has messed up line numbers apparently. |
New name + docstring here, since the new revision has messed up line numbers apparently.