Fixed failing unit test in non-debug mode

release/4.3a0
Richard Roberts 2011-10-03 19:09:45 +00:00
parent 74f5ae0d1d
commit ba7183e94c
2 changed files with 17 additions and 18 deletions

View File

@ -131,10 +131,9 @@ public:
* particular key, use find(), which has \f$ O(n) \f$ complexity. The
* popLeaf function by itself has \f$ O(1) \f$ complexity.
*
* If the program calling this function is
* compiled without NDEBUG defined, this function will check that the node
* is indeed a leaf, but otherwise will not check, because the check has
* \f$ O(n^2) \f$ complexity.
* If gtsam is compiled without NDEBUG defined, this function will check that
* the node is indeed a leaf, but otherwise will not check, because the check
* has \f$ O(n^2) \f$ complexity.
*
* Example 1:
\code

View File

@ -171,20 +171,20 @@ TEST_UNSAFE(SymbolicBayesNet, popLeaf) {
EXPECT(assert_equal(expected3, actual3));
EXPECT(assert_equal(expected4, actual4));
// Try to remove a non-leaf node
#undef NDEBUG_SAVED
#ifdef NDEBUG
#define NDEBUG_SAVED
#endif
#undef NDEBUG
SymbolicBayesNet actual5;
actual5 += A, B, C, D, E;
CHECK_EXCEPTION(actual5.popLeaf(actual5.find(_D_)), std::invalid_argument);
#ifdef NDEBUG_SAVED
#define NDEBUG
#endif
// Try to remove a non-leaf node (this test is not working in non-debug mode)
//#undef NDEBUG_SAVED
//#ifdef NDEBUG
//#define NDEBUG_SAVED
//#endif
//
//#undef NDEBUG
// SymbolicBayesNet actual5;
// actual5 += A, B, C, D, E;
// CHECK_EXCEPTION(actual5.popLeaf(actual5.find(_D_)), std::invalid_argument);
//
//#ifdef NDEBUG_SAVED
//#define NDEBUG
//#endif
}
/* ************************************************************************* */