Skip to content

BUG: Name the real superclass in ITK_EXERCISE_BASIC_OBJECT_METHODS calls - #59

Closed
hjmjohnson wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:fix-test-superclass-names
Closed

hjmjohnson wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:fix-test-superclass-names

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Three module tests fail identically against ITK main and release-5.4 because their ITK_EXERCISE_BASIC_OBJECT_METHODS calls name a superclass that is not the object's direct superclass; the macro compares Superclass::GetNameOfClass() with the third argument. This corrects the nine such calls (the three failing tests plus three latent mismatches in itkFeatureAggregatorTest1, which only builds with TEST_CORNELL_DATA_ROOT).

Each correction
Test Class Named Actual superclass
itkDescoteauxSheetnessFeatureGeneratorMultiScaleTest1 MaximumFeatureAggregator UnaryFunctorImageFilter FeatureAggregator
itkLesionSegmentationMethodTest10 LesionSegmentationMethod LightObject ProcessObject
itkSatoVesselnessSigmoidFeatureGeneratorMultiScaleTest1 (×4) SatoVesselnessSigmoidFeatureGenerator FeatureGenerator SatoVesselnessFeatureGenerator
itkFeatureAggregatorTest1 SatoVesselnessSigmoidFeatureGenerator FeatureAggregator SatoVesselnessFeatureGenerator
itkFeatureAggregatorTest1 LungWallFeatureGenerator FeatureAggregator FeatureGenerator
itkFeatureAggregatorTest1 SigmoidFeatureGenerator FeatureAggregator FeatureGenerator

Found by comparing every macro call's third argument against the : public base in the matching header; every other call in test/ already matches.

Test plan

Each corrected name was checked against the : public base in the class header. The four test sources compile against ITK main (clang, Release, macOS arm64). The tests themselves could not be run here: itkDescoteauxSheetnessFeatureGeneratorMultiScaleTest1 and itkSatoVesselnessSigmoidFeatureGeneratorMultiScaleTest1 are registered only under if(TEST_CORNELL_DATA_ROOT), itkLesionSegmentationMethodTest10 is compiled but never registered, and on GCC and clang ITK_EXERCISE_BASIC_OBJECT_METHODS prints the names without comparing them (itkTestingMacros.h, #if defined(__GNUC__)). The comparison runs on MSVC.

ITK_EXERCISE_BASIC_OBJECT_METHODS compares Superclass::GetNameOfClass()
with the stringified third argument and fails the test on a mismatch.
Nine calls named a class that is not the object's direct superclass:

- MaximumFeatureAggregator derives from FeatureAggregator, not
  UnaryFunctorImageFilter (itkDescoteauxSheetnessFeatureGeneratorMultiScaleTest1).
- LesionSegmentationMethod derives from ProcessObject, not LightObject
  (itkLesionSegmentationMethodTest10).
- SatoVesselnessSigmoidFeatureGenerator derives from
  SatoVesselnessFeatureGenerator, not FeatureGenerator
  (itkSatoVesselnessSigmoidFeatureGeneratorMultiScaleTest1, four calls;
  itkFeatureAggregatorTest1, one call).
- LungWallFeatureGenerator and SigmoidFeatureGenerator derive from
  FeatureGenerator, not FeatureAggregator (itkFeatureAggregatorTest1).

The first three tests fail identically against ITK main and ITK
release-5.4 in the downstream build matrix. itkFeatureAggregatorTest1 is
only built when TEST_CORNELL_DATA_ROOT is set, so its three mismatches
were latent.
@hjmjohnson
hjmjohnson marked this pull request as ready for review October 7, 2026 18:07
@hjmjohnson

Copy link
Copy Markdown
Member Author

Superceeded.

@hjmjohnson hjmjohnson closed this Oct 8, 2026
@hjmjohnson hjmjohnson mentioned this pull request Oct 8, 2026
@hjmjohnson

Copy link
Copy Markdown
Member Author

Superseded by #61, which carries this change as e98d801 ("BUG: Name the real superclass in ITK_EXERCISE_BASIC_OBJECT_METHODS calls", the same nine corrections) together with the other fixes CI needs before these tests can run on every platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant