Skip to content

ENH: add streaming and invalid-encoding tests for AnatomicalOrientation#6536

Draft
blowekamp wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
blowekamp:test-anatomical-orientation-coverage
Draft

ENH: add streaming and invalid-encoding tests for AnatomicalOrientation#6536
blowekamp wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
blowekamp:test-anatomical-orientation-coverage

Conversation

@blowekamp

Copy link
Copy Markdown
Member

Add 5 GTest cases to itkAnatomicalOrientationGTest.cxx that cover the
four operator<< overloads and the default branch of
ConvertStringEncoding, raising line coverage from 76.6 % to 95.0 %
and function coverage from 77.8 % to 100 %.

Coverage detail
Metric Before After
Lines 76.6 % (108/141) 95.0 % (134/141)
Functions 77.8 % (14/18) 100 % (18/18)

New tests:

  • StreamingCoordinateEnum — all 7 CoordinateEnum values via operator<<
  • StreamingPositiveEnumoperator<<(PositiveEnum)
  • StreamingNegativeEnumoperator<<(NegativeEnum)
  • StreamingOrientationoperator<<(AnatomicalOrientation) (outputs space-separated term strings)
  • InvalidNegativeStringEncodingGetAsNegativeStringEncoding() on an INVALID orientation exercises the default branch of ConvertStringEncoding

Remaining 7 uncovered lines are dead-code guards (default: itkGenericExceptionMacro unreachable from a 3×3 matrix) and gcov static-init artifacts.

AI assistance
  • Tool: GitHub Copilot (Claude Sonnet 4.6)
  • Role: identified uncovered lines via gcovr, wrote and validated the five new test cases
  • All 9 AnatomicalOrientation tests pass locally against the coverage preset build

@github-actions github-actions Bot added type:Enhancement Improvement of existing methods or implementation 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 Jun 30, 2026
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:Enhancement Improvement of existing methods or implementation 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