[flint] 09/24: Added regression test for composites that were being passed as prime, as reported by Dana Jacobsen.
felix salfelder
felix-guest at moszumanska.debian.org
Wed Jun 25 11:16:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository flint.
commit 63e856010e08665c94f968ce00a5b8a4e468c27d
Author: William Hart <goodwillhart at googlemail.com>
Date: Tue Jun 17 15:40:50 2014 +0100
Added regression test for composites that were being passed as prime, as
reported by Dana Jacobsen.
---
ulong_extras/test/t-is_prime.c | 2 +-
ulong_extras/test/t-is_probabprime.c | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/ulong_extras/test/t-is_prime.c b/ulong_extras/test/t-is_prime.c
index dc61f1c..397055e 100644
--- a/ulong_extras/test/t-is_prime.c
+++ b/ulong_extras/test/t-is_prime.c
@@ -103,7 +103,7 @@ int main(void)
if (!result)
{
flint_printf("FAIL:\n");
- flint_printf("Perfect poweer d = %wu is declared prime\n", d);
+ flint_printf("Perfect power d = %wu is declared prime\n", d);
abort();
}
}
diff --git a/ulong_extras/test/t-is_probabprime.c b/ulong_extras/test/t-is_probabprime.c
index 703adda..b884b77 100644
--- a/ulong_extras/test/t-is_probabprime.c
+++ b/ulong_extras/test/t-is_probabprime.c
@@ -87,7 +87,7 @@ int main(void)
mpz_clear(d_m);
}
- /* Test that powers do not pass */
+ /* Test that powers do not pass */
for (i = 0; i < 10000 * flint_test_multiplier(); i++)
{
pow = n_randint(state, 6) + 2;
@@ -101,11 +101,26 @@ int main(void)
if (!result)
{
flint_printf("FAIL:\n");
- flint_printf("Perfect poweer d = %wu is declared prime\n", d);
+ flint_printf("Perfect power d = %wu is declared prime\n", d);
abort();
}
}
+ /* Regression test, check certain composites do not pass */
+#if FLINT64
+ {
+ d = UWORD(2007193456621);
+
+ result = !n_is_probabprime(d);
+ if (!result)
+ {
+ flint_printf("FAIL:\n");
+ flint_printf("Known composite d = %wu is declared prime\n", d);
+ abort();
+ }
+ }
+#endif
+
FLINT_TEST_CLEANUP(state);
flint_printf("PASS\n");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/flint.git
More information about the debian-science-commits
mailing list