X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;ds=sidebyside;f=check%2Fexam_pseries.cpp;h=2e5d2d6ef9e8e5f2b146022813108eb4db660d86;hb=b60ef16e9be16480499da701216b4a5081ee9a97;hp=1e34be780109581d56527c2486927dc8d9c26231;hpb=f4f7f966d313edf65d46216c7eb48d0791c6537c;p=ginac.git diff --git a/check/exam_pseries.cpp b/check/exam_pseries.cpp index 1e34be78..2e5d2d6e 100644 --- a/check/exam_pseries.cpp +++ b/check/exam_pseries.cpp @@ -3,7 +3,7 @@ * Series expansion test (Laurent and Taylor series). */ /* - * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "exams.h" @@ -348,6 +348,19 @@ static unsigned exam_series12() return result; } +// Test of the patch of Stefan Weinzierl that prevents an infinite loop if +// a factor in a product is a complicated way of writing zero. +static unsigned exam_series13() +{ + unsigned result = 0; + + ex e = (new mul(pow(2,x), (1/x*(-(1+x)/(1-x)) + (1+x)/x/(1-x))) + )->setflag(status_flags::evaluated); + ex d = Order(x); + result += check_series(e,0,d,1); + + return result; +} unsigned exam_pseries() { @@ -368,6 +381,7 @@ unsigned exam_pseries() result += exam_series10(); cout << '.' << flush; result += exam_series11(); cout << '.' << flush; result += exam_series12(); cout << '.' << flush; + result += exam_series13(); cout << '.' << flush; if (!result) { cout << " passed " << endl;