Skip to content

Commit 395c8f4

Browse files
jhlegarretaN-Dekker
authored andcommitted
STYLE: Use the itkNameOfTestExecutableMacro macro in tests
Use the `itkNameOfTestExecutableMacro` macro to get the test name instead of hard-coding the test name. Left behind in 1fa53fe and in successive related commits.
1 parent 0595670 commit 395c8f4

22 files changed

+44
-22
lines changed

Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020

2121
#include "itkImageFileReader.h"
2222
#include "itkRGBPixel.h"
23+
#include "itkTestingMacros.h"
2324

2425
int
2526
itkImageToVTKImageFilterRGBTest(int argc, char * argv[])
2627
{
2728
if (argc != 2)
2829
{
2930
std::cerr << "Usage: ";
30-
std::cerr << argv[0];
31+
std::cerr << itkNameOfTestExecutableMacro(argv);
3132
std::cerr << " <InputFileName>";
3233
std::cerr << std::endl;
3334

Modules/Bridge/VtkGlue/test/itkVtkConnectedComponentImageFilterTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@
3737
#include <sstream>
3838
#include <map>
3939
#include "QuickView.h"
40+
#include "itkTestingMacros.h"
4041

4142
int
4243
itkVtkConnectedComponentImageFilterTest(int argc, char * argv[])
4344
{
4445
if (argc < 2)
4546
{
46-
std::cout << "Usage: " << argv[0];
47+
std::cout << "Usage: " << itkNameOfTestExecutableMacro(argv);
4748
std::cout << " inputImageFile";
4849
std::cerr << std::endl;
4950
return EXIT_FAILURE;

Modules/Bridge/VtkGlue/test/itkVtkMedianFilterTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <sstream>
2626

2727
#include "QuickView.h"
28+
#include "itkTestingMacros.h"
2829

2930
int
3031
itkVtkMedianFilterTest(int argc, char * argv[])
@@ -33,7 +34,7 @@ itkVtkMedianFilterTest(int argc, char * argv[])
3334
if (argc < 2)
3435
{
3536
std::cerr << "Usage: " << std::endl;
36-
std::cerr << argv[0] << " InputImageFile [radius]" << std::endl;
37+
std::cerr << itkNameOfTestExecutableMacro(argv) << " InputImageFile [radius]" << std::endl;
3738
return EXIT_FAILURE;
3839
}
3940
std::string inputFilename = argv[1];

Modules/Core/Common/test/itkDownCastTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
#include "itkDynamicLoader.h"
27+
#include "itkTestingMacros.h"
2728

2829
using PRODUCER_FUNCTION = itk::Object * (*)();
2930
using DYNAMIC_DOWNCAST_FUNCTION = int (*)(const char * type, const char * instanceSource, itk::Object const * base);
@@ -33,7 +34,7 @@ itkDownCastTest(int argc, char * argv[])
3334
{
3435
if (argc < 2)
3536
{
36-
std::cerr << "Usage: " << argv[0] << " <LibraryBFilePath>" << std::endl;
37+
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " <LibraryBFilePath>" << std::endl;
3738
return EXIT_SUCCESS;
3839
}
3940

Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "itkFFTWComplexToComplexFFTImageFilter.h"
4242
#include "itkFFTWForwardFFTImageFilter.h"
4343
#include "itkFFTWInverseFFTImageFilter.h"
44+
#include "itkTestingMacros.h"
4445

4546
template <typename TPixel, unsigned int VDimension>
4647
int
@@ -99,7 +100,8 @@ itkFFTWComplexToComplexFFTImageFilterTest(int argc, char * argv[])
99100
{
100101
if (argc < 4)
101102
{
102-
std::cerr << "Usage: " << argv[0] << " <InputImage> <OutputImage> <float|double>" << std::endl;
103+
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " <InputImage> <OutputImage> <float|double>"
104+
<< std::endl;
103105
return EXIT_FAILURE;
104106
}
105107
const char * inputImageFileName = argv[1];

Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ itkForward1DFFTImageFilterTest(int argc, char * argv[])
7474
if (argc < 3)
7575
{
7676
std::cerr << "Missing Parameters." << std::endl;
77-
std::cerr << "Usage: " << argv[0];
77+
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv);
7878
std::cerr << " inputImage outputImagePrefix [backend]" << std::endl;
7979
std::cerr << "backend implementation options:" << std::endl;
8080
std::cerr << " 0 default" << std::endl;

Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOOrientationTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#include "itkSubtractImageFilter.h"
2626

2727
#include "itkPhilipsRECImageIO.h"
28+
#include "itkTestingMacros.h"
2829

2930
int
3031
itkPhilipsRECImageIOOrientationTest(int argc, char * argv[])
3132
{
3233

3334
if (argc < 4)
3435
{
35-
std::cerr << "Usage: " << argv[0] << " ReferenceImage TargetImage ";
36+
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " ReferenceImage TargetImage ";
3637
std::cerr << "OutputImage" << std::endl;
3738
return EXIT_FAILURE;
3839
}

Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOPrintTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121

2222
#include <vxl_version.h>
2323
#include "vnl/vnl_vector_fixed.h"
24+
#include "itkTestingMacros.h"
2425

2526
int
2627
itkPhilipsRECImageIOPrintTest(int argc, char * argv[])
2728
{
2829

2930
if (argc < 2)
3031
{
31-
std::cerr << "Usage: " << argv[0] << " InputImage" << std::endl;
32+
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " InputImage" << std::endl;
3233
return EXIT_FAILURE;
3334
}
3435

Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
#include "itkImageFileWriter.h"
2121

2222
#include "itkPhilipsRECImageIOFactory.h"
23+
#include "itkTestingMacros.h"
2324

2425
int
2526
itkPhilipsRECImageIOTest(int argc, char * argv[])
2627
{
2728

2829
if (argc < 3)
2930
{
30-
std::cerr << "Usage: " << argv[0] << " InputImage OutputImage" << std::endl;
31+
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " InputImage OutputImage" << std::endl;
3132
return EXIT_FAILURE;
3233
}
3334

Modules/Nonunit/IntegratedTest/test/itkBioRadImageIOTest.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "itkImageFileWriter.h"
2020
#include "itkBioRadImageIO.h"
2121
#include "itkImage.h"
22+
#include "itkTestingMacros.h"
2223

2324
// Specific ImageIO test
2425

@@ -27,7 +28,7 @@ itkBioRadImageIOTest(int argc, char * argv[])
2728
{
2829
if (argc < 3)
2930
{
30-
std::cerr << "Usage: " << argv[0] << " BioRad.pic OutputImage.pic\n";
31+
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " BioRad.pic OutputImage.pic\n";
3132
return EXIT_FAILURE;
3233
}
3334

0 commit comments

Comments
 (0)