From a2d93b2a8ddc554c498d4f091a87429964db2083 Mon Sep 17 00:00:00 2001 From: gladman Date: Mon, 7 Dec 2009 22:48:54 +0000 Subject: [PATCH] Adjust likely_prime test for Windows --- tests/mpz/t-likely_prime_p.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/mpz/t-likely_prime_p.c b/tests/mpz/t-likely_prime_p.c index 25d2a03c..4de18a8b 100644 --- a/tests/mpz/t-likely_prime_p.c +++ b/tests/mpz/t-likely_prime_p.c @@ -32,7 +32,8 @@ check_rand (void) gmp_randstate_t rands; int i; mpz_t x; - unsigned long bits, p; + unsigned long bits; + mp_limb_t p; mpz_init (x); gmp_randinit_default(rands); @@ -45,13 +46,17 @@ check_rand (void) mpz_urandomm(x, rands, x); bits = mpz_get_ui(x) + 1; mpz_rrandomb(x, rands, bits); - p = mpz_get_ui(x); + p = mpz_getlimbn(x, 0); } while (is_likely_prime_BPSW(p)); if (mpz_probab_prime_p(x, 100)) { printf ("mpz_likely_prime_p\n"); - printf ("%lu is declared composite\n", p); +#ifdef _MSC_VER + printf ("%llu is declared composite\n", p); +#else + printf ("%lu is declared composite\n", p); +#endif abort(); } }