From f76d26a0e2e3d221f7de0d47e6c849a0de4b089f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sat, 21 Jan 2023 08:56:03 -0500 Subject: [PATCH] ENH: Increase coverage for miscellaneous classes 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. --- Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx | 4 +++- Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx | 1 + .../test/itkSimpleImageRegistrationTest.cxx | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx index a952138e4c3..06fa660e725 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx @@ -18,6 +18,7 @@ #include "itkListSample.h" #include "itkKdTreeGenerator.h" +#include "itkTestingMacros.h" int itkKdTreeGeneratorTest(int, char *[]) @@ -44,7 +45,8 @@ itkKdTreeGeneratorTest(int, char *[]) using TreeGeneratorType = itk::Statistics::KdTreeGenerator; 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); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx index fbc1c9520f2..46aaeb3b1d5 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx @@ -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(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx index 1821341ade5..d3c207c3c5a 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx @@ -151,6 +151,10 @@ PerformSimpleImageRegistration(int argc, char * argv[]) using AffineRegistrationType = itk::ImageRegistrationMethodv4; auto affineSimple = AffineRegistrationType::New(); + + ITK_EXERCISE_BASIC_OBJECT_METHODS(affineSimple, ImageRegistrationMethodv4, ProcessObject); + + affineSimple->SetObjectName("affineSimple"); // Test exceptions