// Test Primpolytest
System.out.println("Testing Primpolytest");
Primpolytest ptest = new Primpolytest();
for (i=0;i<N;i++) {
nflag=ptest.test(pp[i]);
localflag = localflag || nflag==0;
}
globalflag = globalflag || localflag;
if (localflag) {
fail("*** Primpolytest: A known primitive polynomial was not identified as such.");
}
Ran myran = new Ran(17);
mask = ((((long)1 << 32) - 1) >> 1);
for (i=0;i<N;i++) {
nflag=ptest.test((long)(myran.int32()) & mask);
localflag = localflag || nflag!=0;
}
globalflag = globalflag || localflag;
if (localflag) {
fail("*** Primpolytest: A randomly generated 31 bit integer tested positive (unlikely).");