Repository navigation
BUG: Check upper threshold default in itkBinaryThresholdImageFilterTest - #7008
Conversation
The upper threshold check read the lower threshold and expected its default. The filter initializes the upper threshold to max().
[Low impact] This PR appears safe to merge.
|
blowekamp
left a comment
There was a problem hiding this comment.
The changes look good.
This looks like a prime example of this manual testing type is not so good. Could an ITK_TEST macro be used instead?
This looks like a prime example of why the concise style of GTest is preferred. There was an effort to migrate many tests go GTest infrastructure, how did this test relate? It couldn't be migrated because of an input image?
|
@blowekamp Thanks for the review. Agreed on both points. This test takes no arguments and no input image, so nothing blocked migration. It is already converted to GoogleTest in my staged batch of no-argument CTest conversions (one commit per test, being upstreamed gradually): hjmjohnson/ITK@43b60e8cd4a on
|
|
@blowekamp Follow-up with the GoogleTest conversion of this test: #7040 (stacked on this PR). It follows the earlier bulk no-argument CTest conversions already merged (for example #6246, #6369, #6197, #6200), and the remaining ones are staged one commit per test on the |
The "upper threshold" check in
itkBinaryThresholdImageFilterTestread the lower threshold and expected its default. It now checksGetUpperThresholdInput()againstNumericTraits<InputPixelType>::max(), which the filter's constructor sets, and the copy-pasted failure message names the right getter.How this was found and tested
Found while converting this test to GoogleTest: the conversion reproduced
the defect faithfully, so the fix belongs in the legacy test first and the
conversion follows it. Built and ran locally (AppleClang, Release) along
with every other test in the affected modules: all pass.
AI assistance (Claude Code) was used to find the defect and draft the fix;
the change was reviewed and tested locally.