From 993991eade7dd0574d03680ff8c6cda81cf5d968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Feb 2024 13:16:48 +0100 Subject: [PATCH] turn warning messages in errors for the testsuite --- CGAL_Core/include/CGAL/CORE/BigFloat_impl.h | 2 +- CGAL_Core/include/CGAL/CORE/Config.h | 7 +++++++ CGAL_Core/include/CGAL/CORE/ExprRep.h | 6 +++--- CGAL_Core/include/CGAL/CORE/Expr_impl.h | 6 +++--- CGAL_Core/include/CGAL/CORE/Filter.h | 4 ++-- CGAL_Core/include/CGAL/CORE/MemoryPool.h | 2 +- CGAL_Core/include/CGAL/CORE/extLong.h | 2 +- CGAL_Core/include/CGAL/CORE/extLong_impl.h | 12 ++++++------ CGAL_Core/include/CGAL/CORE/poly/Curves.tcc | 2 +- CGAL_Core/include/CGAL/CORE/poly/Poly.tcc | 2 +- CGAL_Core/include/CGAL/CORE/poly/Sturm.h | 2 +- 11 files changed, 27 insertions(+), 20 deletions(-) diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h index 32683de7a2c..b6eb9054c8e 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h @@ -819,7 +819,7 @@ BigFloatRep::toDecimal(unsigned int width, bool Scientific) const { if (err > 0 && err >= abs(m)) { // if err is larger than mantissa, sign and significant values // can not be determined. - CGAL_warning_msg(true, "BigFloat error: Error is too big!"); + CGAL_CORE_warning_msg(true, "BigFloat error: Error is too big!"); decOut.rep = "0.0e0"; // error is too big decOut.isScientific = false; decOut.noSignificant = 0; diff --git a/CGAL_Core/include/CGAL/CORE/Config.h b/CGAL_Core/include/CGAL/CORE/Config.h index b85ddbf5538..d55b5edfcb9 100644 --- a/CGAL_Core/include/CGAL/CORE/Config.h +++ b/CGAL_Core/include/CGAL/CORE/Config.h @@ -29,4 +29,11 @@ #include +#ifdef CGAL_TEST_SUITE +#define CGAL_CORE_warning_msg(X ,Y) CGAL_error_msg(Y) +#else +#define CGAL_CORE_warning_msg(X ,Y) CGAL_warning_msg(X ,Y) +#endif + + #endif // _CORE_CONFIG_H_ diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h index a8f8c0aea37..0e721dda16a 100644 --- a/CGAL_Core/include/CGAL/CORE/ExprRep.h +++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h @@ -1088,7 +1088,7 @@ void AddSubRep::computeExactFlags() { uMSB() = newValue.uMSB(); // chen: to get tighers value. sign() = newValue.sign(); } else if (lowBound.isInfty()) {//check if rootbound is too big - CGAL_warning_msg(false, "AddSubRep:root bound has exceeded the maximum size but we still cannot decide zero."); + CGAL_CORE_warning_msg(false, "AddSubRep:root bound has exceeded the maximum size but we still cannot decide zero."); } else { // Op(first, second) == 0 lMSB() = CORE_negInfty; sign() = 0; @@ -1181,7 +1181,7 @@ void AddSubRep::computeExactFlags() { //8/9/01, Chee: implement escape precision here: if (i> get_static_EscapePrec()) { get_static_EscapePrecFlag() = -i.asLong();//negative means EscapePrec is used - CGAL_warning_msg(false, "Escape precision triggered"); + CGAL_CORE_warning_msg(false, "Escape precision triggered"); if (get_static_EscapePrecWarning()) std::cout<< "Escape Precision triggered at " << get_static_EscapePrec() << " bits" << std::endl; @@ -1229,7 +1229,7 @@ void AddSubRep::computeApproxValue(const extLong& relPrec, { std::ostringstream oss; oss << "CORE WARNING: a huge lMSB in AddSubRep: " << lMSB(); - CGAL_warning_msg(false, oss.str().c_str()); + CGAL_CORE_warning_msg(false, oss.str().c_str()); } extLong rf = first->uMSB()-lMSB()+relPrec+EXTLONG_FOUR; // 2 better diff --git a/CGAL_Core/include/CGAL/CORE/Expr_impl.h b/CGAL_Core/include/CGAL/CORE/Expr_impl.h index aeae1ef1ea0..c21f88361a3 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Expr_impl.h @@ -1024,7 +1024,7 @@ void MultRep::computeApproxValue(const extLong& relPrec, { std::ostringstream oss; oss << "CORE WARNING: a huge lMSB in AddSubRep " << lMSB(); - CGAL_warning_msg(false, oss.str().c_str()); + CGAL_CORE_warning_msg(false, oss.str().c_str()); } extLong r = relPrec + EXTLONG_FOUR; @@ -1046,7 +1046,7 @@ void DivRep::computeApproxValue(const extLong& relPrec, { std::ostringstream oss; oss << "CORE WARNING: a huge lMSB in AddSubRep " << lMSB(); - CGAL_warning_msg(false, oss.str().c_str()); + CGAL_CORE_warning_msg(false, oss.str().c_str()); } extLong rr = relPrec + EXTLONG_SEVEN; // These rules come from @@ -1079,7 +1079,7 @@ void Expr::debug(int mode, int level, int depthLimit) const { else if (mode == Expr::TREE_MODE) rep->debugTree(level, 0, depthLimit); else - CGAL_warning_msg(false, "unknown debugging mode"); + CGAL_CORE_warning_msg(false, "unknown debugging mode"); std::cout << "---- End Expr debug(): " << std::endl; } diff --git a/CGAL_Core/include/CGAL/CORE/Filter.h b/CGAL_Core/include/CGAL/CORE/Filter.h index c59e69fe1eb..e71c8aa8733 100644 --- a/CGAL_Core/include/CGAL/CORE/Filter.h +++ b/CGAL_Core/include/CGAL/CORE/Filter.h @@ -137,7 +137,7 @@ public: } /// division filteredFp operator/ (const filteredFp& x) const { - CGAL_warning_msg(x.fpVal != 0.0, "possible zero divisor!"); + CGAL_CORE_warning_msg(x.fpVal != 0.0, "possible zero divisor!"); double xxx = core_abs(x.fpVal) / x.maxAbs - (x.ind+1)*CORE_EPS + DBL_MIN; if (xxx > 0) { @@ -150,7 +150,7 @@ public: /// square root filteredFp sqrt () const { - CGAL_warning_msg( !(fpVal < 0.0), "possible negative sqrt!"); + CGAL_CORE_warning_msg( !(fpVal < 0.0), "possible negative sqrt!"); if (fpVal > 0.0) { double val = std::sqrt(fpVal); return filteredFp(val, ( maxAbs / fpVal ) * val, 1 + ind); diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h index 60a95c862e2..2db3de8736e 100644 --- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h +++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h @@ -57,7 +57,7 @@ public: t = t->next; } //); - //CGAL_warning_msg(count == nObjects * blocks.size(), + //CGAL_CORE_warning_msg(count == nObjects * blocks.size(), // "Cannot delete memory as there are cyclic references"); if(count == nObjects * blocks.size()){ diff --git a/CGAL_Core/include/CGAL/CORE/extLong.h b/CGAL_Core/include/CGAL/CORE/extLong.h index 7f01e4e167a..095c5105b8d 100644 --- a/CGAL_Core/include/CGAL/CORE/extLong.h +++ b/CGAL_Core/include/CGAL/CORE/extLong.h @@ -149,7 +149,7 @@ const extLong EXTLONG_EIGHT(8); // private comparison function inline int extLong::cmp(const extLong& x) const { if (isNaN() || x.isNaN()) { - CGAL_warning_msg(false, "Two extLong NaN's cannot be compared!"); + CGAL_CORE_warning_msg(false, "Two extLong NaN's cannot be compared!"); } return (val == x.val) ? 0 : ((val > x.val) ? 1 : -1); } diff --git a/CGAL_Core/include/CGAL/CORE/extLong_impl.h b/CGAL_Core/include/CGAL/CORE/extLong_impl.h index c881bb74b51..f7b967d76d3 100644 --- a/CGAL_Core/include/CGAL/CORE/extLong_impl.h +++ b/CGAL_Core/include/CGAL/CORE/extLong_impl.h @@ -77,7 +77,7 @@ extLong& extLong::operator+= (const extLong& y) { if (flag == 2 || y.flag == 2 || (flag * y.flag < 0)) { #ifdef CORE_DEBUG if (flag * y.flag < 0) //want a message at the first creation of NaN - CGAL_warning_msg(false, "extLong NaN Error in addition."); + CGAL_CORE_warning_msg(false, "extLong NaN Error in addition."); #endif *this = CORE_NaNLong; @@ -96,7 +96,7 @@ extLong& extLong::operator-= (const extLong& y) { if (flag == 2 || y.flag == 2 || (flag * y.flag > 0)) { #ifdef CORE_DEBUG if (flag * y.flag > 0) //want a message at the first creation of NaN - CGAL_warning_msg(false, "extLong NaN Error in subtraction."); + CGAL_CORE_warning_msg(false, "extLong NaN Error in subtraction."); #endif *this = CORE_NaNLong; @@ -131,7 +131,7 @@ extLong& extLong::operator*= (const extLong& y) { *this = CORE_negInfty; } else { #ifdef CORE_DEBUG - CGAL_warning_msg(false, "extLong NaN Error in multiplication."); + CGAL_CORE_warning_msg(false, "extLong NaN Error in multiplication."); #endif *this = CORE_NaNLong; } @@ -144,9 +144,9 @@ extLong& extLong::operator/= (const extLong& y) { if (flag==2 || y.flag==2 || ((flag != 0) && (y.flag != 0)) || (y.val == 0)) { #ifdef CORE_DEBUG if (y.val == 0) - CGAL_warning_msg(false, "extLong NaN Error, Divide by Zero."); + CGAL_CORE_warning_msg(false, "extLong NaN Error, Divide by Zero."); else if ((flag !=0) && (y.flag !=0)) - CGAL_warning_msg(false, "extLong NaN Error, +/-Inf/Inf."); + CGAL_CORE_warning_msg(false, "extLong NaN Error, +/-Inf/Inf."); #endif *this = CORE_NaNLong; @@ -181,7 +181,7 @@ extLong extLong::operator- () const { CGAL_INLINE_FUNCTION int extLong::sign() const { if (flag == 2) - CGAL_warning_msg(false, "NaN Sign can not be determined!"); + CGAL_CORE_warning_msg(false, "NaN Sign can not be determined!"); return ((val == 0) ? 0 : ((val > 0) ? 1 : -1)); } diff --git a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc index 0fffb4ae470..3f53e34da44 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc @@ -1336,7 +1336,7 @@ cout <<"Number of roots at " << xCurr << " are " << numRoots<::pseudoRemainder :\n -- divide by zero polynomial"); + CGAL_CORE_warning_msg(false, "ERROR in Polynomial::pseudoRemainder :\n -- divide by zero polynomial"); return Polynomial(0); // Unit Polynomial (arbitrary!) } if (bTrueDegree > degree) { diff --git a/CGAL_Core/include/CGAL/CORE/poly/Sturm.h b/CGAL_Core/include/CGAL/CORE/poly/Sturm.h index 99e78d6a930..2fe00e3706d 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Sturm.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Sturm.h @@ -607,7 +607,7 @@ public: if (ff == 0) { NEWTON_DIV_BY_ZERO = true; del = 0; - CGAL_warning_msg(false, "Zero divisor in Newton Iteration"); + CGAL_CORE_warning_msg(false, "Zero divisor in Newton Iteration"); return 0; }