Skip to content

Commit

Permalink
STYLE: Check test input arguments at the beginning
Browse files Browse the repository at this point in the history
Check the test input arguments at the beginning to conform to the ITK SW
Guide style guidelines.
  • Loading branch information
jhlegarreta authored and dzenanz committed Apr 16, 2022
1 parent a1dcb9e commit 7462c48
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
int
itkVTKPolyDataIOQuadEdgeMeshTest(int argc, char * argv[])
{
if (argc != 3)
{
std::cerr << "Missing parameters." << std::endl;
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " inputFilename outputFilename" << std::endl;
return EXIT_FAILURE;
}

using MeshType = itk::QuadEdgeMesh<float, 3>;
using ReaderType = itk::VTKPolyDataReader<MeshType>;
Expand All @@ -34,16 +40,8 @@ itkVTKPolyDataIOQuadEdgeMeshTest(int argc, char * argv[])
auto polyDataReader = ReaderType::New();
auto polyDataWriter = WriterType::New();

if (argc != 3)
{
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " inputFilename outputFilename" << std::endl;
return EXIT_FAILURE;
}
else
{
polyDataReader->SetFileName(argv[1]);
polyDataWriter->SetFileName(argv[2]);
}
polyDataReader->SetFileName(argv[1]);
polyDataWriter->SetFileName(argv[2]);

std::cout << "polyDataReader:" << std::endl;
std::cout << polyDataReader << std::endl;
Expand Down

0 comments on commit 7462c48

Please sign in to comment.