X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_paranoia.cpp;h=51bd3a55ee1baaa61d54a0f166f876d47f61dab6;hp=6c2f4571200409aacd8a37eed3fbbb410d079ef5;hb=56055db8e4780d223f6ddc680fb09ef994691c1d;hpb=84e6538290cbd2b13b755254c62689a404ce91b4;ds=sidebyside diff --git a/check/exam_paranoia.cpp b/check/exam_paranoia.cpp index 6c2f4571..51bd3a55 100644 --- a/check/exam_paranoia.cpp +++ b/check/exam_paranoia.cpp @@ -544,6 +544,18 @@ static unsigned is_polynomial_false_positive() return result; } +// Bug in power::expand reported by Isuru Fernando (fixed 2015-05-07). +static unsigned exam_paranoia21() +{ + symbol x("x"); + ex e = pow(x + sqrt(ex(2))*x, 2).expand(); + if (e.nops() != 2) { + clog << "(x+sqrt(2)*x)^2 was wrongly expanded to " << e << "\n"; + return 1; + } + return 0; +} + unsigned exam_paranoia() { unsigned result = 0; @@ -571,6 +583,7 @@ unsigned exam_paranoia() result += exam_paranoia19(); cout << '.' << flush; result += exam_paranoia20(); cout << '.' << flush; result += is_polynomial_false_positive(); cout << '.' << flush; + result += exam_paranoia21(); cout << '.' << flush; return result; }