Skip to content

Commit

Permalink
COMP: Add test to ensure correct command line length.
Browse files Browse the repository at this point in the history
Prefer to test input values are correct rather than
ignore the unused variable.
  • Loading branch information
hjmjohnson committed Apr 13, 2024
1 parent d6c6382 commit 1938221
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Modules/IO/ImageBase/test/itkImageFileReaderTest1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
int
itkImageFileReaderTest1(int argc, char * argv[])
{

ITK_TEST_EXPECT_TRUE(argc == 1);
using ImageNDType = itk::Image<short, 2>;
using ReaderType = itk::ImageFileReader<ImageNDType>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ class CommandIterationUpdate : public itk::Command

template <unsigned int TDimension>
int
PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[])
PerformBSplineSyNImageRegistration(int argc, char * argv[])
{
ITK_TEST_EXPECT_TRUE(argc == 4);
const unsigned int ImageDimension = TDimension;

using PixelType = double;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ template <unsigned int TDimension>
int
PerformCompositeImageRegistration(int argc, char * argv[])
{
if (argc != 4)
if (argc != 5)
{
std::cout << "ERROR: incorrect number of arguments" << std::endl;
return EXIT_FAILURE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ class CommandIterationUpdate : public itk::Command

template <unsigned int TDimension>
int
ImageRegistration(int itkNotUsed(argc), char * argv[])
ImageRegistration(int argc, char * argv[])
{
ITK_TEST_EXPECT_TRUE(argc == 4);
const unsigned int ImageDimension = TDimension;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ template <unsigned int TDimension>
int
PerformDisplacementFieldImageRegistration(int argc, char * argv[])
{
if (argc != 4)
if (argc != 5)
{
std::cout << "ERROR: incorrect number of arguments" << std::endl;
return EXIT_FAILURE;
Expand Down

0 comments on commit 1938221

Please sign in to comment.