Skip to content

Commit

Permalink
ENH: add filter progress overflow check
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Nov 16, 2021
1 parent 840bae7 commit fa8e5c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Modules/Core/Common/test/itkDataObjectAndProcessObjectTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ itkDataObjectAndProcessObjectTest(int, char *[])
process->UpdateProgress(0.0);
ITK_TEST_SET_GET_VALUE(0.0, process->GetProgress());

// verify no progress overflow
for (size_t i = 0; i < 10; ++i)
{
process->IncrementProgress(0.1);
}
if (!itk::Math::FloatAlmostEqual(process->GetProgress(), 1.0f))
{
std::cerr << "Progress is not reported correctly!" << std::endl;
return EXIT_FAILURE;
}

// shouldn't do anything: there is no output at this point
mtime = process->GetMTime();
process->Update();
Expand Down

0 comments on commit fa8e5c8

Please sign in to comment.