turn warning messages in errors for the testsuite

This commit is contained in:
Sébastien Loriot 2024-02-29 13:16:48 +01:00
parent cac4f5c854
commit 993991eade
11 changed files with 27 additions and 20 deletions

View File

@ -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;

View File

@ -29,4 +29,11 @@
#include <CGAL/export/CORE.h>
#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_

View File

@ -1088,7 +1088,7 @@ void AddSubRep<Operator>::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<Operator>::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<Operator>::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

View File

@ -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;
}

View File

@ -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);

View File

@ -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()){

View File

@ -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);
}

View File

@ -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));
}

View File

@ -1336,7 +1336,7 @@ cout <<"Number of roots at " << xCurr << " are " << numRoots<<endl;
if (!xCurr.isExact()){
std::ostringstream oss;
oss << "xCurr has error! xCurr=" << xCurr;
CGAL_warning_msg(false, oss.str());
CGAL_CORE_warning_msg(false, oss.str());
}
}//main while loop

View File

@ -673,7 +673,7 @@ Polynomial<NT> Polynomial<NT>::pseudoRemainder (
int bTrueDegree = tmpB.degree;
C = NT(1); // Initialized to C=1.
if (bTrueDegree == -1) {
CGAL_warning_msg(false, "ERROR in Polynomial<NT>::pseudoRemainder :\n -- divide by zero polynomial");
CGAL_CORE_warning_msg(false, "ERROR in Polynomial<NT>::pseudoRemainder :\n -- divide by zero polynomial");
return Polynomial(0); // Unit Polynomial (arbitrary!)
}
if (bTrueDegree > degree) {

View File

@ -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;
}