3 int test_I_logxor (int iterations)
7 // Check commutativity.
8 for (i = iterations; i > 0; i--) {
9 cl_I a = testrandom_I();
10 cl_I b = testrandom_I();
11 ASSERT2(logxor(a,b) == logxor(b,a), a,b);
13 // Check associativity.
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(logxor(logxor(a,b),c) == logxor(a,logxor(b,c)), a,b,c);
20 // Check special cases 0 and -1.
21 for (i = iterations; i > 0; i--) {
22 cl_I a = testrandom_I();
23 ASSERT1(logxor(a,0) == a, a);
24 ASSERT1(logxor(a,a) == 0, a);
25 ASSERT1(logxor(a,-1) == lognot(a), a);
26 ASSERT1(logxor(a,lognot(a)) == -1, a);