[Insight-developers] CastImageFilterTest failures

Cory Quammen cquammen at cs.unc.edu
Fri Jun 3 09:48:59 EDT 2011


Bill,

This is a very strange problem on some systems. Somehow, the
static_cast in the Cast functor in itkCastImageFilter.h produces
different results than the static_cast in my test when casting from
float to int.

Basically, if you have

int a = ...;
float b = ...;

b = static_cast< float >( a );
b == static_cast< float >( a );

the equality test in the last line of code can be false! This
frightens and confuses me.

My last change to the test fixed the error on MSVC by storing the
static_cast result in a temporary variable and then doing an equality
test between the temporary to the output of the CastImageFilter, but
it obviously didn't fix it everywhere.

I have no idea why the test is failing. Maybe one of the static_casts
is casting from a higher-precision register than the other. I've
Googled for similar problems reported elsewhere, but haven't found
anything yet.

For now, should I disable the float-to-int cast test to make the
dashboard green?

I have no idea why the test seems to be completely failing on SunOS.

Gaetan,

I'd be grateful if you could run the CastImageFilterTest in a debugger
and send me the stack trace when it segfaults. To minimize the time
you spend on this, the commands should be:

cd $ITK_BUILD
gdb bin/ITK-ImageFilterBaseTestDriver
r itkCastImageFilterTest

Thanks,
Cory


On Fri, Jun 3, 2011 at 8:35 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Cory,
>
> CastImageFilterTest is failing on 3 platforms:
> http://www.cdash.org/CDash/testSummary.php?project=2&name=itkCastImageFilterTest&date=2011-06-03
>
> The two linux platforms are failing on
> Casting from int to float ... [FAILED]
>
> The Sun system is seg faulting.
>
> Bill
>



-- 
Cory Quammen
Computer Integrated Systems for Microscopy and Manipulation (CISMM)
Department of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~cquammen


More information about the Insight-developers mailing list