From 4144ef22b3c55aa2ffab53209bd07c9e705d9ce2 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Mon, 14 Feb 2000 17:51:39 +0000 Subject: [PATCH] - put problematic call in paranoia_check8() into a try-and-catch block. --- check/paranoia_check.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/check/paranoia_check.cpp b/check/paranoia_check.cpp index c5f35573..a47f1c23 100644 --- a/check/paranoia_check.cpp +++ b/check/paranoia_check.cpp @@ -85,7 +85,8 @@ static unsigned paranoia_check2(void) << g.eval() << endl; ++result; } - // This actually worked already back in April 1999. But we are very paranoic! + // This actually worked already back in April 1999. + // But we are *very* paranoic! if (!g.expand().eval().is_zero()) { clog << "e = (x + z*x); f = e*y; eval(expand(f - e*y)) erroneously returned " << g.expand().eval() << endl; @@ -215,12 +216,16 @@ static unsigned paranoia_check8(void) symbol x("x"); ex e = -x / (x+1); - ex f = e.normal(); - - // The bug caused a division by zero in normal(), so the following - // check is actually quite bogus... - if (!f.is_equal(e)) { - clog << "normal(-x/(x+1)) returns " << f << " instead of -x/(x+1)\n"; + ex f; + + try { + f = e.normal(); + if (!f.is_equal(e)) { + clog << "normal(-x/(x+1)) returns " << f << " instead of -x/(x+1)\n"; + ++result; + } + } catch (const exception &e) { + clog << "normal(-x/(x+1) throws " << e.what() << endl; ++result; } return result; -- 2.31.1