Skip to content
Snippets Groups Projects
Commit cc9ec248 authored by Menno Deij - van Rijswijk's avatar Menno Deij - van Rijswijk
Browse files

Minor changes to get rid of -Wunused and -Wformat compiler warnings

parent f47a0534
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@
int TestPolyhedron2( int argc, char* argv[] )
{
if (argc < 3) return 1; // test not run with data on the command line
const char* filename = argv[2];
vtkNew<vtkXMLUnstructuredGridReader> reader;
reader->SetFileName(filename);
......@@ -48,7 +49,7 @@ int TestPolyhedron2( int argc, char* argv[] )
vtkPolyData* output = vtkPolyData::SafeDownCast(cutter->GetOutputDataObject(0));
if (output->GetNumberOfCells() != 2)
{
printf("Expected 2 but found %d cells in intersected polyhedron\n", output->GetNumberOfCells());
std::cout << "Expected 2 but found " << output->GetNumberOfCells() << " in intersected polyhedron." << std::endl;
return 1;
}
......
......@@ -41,8 +41,15 @@ const char inputDataStream[] =
"42\n";
// Test of contour/clip of vtkPolyhedron. uses input from http://www.vtk.org/Bug/view.php?id=15026
int TestPolyhedron3( int argc, char* argv[] )
int TestPolyhedron3(int argc, char **argv)
{
// the next two lines are only in the test to get rid of compiler warnings
// I cannot make the function without the parameters, because that is what
// is expected. At the same time, I also can't not reference them, because
// that give a warning.
if (argc < 0 && argc > 0) return 1; // reference one formal parameter
if (!argv && argv) return 1; // reference another formal parameter
vtkNew<vtkUnstructuredGridReader> reader;
reader->SetInputString(inputDataStream);
reader->ReadFromInputStringOn();
......@@ -60,14 +67,14 @@ int TestPolyhedron3( int argc, char* argv[] )
if (!result) return 1;
if (result->GetNumberOfCells() != 1)
{
printf("Expected 1 but found %d cells in intersected polyhedron\n", result->GetNumberOfCells());
std::cout << "Expected 1 but found " << result->GetNumberOfCells() << " cells in intersected polyhedron" << std::endl;
return 1;
}
vtkCell* clipped = result->GetCell(0);
if (!clipped) return 1;
if (clipped->GetNumberOfFaces() != 7)
{
printf("Expected 7 but found %d cell faces in intersected polyhedron\n", clipped->GetNumberOfFaces());
std::cout << "Expected 7 but found " << result->GetNumberOfCells() << " cells in intersected polyhedron" << std::endl;
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment