Skip to content

Commit

Permalink
STYLE: Increase test argument check and ending message consistency
Browse files Browse the repository at this point in the history
Increase test argument check and ending message consistency:
- Remove the argument check where there are no input arguments other
  than the test name.
- Conform to ITK style guidelines in missing input argument and test
  ending message.
  • Loading branch information
jhlegarreta authored and dzenanz committed Sep 19, 2022
1 parent 66a9a27 commit 1b285b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 2 additions & 7 deletions Modules/IO/ImageBase/test/itkImageFileReaderTest1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@


int
itkImageFileReaderTest1(int argc, char * argv[])
itkImageFileReaderTest1(int itkNotUsed(argc), char * argv[])
{

if (argc < 1)
{
std::cout << "usage: ITKImageIOBaseTestDriver itkImageFileReaderTest" << std::endl;
return EXIT_FAILURE;
}

using ImageNDType = itk::Image<short, 2>;
using ReaderType = itk::ImageFileReader<ImageNDType>;

Expand All @@ -49,5 +43,6 @@ itkImageFileReaderTest1(int argc, char * argv[])
ITK_TRY_EXPECT_EXCEPTION(reader->Update());


std::cout << "Test finished." << std::endl;
return EXIT_SUCCESS;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ itkImageRegistrationSamplingTest(int, char *[])
{
ITK_TRY_EXPECT_EXCEPTION(registrationMethod->SetMetricSamplingPercentage(errorValue));
}


std::cout << "Test finished." << std::endl;
return EXIT_SUCCESS;
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ itkParallelSparseFieldLevelSetImageFilterTest(int argc, char * argv[])
{
if (argc < 2)
{
std::cerr << "Missing parameters." << std::endl;
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " OutputImage [InitImage [TargetImage]]\n";
return EXIT_FAILURE;
}
Expand Down Expand Up @@ -315,7 +316,6 @@ itkParallelSparseFieldLevelSetImageFilterTest(int argc, char * argv[])

std::cout << mf << std::endl << std::flush;

std::cout << "Passed !" << std::endl << std::flush;

std::cout << "Test finished." << std::endl;
return EXIT_SUCCESS;
}

0 comments on commit 1b285b5

Please sign in to comment.