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

Lorensen, William E (Research) lorensen at crd . ge . com
Tue, 26 Aug 2003 14:26:32 -0400


It should print the exception. I agree.

-----Original Message-----
From: Brad King [mailto:brad . king at kitware . com]
Sent: Tuesday, August 26, 2003 2:14 PM
To: Insight Developers
Cc: Bill Lorensen; Jim Miller; Bill Hoffman; Luis Ibanez
Subject: ITK IO test failures on the Mac


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