[Insight-developers] ITK IO test failures on the Mac

Brad King brad . king at kitware . com
Tue, 26 Aug 2003 14:14:11 -0400 (EDT)


Hello,

I just investigated the failing IO tests, and was not surprised to find
the problem is the same as that which occurred in VTK in the past. The
problem is that ifstream's fail() method reports failure if the stream has
just read TO the end of the file instead of when one attempts to read PAST
the end of the file.  The fix is to use the gcount() method to check that
the amount read was the amount expected instead of depending on fail().
I'm working on fixing all the tests.

One thing that made the bug take longer to find is that itkGEImageIOTest
catches exceptions without reporting them:

  catch (itk::ExceptionObject e)
    {
    return Failmode ? 1 : 0;
    }

Normally the test driver will report exceptions.  I'm guessing this code
is to allow testing expected failure, but I think it should still report
the contents of the exception.  Can anyone comment on this?

Thanks,
-Brad