openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] ImathTest failures


From: Darrin Cardani
Subject: [Openexr-devel] ImathTest failures
Date: Fri, 20 Aug 2004 16:25:45 -0500

As mentioned earlier, I'm building the OpenEXR source for Windows using CodeWarrior Pro 8.3 on Mac OS X. I'm seeing 2 odd failures with ImathTest. The first is pretty serious. Imath::floor<float> doesn't appear to be behaving correctly. Line 97 of testFun.cpp looks like this:

assert (Imath::floor (-0.5f) == -1);

I get an assertion there. That function looks like this:

template <class T>
inline int
floor (T x)
{
    return (x >= 0)? int (x): -(int (-x) + (-x > int (-x)));
}

It turns out that the last part of that statement (-x > int (-x)) is not being evaluated properly in my build. For -0.5, the result of that comparison is 0 rather than 1. If I rewrite the function like this:

template <class T>
inline int
floor (T x)
{
    if (x >= 0) {
        return int (x);
    } else {
        int     iNegX   = int (-x);
        T       negX    = -x;
        int     result  = 0;
        if (negX > iNegX) {
                result = 1;
        }
        return -(iNegX + result);
    }
}

it returns the correct result and passes the test, though.

The other problem I'm seeing is similar to Daniel Fort's problem, where the Euler Angle Extraction tests are failing. However, unlike in Daniel's case, I am getting seriously large error values (like -0.0926975, -1.92239, etc.).

I noticed that some of the #defines for Windows weren't defined in my build, so I defined them by hand and rebuilt. Also, some of the STL #defines weren't defined, despite the fact that I have the functions in question. (Things like HAVE_IOS_BASE.) This is probably just a Metrowerks issue. Defining them and rebuilding succeeded, however, it didn't solve the test failures.

I don't know much about how Euler angles are calculated, so I don't feel confident debugging this problem myself. Would it be OK if I ran the tests that Florian recommended to Daniel and post the results of a few of the failures here?

Thanks,
Darrin
--
Darrin Cardani - address@hidden
President, Buena Software, Inc.
<http://www.buena.com/>
Video, Image and Audio Processing Development




reply via email to

[Prev in Thread] Current Thread [Next in Thread]