Skip to content

Commit f64c293

Browse files
committed
Tests : Adapt for OpenEXR/Imath 3
1 parent 9bd2351 commit f64c293

11 files changed

+64
-13
lines changed

test/IECore/CompilerTest.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@
3939
#include "IECore/Export.h"
4040

4141
IECORE_PUSH_DEFAULT_VISIBILITY
42+
#include "OpenEXR/OpenEXRConfig.h"
43+
#if OPENEXR_VERSION_MAJOR < 3
4244
#include "OpenEXR/ImathBox.h"
4345
#include "OpenEXR/ImathVec.h"
44-
IECORE_POP_DEFAULT_VISIBILITY
45-
4646
#include "OpenEXR/ImathLineAlgo.h"
47+
#else
48+
#include "Imath/ImathBox.h"
49+
#include "Imath/ImathVec.h"
50+
#include "Imath/ImathLineAlgo.h"
51+
#endif
52+
IECORE_POP_DEFAULT_VISIBILITY
4753

4854
IECORE_PUSH_DEFAULT_VISIBILITY
4955
#include "boost/test/unit_test.hpp"

test/IECore/IECoreTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
#include "IECore/Export.h"
3636

3737
IECORE_PUSH_DEFAULT_VISIBILITY
38+
#include "OpenEXR/OpenEXRConfig.h"
39+
#if OPENEXR_VERSION_MAJOR < 3
3840
#include "OpenEXR/ImathColor.h"
41+
#else
42+
#include "Imath/ImathColor.h"
43+
#endif
3944
IECORE_POP_DEFAULT_VISIBILITY
4045

4146
#include <iostream>

test/IECore/InternedStringTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@
3636

3737
#include "IECore/InternedString.h"
3838

39+
#include "OpenEXR/OpenEXRConfig.h"
40+
#if OPENEXR_VERSION_MAJOR < 3
3941
#include "OpenEXR/ImathRandom.h"
42+
#else
43+
#include "Imath/ImathRandom.h"
44+
#endif
4045

4146
#include "boost/lexical_cast.hpp"
4247

test/IECore/InterpolatorTest.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,18 @@
3939
#include "IECore/Interpolator.h"
4040

4141
IECORE_PUSH_DEFAULT_VISIBILITY
42+
#include "OpenEXR/OpenEXRConfig.h"
43+
#if OPENEXR_VERSION_MAJOR < 3
4244
#include "OpenEXR/ImathMatrix.h"
45+
#include "OpenEXR/ImathMatrixAlgo.h"
4346
#include "OpenEXR/ImathVec.h"
47+
#else
48+
#include "Imath/ImathMatrix.h"
49+
#include "Imath/ImathMatrixAlgo.h"
50+
#include "Imath/ImathVec.h"
51+
#endif
4452
IECORE_POP_DEFAULT_VISIBILITY
4553

46-
#include "OpenEXR/ImathMatrixAlgo.h"
4754

4855
IECORE_PUSH_DEFAULT_VISIBILITY
4956
#include "boost/test/unit_test.hpp"

test/IECore/KDTreeTest.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,15 @@
3939
#include "IECore/KDTree.h"
4040

4141
IECORE_PUSH_DEFAULT_VISIBILITY
42+
#include "OpenEXR/OpenEXRConfig.h"
43+
#if OPENEXR_VERSION_MAJOR < 3
4244
#include "OpenEXR/ImathVec.h"
43-
IECORE_POP_DEFAULT_VISIBILITY
44-
4545
#include "OpenEXR/ImathRandom.h"
46+
#else
47+
#include "Imath/ImathVec.h"
48+
#include "Imath/ImathRandom.h"
49+
#endif
50+
IECORE_POP_DEFAULT_VISIBILITY
4651

4752
IECORE_PUSH_DEFAULT_VISIBILITY
4853
#include "boost/test/unit_test.hpp"

test/IECore/LevenbergMarquardtTest.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@
3939
#include "IECore/LevenbergMarquardt.h"
4040

