Skip to content

Commit

Permalink
Ensure tests have assert when building in a release mode
Browse files Browse the repository at this point in the history
Fixes warnings and makes sure tests are ... testing

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Jul 23, 2019
1 parent a5fbf7d commit fe93c2c
Show file tree
Hide file tree
Showing 101 changed files with 348 additions and 38 deletions.
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testSize.h>
#include <testArithmetic.h>
#include <testError.h>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testArithmetic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testArithmetic.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testBitPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBitPatterns.h>
#include "half.h"
#include <float.h>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testClassification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testClassification.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testError.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFunction.h>
#include "halfFunction.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testLimits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testLimits.h>
#include "halfLimits.h"
#include <iostream>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/HalfTest/testSize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// Copyright Contributors to the OpenEXR Project.
//

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testSize.h>
#include "half.h"
#include <iostream>
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/IexTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBaseExc.h>

Expand Down
4 changes: 3 additions & 1 deletion IlmBase/IexTest/testBaseExc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBaseExc.h>
#include <Iex.h>
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/IlmThread/IlmThreadSemaphorePosix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ Semaphore::Semaphore (unsigned int value)

Semaphore::~Semaphore ()
{
#ifdef NDEBUG
::sem_destroy (&_semaphore);
#else
int error = ::sem_destroy (&_semaphore);
assert (error == 0);
#endif
}


Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testVec.h>
#include <testRoots.h>
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBoxAlgo.h>
#include "ImathBoxAlgo.h"
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testBoxAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testBoxAlgo.h>
#include "ImathBoxAlgo.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testColor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testColor.h>
#include "ImathColor.h"
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testExtractEuler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testExtractEuler.h>
#include "ImathMatrixAlgo.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testExtractSHRT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testExtractSHRT.h>
#include "ImathMatrixAlgo.h"
Expand Down Expand Up @@ -443,4 +446,3 @@ testExtractSHRT ()
cerr << " Caught exception: " << e.what () << endl;
}
}

4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testFrustum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFrustum.h>
#include "ImathFrustum.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testFrustumTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFrustumTest.h>
#include "ImathFrustum.h"
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testFun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testFun.h>
#include "ImathFun.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testInvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testInvert.h>
#include "ImathMatrix.h"
Expand Down
6 changes: 4 additions & 2 deletions IlmBase/ImathTest/testJacobiEigenSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include "ImathMatrix.h"
#include "ImathMatrixAlgo.h"
#include <iostream>
Expand Down Expand Up @@ -309,5 +313,3 @@ testJacobiEigenSolver()

cout << "************ ALL PASS ************" << endl;
}


3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testLineAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testLineAlgo.h>
#include "ImathLineAlgo.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testMatrix.h>
#include "ImathMatrix.h"
Expand Down
5 changes: 3 additions & 2 deletions IlmBase/ImathTest/testMiscMatrixAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testMiscMatrixAlgo.h>
#include "ImathMatrixAlgo.h"
Expand Down Expand Up @@ -337,5 +340,3 @@ testMiscMatrixAlgo ()
cerr << " Caught exception: " << e.what () << endl;
}
}


6 changes: 4 additions & 2 deletions IlmBase/ImathTest/testProcrustes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include "ImathMatrixAlgo.h"
#include "ImathRandom.h"
#include "ImathEuler.h"
Expand Down Expand Up @@ -398,5 +402,3 @@ testProcrustes ()
std::cout << "Testing Procrustes algorithms in double precision..." << std::endl;
testProcrustesImp<double>();
}


3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testQuat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testQuat.h>
#include "ImathQuat.h"
Expand Down
3 changes: 3 additions & 0 deletions IlmBase/ImathTest/testQuatSetRotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testQuatSetRotation.h>
#include "ImathQuat.h"
Expand Down
4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testQuatSlerp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testQuatSlerp.h>
#include "ImathQuat.h"
Expand Down Expand Up @@ -197,4 +200,3 @@ testQuatSlerp ()

cout << "ok\n" << endl;
}

4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testRandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testRandom.h>
#include "ImathRandom.h"
Expand Down
6 changes: 3 additions & 3 deletions IlmBase/ImathTest/testRoots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testRoots.h>
#include "ImathRoots.h"
Expand Down Expand Up @@ -256,5 +258,3 @@ testRoots ()
solve (3, -6, 30, 0, 0, 0); // real solutions: none
cout << "ok\n" << endl;
}


4 changes: 3 additions & 1 deletion IlmBase/ImathTest/testShear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
//
///////////////////////////////////////////////////////////////////////////


#ifdef NDEBUG
# undef NDEBUG
#endif

#include <testShear.h>
#include "ImathShear.h"
Expand Down
5 changes: 4 additions & 1 deletion IlmBase/ImathTest/testTinySVD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
//
///////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG
# undef NDEBUG
#endif

#include "ImathMatrixAlgo.h"
#include <iostream>
#include <assert.h>
Expand Down Expand Up @@ -357,4 +361,3 @@ testTinySVD ()
std::cout << "Testing TinySVD algorithms in double precision..." << std::endl;
testTinySVDImp<double>();
}

Loading

0 comments on commit fe93c2c

Please sign in to comment.