3 int test_I_logtest (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(logtest(a,b) == logtest(b,a), a,b);
14 for (i = iterations; i > 0; i--) {
15 cl_I a = testrandom_I();
16 cl_I b = testrandom_I();
17 ASSERT2(!logtest(a,logand(b,lognot(a))), a,b);
18 ASSERT2(!logtest(logand(b,lognot(a)),a), a,b);
19 ASSERT2(!logtest(b,logand(a,lognot(b))), a,b);
20 ASSERT2(!logtest(logand(a,lognot(b)),b), a,b);
22 ASSERT2(logtest(a,logior(a,b)), a,b);
24 ASSERT2(logtest(b,logior(a,b)), a,b);
26 // Check some special cases, against ash and logbitp.
27 for (i = iterations; i > 0; i--) {
28 uintL a = random32() % 1024;
29 cl_I b = testrandom_I();
30 ASSERT2(logbitp(a,b) == logtest(b,ash(1,(sintL)a)), a,b);