4141
IECORE_PUSH_DEFAULT_VISIBILITY
42+
#include "OpenEXR/OpenEXRConfig.h"
43+
#if OPENEXR_VERSION_MAJOR < 3
44+
#include "OpenEXR/ImathRandom.h"
4245
#include "OpenEXR/ImathVec.h"
46+
#else
47+
#include "Imath/ImathRandom.h"
48+
#include "Imath/ImathVec.h"
49+
#endif
4350
IECORE_POP_DEFAULT_VISIBILITY
4451

45-
#include "OpenEXR/ImathRandom.h"
46-
4752
IECORE_PUSH_DEFAULT_VISIBILITY
4853
#include "boost/test/unit_test.hpp"
4954
IECORE_POP_DEFAULT_VISIBILITY

test/IECore/LevenbergMarquardtTest.inl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
//
3333
//////////////////////////////////////////////////////////////////////////
3434

35-
#include "OpenEXR/ImathMath.h"
36-
#include "OpenEXR/ImathRandom.h"
37-
3835
#include "boost/math/tools/rational.hpp"
3936

4037
using namespace IECore;
@@ -62,7 +59,7 @@ class LevenbergMarquardtTestSimple<T>::Fn
6259
for ( unsigned i = 1; i <= m_num; i ++ )
6360
{
6461
/// Distance between our guess and the real function
65-
errors->writable()[i-1] = Imath::Math<T>::fabs(
62+
errors->writable()[i-1] = std::abs(
6663
parameters->readable()[i-1] -
6764
i * i
6865
);
@@ -149,7 +146,7 @@ class LevenbergMarquardtTestPolynomialFit<T>::Fn
149146
T v2 = boost::math::tools::evaluate_polynomial<N, T, T>( m_coeffs, (T(i) / m_num - 0.5) * 10.0);
150147

151148
/// Distance between our guess and the real function
152-
errors->writable()[i] = Imath::Math<T>::fabs( v1 - v2 );
149+
errors->writable()[i] = std::abs( v1 - v2 );
153150
}
154151
}
155152

test/IECore/ParameterThreadingTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@
4242
#include "IECore/TypedObjectParameter.h"
4343
#include "IECore/VectorTypedParameter.h"
4444

45+
#include "OpenEXR/OpenEXRConfig.h"
46+
#if OPENEXR_VERSION_MAJOR < 3
4547
#include "OpenEXR/ImathRandom.h"
48+
#else
49+
#include "Imath/ImathRandom.h"
50+
#endif
4651

4752
#include "tbb/parallel_for.h"
4853

test/IECore/SpaceTransformTest.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@
4040
#include "IECore/SphericalToEuclideanTransform.h"
4141

4242
IECORE_PUSH_DEFAULT_VISIBILITY
43+
#include "OpenEXR/OpenEXRConfig.h"
44+
#if OPENEXR_VERSION_MAJOR < 3
4345
#include "OpenEXR/ImathVec.h"
46+
#include "OpenEXR/ImathRandom.h"
47+
#else
48+
#include "Imath/ImathVec.h"
49+
#include "Imath/ImathRandom.h"
50+
#endif
4451
IECORE_POP_DEFAULT_VISIBILITY
4552

46-
#include "OpenEXR/ImathRandom.h"
4753

4854
IECORE_PUSH_DEFAULT_VISIBILITY
4955
#include "boost/test/unit_test.hpp"

test/IECore/SweepAndPruneTest.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@
4343
#include "IECore/VectorTraits.h"
4444

4545
IECORE_PUSH_DEFAULT_VISIBILITY
46+
#include "OpenEXR/OpenEXRConfig.h"
47+
#if OPENEXR_VERSION_MAJOR < 3
4648
#include "OpenEXR/ImathBox.h"
4749
#include "OpenEXR/ImathVec.h"
50+
#else
51+
#include "Imath/ImathBox.h"
52+
#include "Imath/ImathVec.h"
53+
#endif
4854
IECORE_POP_DEFAULT_VISIBILITY
4955

5056
IECORE_PUSH_DEFAULT_VISIBILITY

0 commit comments

Comments
 (0)