Repository navigation
ENH: Convert itkBinaryThresholdImageFilterTest to GoogleTest - #7040
Merged
hjmjohnson merged 2 commits intoOct 30, 2026
Merged
hjmjohnson merged 2 commits into
hjmjohnson merged 2 commits into
Conversation
Rename the file in its own commit so that git history follows it into the GoogleTest version; the test is dropped from the CTest driver here and registered with the GoogleTest driver in the next commit.
hjmjohnson
force-pushed
the
enh-binary-threshold-gtest
branch
from
October 30, 2026 15:13
1d797fe to
6e64277
Compare
hjmjohnson
marked this pull request as ready for review
October 30, 2026 15:15
Contributor
[Low impact] The changes affect one module's test setup, not filter behavior at runtime. The PR appears safe to merge, with a non-blocking improvement to stop pixel checks after a failed update. Findings
|
The hand-written check, print, and return blocks made a wrong default check easy to miss (the upper threshold was compared against the lower threshold default). EXPECT_EQ states each check in one line and reports both values on failure.
hjmjohnson
force-pushed
the
enh-binary-threshold-gtest
branch
from
October 30, 2026 20:48
6e64277 to
b627128
Compare
hjmjohnson
merged commit Oct 30, 2026
d403b90
into
InsightSoftwareConsortium:main
14 of 16 checks passed
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts
itkBinaryThresholdImageFilterTestto GoogleTest, as @blowekamp suggested in the #7008 review: the hand-written check, print, and return blocks become oneEXPECT_EQeach, so a wrong comparison like the one #7008 fixes is visible at a glance.#7008 has merged; this branch is two commits on main: a pure rename, then the conversion.
Reference: the bulk GoogleTest conversions
This follows the pattern of the earlier no-argument CTest conversions already merged, for example #5874, #6045, #6071, #6132, #6143, #6177, #6197, #6200, #6246, and #6369: rename in one commit so history follows the file, then convert the test body and register it with the module's GoogleTest driver.
The remaining no-argument CTests are converted on staging branches, one commit per test, for review in small batches:
gtest-staging-Afor Core and IO modules,gtest-staging-Bfor Filtering modules, andgtest-staging-Cfor Numerics and Registration modules, on hjmjohnson/ITK. This test came fromgtest-staging-B, and that branch now carries this exact version.Testing
macOS arm64, minimal build with
Module_ITKThresholding=ON, testing on: 0 warnings;BinaryThresholdImageFilter.ConvertedLegacyTestpasses, and all 72ITKThresholdingtests pass.pre-commit run --all-filespasses.