Skip to content

Commit 1b285b5

Browse files
jhlegarretadzenanz
authored andcommitted
STYLE: Increase test argument check and ending message consistency
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.
1 parent 66a9a27 commit 1b285b5

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

Modules/IO/ImageBase/test/itkImageFileReaderTest1.cxx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@
2121

2222

2323
int
24-
itkImageFileReaderTest1(int argc, char * argv[])
24+
itkImageFileReaderTest1(int itkNotUsed(argc), char * argv[])
2525
{
2626

27-
if (argc < 1)
28-
{
29-
std::cout << "usage: ITKImageIOBaseTestDriver itkImageFileReaderTest" << std::endl;
30-
return EXIT_FAILURE;
31-
}
32-
3327
using ImageNDType = itk::Image<short, 2>;
3428
using ReaderType = itk::ImageFileReader<ImageNDType>;
3529

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

5145

46+
std::cout << "Test finished." << std::endl;
5247
return EXIT_SUCCESS;
5348
}

Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@ itkImageRegistrationSamplingTest(int, char *[])
4343
{
4444
ITK_TRY_EXPECT_EXCEPTION(registrationMethod->SetMetricSamplingPercentage(errorValue));
4545
}
46+
47+
48+
std::cout << "Test finished." << std::endl;
4649
return EXIT_SUCCESS;
4750
}

Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ itkParallelSparseFieldLevelSetImageFilterTest(int argc, char * argv[])
221221
{
222222
if (argc < 2)
223223
{
224+
std::cerr << "Missing parameters." << std::endl;
224225
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " OutputImage [InitImage [TargetImage]]\n";
225226
return EXIT_FAILURE;
226227
}
@@ -315,7 +316,6 @@ itkParallelSparseFieldLevelSetImageFilterTest(int argc, char * argv[])
315316

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

318-
std::cout << "Passed !" << std::endl << std::flush;
319-
319+
std::cout << "Test finished." << std::endl;
320320
return EXIT_SUCCESS;
321321
}

0 commit comments

Comments
 (0)