Skip to content
Snippets Groups Projects
Commit 3ac5feba authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

TEST: Adding try/catch and more output information

parent dac14d91
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,18 @@ int otbChangeLabelImageFilterTest(int argc, char * argv[]) ...@@ -65,8 +65,18 @@ int otbChangeLabelImageFilterTest(int argc, char * argv[])
OutputImageType::Pointer outputImage = filter->GetOutput(); OutputImageType::Pointer outputImage = filter->GetOutput();
filter->Update(); // Execute the filter
filter->SetFunctor(filter->GetFunctor()); try
{
filter->Update();
filter->SetFunctor(filter->GetFunctor());
}
catch(...)
{
std::cerr << "Caught an unexpected exception. " << std::endl;
std::cerr << "Test failed. " << std::endl;
return EXIT_FAILURE;
}
// Create an iterator for going through the image output // Create an iterator for going through the image output
InputIteratorType it( source->GetOutput(), source->GetOutput()->GetRequestedRegion() ); InputIteratorType it( source->GetOutput(), source->GetOutput()->GetRequestedRegion() );
...@@ -96,7 +106,12 @@ int otbChangeLabelImageFilterTest(int argc, char * argv[]) ...@@ -96,7 +106,12 @@ int otbChangeLabelImageFilterTest(int argc, char * argv[])
if ( !pass ) if ( !pass )
{ {
return EXIT_FAILURE; std::cerr << "Error in otbChangeLabelImageFilterTest " << std::endl;
std::cerr << " input = " << input;
std::cerr << " output = " << output;
std::cerr << std::endl;
return EXIT_FAILURE;
} }
++ot; ++ot;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment