You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
385 B
18 lines
385 B
#include "test_I.h"
|
|
|
|
int test_I_lognot (int iterations)
|
|
{
|
|
int error = 0;
|
|
int i;
|
|
// Check involution, sign, and against "+".
|
|
for (i = iterations; i > 0; i--) {
|
|
cl_I a = testrandom_I();
|
|
cl_I b = lognot(a);
|
|
ASSERT1(lognot(b) == a, a);
|
|
ASSERT1(minusp(a) != minusp(b), a);
|
|
ASSERT1(a+b == -1, a);
|
|
}
|
|
// Check special cases 0 and -1.
|
|
ASSERT(lognot(0) == -1);
|
|
return error;
|
|
}
|