]> www.ginac.de Git - ginac.git/blobdiff - check/poly_gcd.cpp
- checks adapted to new GCD behavior for partly-factored input polynomials
[ginac.git] / check / poly_gcd.cpp
index 37a310fdfb79c916811e5cc2979ed10c99845bdf..0d8327a39e2dd8023268cd580f9270708d953573 100644 (file)
@@ -68,7 +68,7 @@ static unsigned poly_gcd2(void)
                ex d = pow(e1 + 1, 2);
                ex f = d * pow(e2 - 2, 2);
                ex g = d * pow(e1 + 2, 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 2, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -88,7 +88,7 @@ static unsigned poly_gcd3(void)
                ex d = e1 + 1;
                ex f = d * (e1 - 2);
                ex g = d * (e1 + 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 3, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -111,7 +111,7 @@ static unsigned poly_gcd3p(void)
                ex d = e1 + 1;
                ex f = d * (e1 - 2);
                ex g = d * (e2 + 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 3p, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -136,7 +136,7 @@ static unsigned poly_gcd4(void)
                ex d = e1 + 1;
                ex f = d * (e2 - 1);
                ex g = d * pow(e3 + 2, 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 4, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -161,7 +161,7 @@ static unsigned poly_gcd5(void)
                ex d = e1 - 3;
                ex f = d * (e2 + 3);
                ex g = d * (e3 - 3);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 5, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -181,7 +181,7 @@ static unsigned poly_gcd5p(void)
                ex d = e1 - 1;
                ex f = d * (e1 + 3);
                ex g = d * (e1 - 3);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 5p, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -199,7 +199,7 @@ static unsigned poly_gcd6(void)
                ex d = pow(x, j) * y * (z - 1);
                ex f = d * (pow(x, j) + pow(y, j + 1) * pow(z, j) + 1);
                ex g = d * (pow(x, j + 1) + pow(y, j) * pow(z, j + 1) - 7);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 6, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;