]> www.ginac.de Git - cln.git/blob - tests/test_I_ord2.cc
Fix crashes in find_univpoly_ring and related functions
[cln.git] / tests / test_I_ord2.cc
1 #include "test_I.h"
2
3 int test_I_ord2 (int iterations)
4 {
5         int error = 0;
6         int i;
7         // Check against ash and oddp.
8         for (i = iterations; i > 0; i--) {
9                 cl_I a = testrandom_I();
10                 if (a != 0) {
11                         uintL n = ord2(a);
12                         cl_I b = ash(a,-(sintL)n);
13                         ASSERT1(oddp(b), a);
14                         ASSERT1(a == ash(b,(sintL)n), a);
15                 }
16         }
17         return error;
18 }