diff --git a/gtsam/inference/BayesNet.h b/gtsam/inference/BayesNet.h index f79065e9d..065b49c20 100644 --- a/gtsam/inference/BayesNet.h +++ b/gtsam/inference/BayesNet.h @@ -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 diff --git a/gtsam/inference/tests/testSymbolicBayesNet.cpp b/gtsam/inference/tests/testSymbolicBayesNet.cpp index 628770456..0d81d1588 100644 --- a/gtsam/inference/tests/testSymbolicBayesNet.cpp +++ b/gtsam/inference/tests/testSymbolicBayesNet.cpp @@ -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 } /* ************************************************************************* */