]> www.ginac.de Git - cln.git/blob - tests/test_I_compare.cc
Make GCC compiler flags default to -O
[cln.git] / tests / test_I_compare.cc
1 #include "test_I.h"
2
3 int test_I_compare (int iterations)
4 {
5         int error = 0;
6         int i;
7         // Check anticommutativity.
8         for (i = iterations; i > 0; i--) {
9                 cl_I a = testrandom_I();
10                 cl_I b = testrandom_I();
11                 ASSERT2(compare(a,b) == -compare(b,a), a,b);
12         }
13         // Check  a < b  <==>  a+c < b+c .
14         for (i = iterations; i > 0; i--) {
15                 cl_I a = testrandom_I();
16                 cl_I b = testrandom_I();
17                 cl_I c = testrandom_I();
18                 ASSERT3(compare(a,b) == compare(a+c,b+c), a,b,c);
19         }
20         return error;
21 }