Skip to content

Commit

Permalink
STYLE: Increase test style consistency
Browse files Browse the repository at this point in the history
Increase test style consistency:
- Check the test input arguments at the beginning to conform to the ITK SW
Guide style guidelines. Take advantage of the commit to make the
argument check message consistent with the ITK SW Guide style
guidelines.
- Prefer using `constexpr <type>` to define compile-time constant values.
  • Loading branch information
jhlegarreta authored and dzenanz committed Jun 10, 2022
1 parent 10c5475 commit 3887bee
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,23 @@ int
itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[])
{

using PixelType = unsigned char;
enum
if (argc < 2)
{
ImageDimension = 2
};
std::cerr << "Missing parametes." << std::endl;
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " WarpedImage" << std::endl;
return EXIT_FAILURE;
}

constexpr unsigned int ImageDimension = 2;
using PixelType = unsigned char;

using ImageType = itk::Image<PixelType, ImageDimension>;
using VectorType = itk::Vector<float, ImageDimension>;
using FieldType = itk::Image<VectorType, ImageDimension>;
using IndexType = ImageType::IndexType;
using SizeType = ImageType::SizeType;
using RegionType = ImageType::RegionType;

if (argc < 2)
{
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " WarpedImage\n";
return EXIT_FAILURE;
}

//--------------------------------------------------------
std::cout << "Generate input images and initial field";
std::cout << std::endl;
Expand Down

0 comments on commit 3887bee

Please sign in to comment.