Skip to content

Commit

Permalink
ENH: Increase coverage for miscellaneous classes
Browse files Browse the repository at this point in the history
Increase coverage for miscellaneous classes:
- Exercise basic object methods using the
  `ITK_EXERCISE_BASIC_OBJECT_METHODS` macro. Remove redundant calls to
  print the filter: rely on the basic method exercising macro call.
  • Loading branch information
jhlegarreta authored and dzenanz committed Jan 25, 2023
1 parent c18588b commit f76d26a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx
Expand Up @@ -18,6 +18,7 @@

#include "itkListSample.h"
#include "itkKdTreeGenerator.h"
#include "itkTestingMacros.h"

int
itkKdTreeGeneratorTest(int, char *[])
Expand All @@ -44,7 +45,8 @@ itkKdTreeGeneratorTest(int, char *[])
using TreeGeneratorType = itk::Statistics::KdTreeGenerator<SampleType>;
auto treeGenerator = TreeGeneratorType::New();

std::cout << "KdTreeGenerator class name: " << treeGenerator->GetNameOfClass() << std::endl;
ITK_EXERCISE_BASIC_OBJECT_METHODS(treeGenerator, KdTreeGenerator, Object);


treeGenerator->SetSample(sample);
treeGenerator->SetBucketSize(16);
Expand Down
1 change: 1 addition & 0 deletions Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx
Expand Up @@ -67,6 +67,7 @@ itkKdTreeTest1(int argc, char * argv[])
const unsigned int bucketSize = std::stoi(argv[3]);

treeGenerator->SetSample(sample);

treeGenerator->SetBucketSize(bucketSize);
treeGenerator->Update();

Expand Down
Expand Up @@ -151,6 +151,10 @@ PerformSimpleImageRegistration(int argc, char * argv[])

using AffineRegistrationType = itk::ImageRegistrationMethodv4<FixedImageType, MovingImageType>;
auto affineSimple = AffineRegistrationType::New();

ITK_EXERCISE_BASIC_OBJECT_METHODS(affineSimple, ImageRegistrationMethodv4, ProcessObject);


affineSimple->SetObjectName("affineSimple");

// Test exceptions
Expand Down

0 comments on commit f76d26a

Please sign in to comment.