]> www.ginac.de Git - ginac.git/blobdiff - check/exam_pseries.cpp
Synced to HEAD:
[ginac.git] / check / exam_pseries.cpp
index b0ccac3eba904839a21499b0fcbd39812fa7510e..2e5d2d6ef9e8e5f2b146022813108eb4db660d86 100644 (file)
@@ -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;