Fixed failing unit test in non-debug mode
parent
74f5ae0d1d
commit
ba7183e94c
|
@ -131,10 +131,9 @@ public:
|
||||||
* particular key, use find(), which has \f$ O(n) \f$ complexity. The
|
* particular key, use find(), which has \f$ O(n) \f$ complexity. The
|
||||||
* popLeaf function by itself has \f$ O(1) \f$ complexity.
|
* popLeaf function by itself has \f$ O(1) \f$ complexity.
|
||||||
*
|
*
|
||||||
* If the program calling this function is
|
* If gtsam is compiled without NDEBUG defined, this function will check that
|
||||||
* compiled without NDEBUG defined, this function will check that the node
|
* the node is indeed a leaf, but otherwise will not check, because the check
|
||||||
* is indeed a leaf, but otherwise will not check, because the check has
|
* has \f$ O(n^2) \f$ complexity.
|
||||||
* \f$ O(n^2) \f$ complexity.
|
|
||||||
*
|
*
|
||||||
* Example 1:
|
* Example 1:
|
||||||
\code
|
\code
|
||||||
|
|
|
@ -171,20 +171,20 @@ TEST_UNSAFE(SymbolicBayesNet, popLeaf) {
|
||||||
EXPECT(assert_equal(expected3, actual3));
|
EXPECT(assert_equal(expected3, actual3));
|
||||||
EXPECT(assert_equal(expected4, actual4));
|
EXPECT(assert_equal(expected4, actual4));
|
||||||
|
|
||||||
// Try to remove a non-leaf node
|
// Try to remove a non-leaf node (this test is not working in non-debug mode)
|
||||||
#undef NDEBUG_SAVED
|
//#undef NDEBUG_SAVED
|
||||||
#ifdef NDEBUG
|
//#ifdef NDEBUG
|
||||||
#define NDEBUG_SAVED
|
//#define NDEBUG_SAVED
|
||||||
#endif
|
//#endif
|
||||||
|
//
|
||||||
#undef NDEBUG
|
//#undef NDEBUG
|
||||||
SymbolicBayesNet actual5;
|
// SymbolicBayesNet actual5;
|
||||||
actual5 += A, B, C, D, E;
|
// actual5 += A, B, C, D, E;
|
||||||
CHECK_EXCEPTION(actual5.popLeaf(actual5.find(_D_)), std::invalid_argument);
|
// CHECK_EXCEPTION(actual5.popLeaf(actual5.find(_D_)), std::invalid_argument);
|
||||||
|
//
|
||||||
#ifdef NDEBUG_SAVED
|
//#ifdef NDEBUG_SAVED
|
||||||
#define NDEBUG
|
//#define NDEBUG
|
||||||
#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
Loading…
Reference in New Issue