[libmath-prime-util-perl] 01/16: Don't run the long AKS test on any 32-bit platform
Partha P. Mukherjee
ppm-guest at moszumanska.debian.org
Thu May 21 18:46:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
ppm-guest pushed a commit to annotated tag v0.19
in repository libmath-prime-util-perl.
commit 91a9d1c20a72c2b6b4b452717e0493817b126efc
Author: Dana Jacobsen <dana at acm.org>
Date: Fri Dec 21 23:37:32 2012 -0800
Don't run the long AKS test on any 32-bit platform
---
Makefile.PL | 2 +-
lib/Math/Prime/Util.pm | 5 +----
t/22-aks-prime.t | 6 +++++-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index c81d6a6..27629f9 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -20,7 +20,7 @@ WriteMakefile1(
BUILD_REQUIRES=>{
'Test::More' => '0.45',
- 'bignum' => '0.22', # Used for bigint tests
+ 'bignum' => '0.22', # 'use bigint' in tests
},
PREREQ_PM => {
'Exporter' => '5.562',
diff --git a/lib/Math/Prime/Util.pm b/lib/Math/Prime/Util.pm
index efcfe03..7156271 100644
--- a/lib/Math/Prime/Util.pm
+++ b/lib/Math/Prime/Util.pm
@@ -518,10 +518,7 @@ sub primes {
$U = ($irandf->() << 32) + $irandf->();
} while $U >= (18446744073709551615 - $remainder);
}
- #return $U % $range;
- $U %= $range;
- die "random failure: $max $U\n" if $U > $max;
- return $U;
+ return $U % $range;
};
return $randf;
}
diff --git a/t/22-aks-prime.t b/t/22-aks-prime.t
index b736a58..9d1811a 100644
--- a/t/22-aks-prime.t
+++ b/t/22-aks-prime.t
@@ -35,7 +35,11 @@ is( is_aks_prime(877), 1, "is_aks_prime(877) is true" );
#diag "Unfortunately these tests are very slow.";
SKIP: {
- skip "Skipping PP AKS on 32-bit -- just too slow.", 1 if $ispp && !$use64;
+ # If we're pure Perl, then this is definitely too slow. If we have 64-bit
+ # available in the compiler (e.g. uint64_t) , this can still be quite fast.
+ # However for pretty much everyone else, this is just unreasonably slow
+ # for a standard test suite.
+ skip "Skipping PP AKS on 32-bit -- just too slow.", 1 if !$use64;
# The first number that makes it past the sqrt test to actually run.
is( is_aks_prime(69197), 1, "is_aks_prime(69197) is true" );
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git
More information about the Pkg-perl-cvs-commits
mailing list