Skip to content

BUG: Fail Core/Common GoogleTests whose error checks only printed - #7050

Merged
hjmjohnson merged 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:bug-common-gtest-silent-checks
Oct 31, 2026
Merged

hjmjohnson merged 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:bug-common-gtest-silent-checks

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Four Core/Common GoogleTests printed an error when a check failed but did not fail the test. One BUG: commit per test turns each into a real check.

Test Check Fix
itkSTLContainerAdaptorGTest both containers end together (4 sites) return EXIT_FAILURE, like the helper's other checks
itkCovariantVectorGTest component bytes match a double EXPECT_EQ
itkThreadedIndexedContainerPartitionerGTest work units capped by the range EXPECT_EQ
itkVersorGTest computed rotation matrix is orthogonal EXPECT_TRUE(is_identity(...))
Testing

macOS arm64, conda clang, Release, Module_ITKCommon=ON. Every commit builds ITKCommonGTestDriver with 0 warnings, and the five affected tests pass, so none of these checks was hiding a failure. The partitioner check runs only with more than one thread; it ran here. pre-commit run --all-files passes.

How these were found

A scan of every GoogleTest on main for error branches that cannot fail the test, done alongside #7046 and #7048. Each pattern was copied faithfully from the legacy test when it was converted.

AI assistance (Claude Code) was used to find the defects and draft the changes; they were reviewed and tested locally.

…oints

The check that both containers end together printed an error but let the helper report success.
The byte-by-byte comparison with a double printed an error but did not fail the test.
The check that the work-unit count is capped by the range printed an error but did not fail the test.
The orthogonality check printed the matrix but did not fail the test.
@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module labels Oct 31, 2026
@hjmjohnson
hjmjohnson marked this pull request as ready for review October 31, 2026 15:24
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge.

Summary

This PR makes four Core/Common GoogleTest files fail checks that previously only printed errors.

  • The STL adaptor test fails when paired iterators end at different times.
  • The covariant-vector test fails when a component byte differs from a double.
  • The partitioner test fails when a short range uses the wrong number of work units.
  • The versor test fails when a computed rotation matrix is not orthogonal.

No actionable issues were found. Review was based on source inspection; no tests were run during this review.

Reviews (1) · Last reviewed commit: "BUG: Fail Versor test when a computed ro..." · Reviewed by Greptile

@hjmjohnson
hjmjohnson merged commit 0e0f096 into InsightSoftwareConsortium:main Oct 31, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants